class_docstr: A class representing data stored in a 3+D array embedded in a 3D
  world.
  
  This object has data stored in an array-like multidimensional
  indexable objects, with the 3 first dimensions corresponding to
  spatial axis and defining a 3D grid that may be non-regular or
  non-rigid.
  
  The object knows how the data is mapped to a 3D "real-world
  space", and how it can change real-world coordinate system. The
  transform mapping it to world is arbitrary, and thus the grid
  can be warped: in the world space, the grid may not be regular or
  orthogonal.
  
  Attributes
  -----------
  
  world_space: string
      World space the data is embedded in. For instance `mni152`.
  
  metadata: dictionary
      Optional, user-defined, dictionary used to carry around
      extra information about the data as it goes through
      transformations. The consistency of this information is not
      maintained as the data is modified.
  
  _data:
      Private pointer to the data.
  
  Notes
  ------
  
  The data is stored in an undefined way: prescalings might need to
  be applied to it before using it, or the data might be loaded on
  demand. The best practice to access the data is not to access the
  _data attribute, but to use the `get_fdata` method.
  
  If the transform associated with the image has no inverse
  mapping, data corresponding to a given world space position cannot
  be calculated. If it has no forward mapping, it is impossible to
  resample another dataset on the same support.
class_docstr_tok: ["A","class","representing","data","stored","in","a","3+D","array","embedded","in","a","3D","world",".","This","object","has","data","stored","in","an","array-like","multidimensional","indexable","objects",",","with","the","3","first","dimensions","corresponding","to","spatial","axis","and","defining","a","3D","grid","that","may","be","non-regular","or","non-rigid",".","The","object","knows","how","the","data","is","mapped","to","a","3D","``","real-world","space","''",",","and","how","it","can","change","real-world","coordinate","system",".","The","transform","mapping","it","to","world","is","arbitrary",",","and","thus","the","grid","can","be","warped",":","in","the","world","space",",","the","grid","may","not","be","regular","or","orthogonal",".","Attributes","--","--","--","--","--","-","world_space",":","string","World","space","the","data","is","embedded","in",".","For","instance","`","mni152","`",".","metadata",":","dictionary","Optional",",","user-defined",",","dictionary","used","to","carry","around","extra","information","about","the","data","as","it","goes","through","transformations",".","The","consistency","of","this","information","is","not","maintained","as","the","data","is","modified",".","_data",":","Private","pointer","to","the","data",".","Notes","--","--","--","The","data","is","stored","in","an","undefined","way",":","prescalings","might","need","to","be","applied","to","it","before","using","it",",","or","the","data","might","be","loaded","on","demand",".","The","best","practice","to","access","the","data","is","not","to","access","the","_data","attribute",",","but","to","use","the","`","get_fdata","`","method",".","If","the","transform","associated","with","the","image","has","no","inverse","mapping",",","data","corresponding","to","a","given","world","space","position","can","not","be","calculated",".","If","it","has","no","forward","mapping",",","it","is","impossible","to","resample","another","dataset","on","the","same","support","."]
docstr: The base image containing data.
  
  Parameters
  ----------
  
  data: ndarray
      n dimensional array giving the embedded data, with the 3
      first dimensions being spatial.
  transform: nipy transform object
      The transformation from voxel to world.
  metadata : dictionary, optional
      Dictionary of user-specified information to store with
      the image.
  interpolation : 'continuous' or 'nearest', optional
      Interpolation type used when calculating values in
      different word spaces.
docstr_tok: ["The","base","image","containing","data",".","Parameters","--","--","--","--","--","data",":","ndarray","n","dimensional","array","giving","the","embedded","data",",","with","the","3","first","dimensions","being","spatial",".","transform",":","nipy","transform","object","The","transformation","from","voxel","to","world",".","metadata",":","dictionary",",","optional","Dictionary","of","user-specified","information","to","store","with","the","image",".","interpolation",":","'continuous","'","or","'nearest","'",",","optional","Interpolation","type","used","when","calculating","values","in","different","word","spaces","."]
code: def __init__(
      self, data, transform, metadata=None, interpolation="continuous"
  ):
      """The base image containing data.
  
      Parameters
      ----------
  
      data: ndarray
          n dimensional array giving the embedded data, with the 3
          first dimensions being spatial.
      transform: nipy transform object
          The transformation from voxel to world.
      metadata : dictionary, optional
          Dictionary of user-specified information to store with
          the image.
      interpolation : 'continuous' or 'nearest', optional
          Interpolation type used when calculating values in
          different word spaces.
      """
      if interpolation not in ("continuous", "nearest"):
          raise ValueError(
              "interpolation must be either continuous " "or nearest"
          )
      self._data = data
      self._transform = transform
      self.world_space = transform.output_space
      if metadata is None:
          metadata = {}
      self.metadata = metadata
      self.interpolation = interpolation
  
file_path: nipy/nipy/labs/datasets/volumes/volume_grid.py
imports: import copy
  import numpy
  from scipy import ndimage
  from ..transforms.affine_utils import apply_affine, from_matrix_vector
  from .volume_data import VolumeData
label_desc: Use image node_id 1 to create a new VolumeGrid object from inherited base classes: VolumeData with example: obj = VolumeGrid(data, transform, metadata, interpolation)