class_docstr: A transform is a representation of a transformation from one 3D space to
  another. It is composed of a coordinate mapping, or its inverse, as well
  as the name of the input and output spaces.
  
  The Transform class is the base class for transformations and defines
  the transform object API.
docstr: Returns a new transform obtained by composing this transform
  with the one provided.
  
  Parameters
  -----------
  transform: nipy.core.transforms.transform object
      The transform to compose with.
docstr_tok: ["Returns","a","new","transform","obtained","by","composing","this","transform","with","the","one","provided",".","Parameters","--","--","--","--","--","-","transform",":","nipy.core.transforms.transform","object","The","transform","to","compose","with","."]
code: def composed_with(self, transform):
      """Returns a new transform obtained by composing this transform
      with the one provided.
  
      Parameters
      -----------
      transform: nipy.core.transforms.transform object
          The transform to compose with.
      """
      self._check_composition(transform)
      # We don't want to keep references on the transforms, in the
      # closure of the new mapping so we extract their mapping
      # outside of the definition of the new mapping
      first_mapping = self.mapping
      second_mapping = transform.mapping
      if first_mapping is not None and second_mapping is not None:
  
          def new_mapping(x, y, z):
              """ Coordinate mapping from {} to {}.
                  """.format(
                  self.input_space, transform.output_space
              )
              return second_mapping(*first_mapping(x, y, z))
  
      else:
          new_mapping = None
  
      first_inverse_mapping = self.inverse_mapping
      second_inverse_mapping = transform.inverse_mapping
      if (
          first_inverse_mapping is not None
          and second_inverse_mapping is not None
      ):
  
          def new_inverse_mapping(x, y, z):
              """ Coordinate mapping from {} to {}.
                  """.format(
                  transform.output_space, self.input_space
              )
              return first_inverse_mapping(
                  *second_inverse_mapping(x, y, z)
              )
  
      else:
          new_inverse_mapping = None
  
      if new_mapping is None and new_inverse_mapping is None:
          raise CompositionError(
              f"""Composing two transforms with no chainable mapping:
                  {self}
                  and
                  {transform}"""
          )
  
      return Transform(
          self.input_space,
          transform.output_space,
          mapping=new_mapping,
          inverse_mapping=new_inverse_mapping,
      )
  
file_path: nipy/nipy/labs/datasets/transforms/transform.py
label_desc: Use image node_id 2 for calling the Transform obj's underlying member method code with example usage: obj.composed_with(transform) and returns: Transform, second_mapping, first_inverse_mapping