Module: labs.datasets.converters

Conversion mechanisms for IO and interaction between volumetric datasets and other type of neuroimaging data.


nipy.labs.datasets.converters.as_volume_img(obj, copy=True, squeeze=True, world_space=None)

Convert the input to a VolumeImg.

objfilename, pynifti or brifti object, or volume dataset.

Input object, in any form that can be converted to a VolumeImg. This includes Nifti filenames, pynifti or brifti objects, or other volumetric dataset objects.

copy: boolean, optional

If copy is True, the data and affine arrays are copied, elsewhere a view is taken.

squeeze: boolean, optional

If squeeze is True, the data array is squeeze on for dimensions above 3.

world_space: string or None, optional

An optional specification of the world space, to override that given by the image.

volume_img: VolumeImg object

A VolumeImg object containing the data. The metadata is kept as much as possible in the metadata attribute.


The world space might not be correctly defined by the input object (in particular, when loading data from disk). In this case, you can correct it manually using the world_space keyword argument.

For pynifti objects, the data is transposed., obj)

Save an nipy image object to a file.