class_docstr: The fast BSpline Grid Warper defines a grid based on
      sampling coordinate values from a spatially varying displacement
      field  (passed as a tensor input) along a regular cartesian grid
      pattern aligned with the field. Specifically,
  this class defines a grid based on BSpline smoothing, as described by Rueckert et al.
      To ensure that it can be done efficiently, several assumptions are made:
      1) The grid is a cartesian grid aligned with the field.
      2) Knots occur every M,N,O grid points (in X,Y,Z) This allows the
         smoothing to be represented as a 4x4x4 convolutional kernel with MxNxO channels
class_docstr_tok: ["The","fast","BSpline","Grid","Warper","defines","a","grid","based","on","sampling","coordinate","values","from","a","spatially","varying","displacement","field","(","passed","as","a","tensor","input",")","along","a","regular","cartesian","grid","pattern","aligned","with","the","field",".","Specifically",",","this","class","defines","a","grid","based","on","BSpline","smoothing",",","as","described","by","Rueckert","et","al",".","To","ensure","that","it","can","be","done","efficiently",",","several","assumptions","are","made",":","1",")","The","grid","is","a","cartesian","grid","aligned","with","the","field",".","2",")","Knots","occur","every","M",",","N",",","O","grid","points","(","in","X",",","Y",",","Z",")","This","allows","the","smoothing","to","be","represented","as","a","4x4x4","convolutional","kernel","with","MxNxO","channels"]
docstr: Constructs an BSplineFieldImageGridWarperLayer.
  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.
    knot_spacing: List of intervals (in voxels) in each dimension where
      displacements are defined in the field.
    interpolation: type_str of interpolation as used by tf.image.resize_images
    name: Name of Module.
docstr_tok: ["Constructs","an","BSplineFieldImageGridWarperLayer",".","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",".","knot_spacing",":","List","of","intervals","(","in","voxels",")","in","each","dimension","where","displacements","are","defined","in","the","field",".","interpolation",":","type_str","of","interpolation","as","used","by","tf.image.resize_images","name",":","Name","of","Module","."]
code: def __init__(
      self,
      source_shape,
      output_shape,
      knot_spacing,
      name="interpolated_spline_grid_warper_layer",
  ):
      """Constructs an BSplineFieldImageGridWarperLayer.
      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.
        knot_spacing: List of intervals (in voxels) in each dimension where
          displacements are defined in the field.
        interpolation: type_str of interpolation as used by tf.image.resize_images
        name: Name of Module."""
      coeff_shape = [
          4 + (n - 1) // k for n, k in zip(output_shape, knot_spacing)
      ]
      self._knot_spacing = knot_spacing
      super(BSplineFieldImageGridWarperLayer, 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 BSplineFieldImageGridWarperLayer object from inherited base classes: GridWarperLayer with example: obj = BSplineFieldImageGridWarperLayer(source_shape, output_shape, knot_spacing, name)