Inheritance diagram for nipy.labs.datasets.volumes.volume_img:
An image that stores the data as an (x, y, z, ...) array, with an affine mapping to the world space
Bases: nipy.labs.datasets.volumes.volume_grid.VolumeGrid
A regularly-spaced image for embedding data in an x, y, z 3D world, for neuroimaging.
This object is an ndarray representing a volume, with the first 3 dimensions being spatial, and mapped to a named world space using an affine (4x4 matrix).
Notes
The data is stored in an undefined way: prescalings might need to be applied to it before using it, or the data might be loaded on demand. The best practice to access the data is not to access the _data attribute, but to use the get_data method.
Attributes
affine | |
world_space | str(object=’‘) -> string |
metadata | |
interpolation | str(object=’‘) -> string |
_data : | Private pointer to the data. |
Methods
as_volume_img([affine, shape, ...]) | Resample the image to be an image with the data points lying |
composed_with_transform(w2w_transform) | Return a new image embedding the same data in a different word space using the given world to world transform. |
get_affine() | |
get_data() | Return data as a numpy array. |
get_transform() | Returns the transform object associated with the volumetric structure which is a general description of the mapping from the values to the world space. |
get_world_coords() | Return the data points coordinates in the world space. |
like_from_data(data) | Returns an volumetric data structure with the same relationship between data and world space, and same metadata, but different data. |
resampled_to_img(target_image[, interpolation]) | Resample the data to be on the same voxel grid than the target volume structure. |
values_in_world(x, y, z[, interpolation]) | Return the values of the data at the world-space positions given by |
xyz_ordered([resample, copy]) | Returns an image with the affine diagonal and positive in the world space it is embedded in. |
Creates a new neuroimaging image with an affine mapping.
Parameters: | data : ndarray
affine : 4x4 ndarray
world_space : string
metadata : dictionnary
|
---|
Resample the image to be an image with the data points lying on a regular grid with an affine mapping to the word space (a nipy VolumeImg).
Parameters: | affine: 4x4 or 3x3 ndarray, optional :
shape: (n_x, n_y, n_z), tuple of integers, optional :
interpolation : None, ‘continuous’ or ‘nearest’, optional
|
---|---|
Returns: | resampled_image : nipy VolumeImg
|
Notes
The coordinate system of the image is not changed: the returned image points to the same world space.
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
|
---|---|
Returns: | remapped_image : nipy image
|
Return data as a numpy array.
Returns the transform object associated with the volumetric structure which is a general description of the mapping from the values to the world space.
Returns: | transform : nipy.datasets.Transform object |
---|
Return the data points coordinates in the world space.
Returns: | x: ndarray :
y: ndarray :
z: ndarray :
|
---|
Returns an volumetric data structure with the same relationship between data and world space, and same metadata, but different data.
Parameters: | data: ndarray : |
---|
Resample the data to be on the same voxel grid than the target volume structure.
Parameters: | target_image : nipy image
interpolation : None, ‘continuous’ or ‘nearest’, optional
|
---|---|
Returns: | resampled_image : nipy_image
|
Notes
Both the target image and the original image should be embedded in the same world space.
Return the values of the data at the world-space positions given by x, y, z
Parameters: | x : number or ndarray
y : number or ndarray
z : number or ndarray
interpolation : None, ‘continuous’ or ‘nearest’, optional
|
---|---|
Returns: | values : number or ndarray
|
Returns an image with the affine diagonal and positive in the world space it is embedded in.
Parameters: | resample: boolean, optional :
copy: boolean, optional :
|
---|