Bases: object
Image class.
An image is a real-valued mapping from a regular 3D lattice which is related to the world via an affine transformation. It can be masked, in which case only in-mask image values are kept in memory.
Methods
set | |
transform | |
values |
The base image class.
Parameters : | data: ndarray :
affine: ndarray :
world: string, optional :
background: number, optional :
|
---|
values can be either a 1d array with size equal to self.size or a 3d array with shape equal to self.shape.
Apply a transformation to the image considered as ‘floating’ to bring it into the same grid as a given ‘reference’ image. The transformation is assumed to go from the ‘reference’ to the ‘floating’.
transform: nd array
either a 4x4 matrix describing an affine transformation
or a 3xN array describing voxelwise displacements of the reference grid points
precomputed : boolean True for a precomputed transformation, False for affine
grid_coords : boolean
True if the transform maps to grid coordinates, False if it maps to world coordinates
reference: reference image, defaults to input.
Return interpolated values at the points specified by coords.
Parameters : | coords: sequence of 3 ndarrays, optional :
grid_coords: boolean, optional :
|
---|---|
Returns : | output: ndarray :
|
Bases: nipy.neurospin.image.image.Image
If values is a 1d array with size equal to self.size, a MaskedImage instance is returned.
If values is a 3d array with shape equal to self.shape, a (non-masked) Image instance is returned.
Apply a transformation to the image considered as ‘floating’ to bring it into the same grid as a given ‘reference’ image. The transformation is assumed to go from the ‘reference’ to the ‘floating’.
transform: nd array
either a 4x4 matrix describing an affine transformation
or a 3xN array describing voxelwise displacements of the reference grid points
precomputed : boolean True for a precomputed transformation, False for affine
grid_coords : boolean
True if the transform maps to grid coordinates, False if it maps to world coordinates
reference: reference image, defaults to input.
Return interpolated values at the points specified by coords.
Parameters : | coords: sequence of 3 ndarrays, optional :
grid_coords: boolean, optional :
|
---|---|
Returns : | output: ndarray :
|
T is a 4x4 matrix. xyz is a Nx3 array of 3d coordinates stored row-wise.
Parameters : | affine: ndarray :
coords: tuple of ndarrays :
|
---|
Convert coords into a tuple of ndarrays