labs.datasets.transforms.transform

Module: labs.datasets.transforms.transform

Inheritance diagram for nipy.labs.datasets.transforms.transform:

digraph inheritance86ed0a510d { rankdir=LR; size="8.0, 12.0"; "transforms.transform.CompositionError" [URL="#nipy.labs.datasets.transforms.transform.CompositionError",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="The Exception raised when composing transforms with non matching"]; "transforms.transform.Transform" [URL="#nipy.labs.datasets.transforms.transform.Transform",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A transform is a representation of a transformation from one 3D space to"]; }

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 = ''
composed_with(transform)[source]

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.

get_inverse()[source]

Return the inverse transform.