class_docstr: The resampled field grid warper defines a grid based on
  sampling coordinate values from a spatially varying displacement
  field  (passed as a tensor input) along an affine grid pattern
  in the field.
  This enables grids representing small patches of a larger transform,
  as well as the composition of multiple transforms before sampling.
class_docstr_tok: ["The","resampled","field","grid","warper","defines","a","grid","based","on","sampling","coordinate","values","from","a","spatially","varying","displacement","field","(","passed","as","a","tensor","input",")","along","an","affine","grid","pattern","in","the","field",".","This","enables","grids","representing","small","patches","of","a","larger","transform",",","as","well","as","the","composition","of","multiple","transforms","before","sampling","."]
docstr: Constructs an ResampledFieldingGridWarperLayer.
  Args:
    source_shape: Iterable of integers determining the size of the source
      signal domain.
    output_shape: Iterable of integers determining the size of the destination
      resampled signal domain.
    coeff_shape: Shape of displacement field.
    interpolation: type_str of interpolation as used by tf.image.resize_images
    name: Name of Module.
    field_transform: an object defining the spatial relationship between the
      output_grid and the field.
      batch_size x4x4 tensor: per-image transform matrix from output coords to field coords
      None (default):         corners of output map to corners of field with an allowance for
                                interpolation (1 for bspline, 0 for linear)
    resampler: a ResamplerLayer used to interpolate the
      deformation field
    name: Name of module.
  
  Raises:
    TypeError: If output_shape and source_shape are not both iterable.
docstr_tok: ["Constructs","an","ResampledFieldingGridWarperLayer",".","Args",":","source_shape",":","Iterable","of","integers","determining","the","size","of","the","source","signal","domain",".","output_shape",":","Iterable","of","integers","determining","the","size","of","the","destination","resampled","signal","domain",".","coeff_shape",":","Shape","of","displacement","field",".","interpolation",":","type_str","of","interpolation","as","used","by","tf.image.resize_images","name",":","Name","of","Module",".","field_transform",":","an","object","defining","the","spatial","relationship","between","the","output_grid","and","the","field",".","batch_size","x4x4","tensor",":","per-image","transform","matrix","from","output","coords","to","field","coords","None","(","default",")",":","corners","of","output","map","to","corners","of","field","with","an","allowance","for","interpolation","(","1","for","bspline",",","0","for","linear",")","resampler",":","a","ResamplerLayer","used","to","interpolate","the","deformation","field","name",":","Name","of","module",".","Raises",":","TypeError",":","If","output_shape","and","source_shape","are","not","both","iterable","."]
code: def __init__(
      self,
      source_shape,
      output_shape,
      coeff_shape,
      field_transform=None,
      resampler=None,
      name="resampling_interpolated_spline_grid_warper",
  ):
      """Constructs an ResampledFieldingGridWarperLayer.
      Args:
        source_shape: Iterable of integers determining the size of the source
          signal domain.
        output_shape: Iterable of integers determining the size of the destination
          resampled signal domain.
        coeff_shape: Shape of displacement field.
        interpolation: type_str of interpolation as used by tf.image.resize_images
        name: Name of Module.
        field_transform: an object defining the spatial relationship between the
          output_grid and the field.
          batch_size x4x4 tensor: per-image transform matrix from output coords to field coords
          None (default):         corners of output map to corners of field with an allowance for
                                    interpolation (1 for bspline, 0 for linear)
        resampler: a ResamplerLayer used to interpolate the
          deformation field
        name: Name of module.
  
      Raises:
        TypeError: If output_shape and source_shape are not both iterable.
      """
      if resampler == None:
          self._resampler = ResamplerLayer(
              interpolation="LINEAR", boundary="REPLICATE"
          )
          self._interpolation = "LINEAR"
      else:
          self._resampler = resampler
          self._interpolation = self._resampler.interpolation
  
      self._field_transform = field_transform
  
      super(ResampledFieldGridWarperLayer, self).__init__(
          source_shape=source_shape,
          output_shape=output_shape,
          coeff_shape=coeff_shape,
          name=name,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from niftynet.layer.grid_warper import GridWarperLayer
  from niftynet.layer.resampler import ResamplerLayer
label_desc: Use image node_id 1 to create a new ResampledFieldGridWarperLayer object from inherited base classes: GridWarperLayer with example: obj = ResampledFieldGridWarperLayer(source_shape, output_shape, coeff_shape, field_transform, resampler, name)