labs.datasets.transforms.transform¶
Module: labs.datasets.transforms.transform
¶
Inheritance diagram for nipy.labs.datasets.transforms.transform
:
The base Transform class.
This class defines the Transform interface and can be subclassed to define more clever composition logic.
Classes¶
CompositionError
¶
-
class
nipy.labs.datasets.transforms.transform.
CompositionError
[source]¶ Bases:
Exception
The Exception raised when composing transforms with non matching respective input and output word spaces.
-
__init__
($self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
Transform
¶
-
class
nipy.labs.datasets.transforms.transform.
Transform
(input_space, output_space, mapping=None, inverse_mapping=None)[source]¶ Bases:
object
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.
-
__init__
(input_space, output_space, mapping=None, inverse_mapping=None)[source]¶ Create a new transform object.
- Parameters
mapping: callable f(x, y, z)
Callable mapping coordinates from the input space to the output space. It should take 3 numbers or arrays, and return 3 numbers or arrays of the same shape.
inverse_mapping: callable f(x, y, z)
Callable mapping coordinates from the output space to the input space. It should take 3 numbers or arrays, and return 3 numbers or arrays of the same shape.
input_space: string
Name of the input space
output_space: string
Name of the output space
Notes
You need to supply either the mapping or the inverse mapping.
-
mapping
= None¶
-
inverse_mapping
= None¶
-
input_space
= ''¶
-
output_space
= ''¶
-