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: Creates the coordinates for resampling. If field_transform is
  None, these are constant and are created in field space; otherwise,
  the final coordinates will be transformed by an input tensor
  representing a transform from output coordinates to field
  coordinates, so they are created are created in output coordinate
  space
docstr_tok: ["Creates","the","coordinates","for","resampling",".","If","field_transform","is","None",",","these","are","constant","and","are","created","in","field","space",";","otherwise",",","the","final","coordinates","will","be","transformed","by","an","input","tensor","representing","a","transform","from","output","coordinates","to","field","coordinates",",","so","they","are","created","are","created","in","output","coordinate","space"]
code: def _create_features(self):
      """Creates the coordinates for resampling. If field_transform is
      None, these are constant and are created in field space; otherwise,
      the final coordinates will be transformed by an input tensor
      representing a transform from output coordinates to field
      coordinates, so they are created are created in output coordinate
      space
      """
      embedded_output_shape = list(self._output_shape) + [1] * (
          len(self._source_shape) - len(self._output_shape)
      )
      embedded_coeff_shape = list(self._coeff_shape) + [1] * (
          len(self._source_shape) - len(self._output_shape)
      )
      if (
          self._field_transform == None
          and self._interpolation == "BSPLINE"
      ):
          range_func = lambda f, x: tf.linspace(1.0, f - 2.0, x)
      elif (
          self._field_transform == None
          and self._interpolation != "BSPLINE"
      ):
          range_func = lambda f, x: tf.linspace(0.0, f - 1.0, x)
      else:
          range_func = lambda f, x: np.arange(x, dtype=np.float32)
          embedded_output_shape += [1]  # make homogeneous
          embedded_coeff_shape += [1]
      ranges = [
          range_func(f, x)
          for f, x in zip(embedded_coeff_shape, embedded_output_shape)
      ]
      coords = tf.stack(
          [
              tf.reshape(x, [1, -1])
              for x in tf.meshgrid(*ranges, indexing="ij")
          ],
          2,
      )
      return coords
  
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 2 for calling the ResampledFieldGridWarperLayer obj's underlying member method code with example usage: obj._create_features() and returns: coords