class_docstr: The base volumetric structure.
  
  This object represents numerical values embedded in a
  3-dimensional world space (called a field in physics and
  engineering)
  
  This is an abstract base class: it defines the interface, but not
  the logics.
  
  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.
docstr: Return a new image embedding the same data in a different
  word space using the given world to world transform.
  
  Parameters
  ----------
  w2w_transform : transform object
      The transform object giving the mapping between
      the current world space of the image, and the new
      word space.
  
  Returns
  --------
  remapped_image : nipy image
      An image containing the same data, expressed
      in the new world space.
docstr_tok: ["Return","a","new","image","embedding","the","same","data","in","a","different","word","space","using","the","given","world","to","world","transform",".","Parameters","--","--","--","--","--","w2w_transform",":","transform","object","The","transform","object","giving","the","mapping","between","the","current","world","space","of","the","image",",","and","the","new","word","space",".","Returns","--","--","--","--","remapped_image",":","nipy","image","An","image","containing","the","same","data",",","expressed","in","the","new","world","space","."]
code: def composed_with_transform(self, w2w_transform):
      """Return a new image embedding the same data in a different
      word space using the given world to world transform.
  
      Parameters
      ----------
      w2w_transform : transform object
          The transform object giving the mapping between
          the current world space of the image, and the new
          word space.
  
      Returns
      --------
      remapped_image : nipy image
          An image containing the same data, expressed
          in the new world space.
      """
      if not w2w_transform.input_space == self.world_space:
          raise CompositionError(
              "The transform given does not apply to "
              f"the image's world space:\n{w2w_transform}\n\n{self}"
          )
      new_img = self._apply_transform(w2w_transform)
      new_img.world_space = w2w_transform.output_space
      return new_img
  
file_path: nipy/nipy/labs/datasets/volumes/volume_field.py
imports: from ..transforms.transform import CompositionError
label_desc: Use image node_id 5 for calling the VolumeField obj's underlying member method code with example usage: obj.composed_with_transform(w2w_transform) and returns: new_img