Package mvpa :: Package datasets :: Module nifti :: Class NiftiDataset
[hide private]
[frames] | no frames]

Class NiftiDataset

source code


Dataset loading its samples from a NIfTI image or file.

Samples can be loaded from a NiftiImage instance or directly from a NIfTI
file. This class stores all relevant information from the NIfTI file header
and provides information about the metrics and neighborhood information of
all voxels.

Most importantly it allows to map data back into the original data space
and format via :meth:`~mvpa.datasets.nifti.NiftiDataset.map2Nifti`.

This class allows for convenient pre-selection of features by providing a
mask to the constructor. Only non-zero elements from this mask will be
considered as features.

NIfTI files are accessed via PyNIfTI. See
http://niftilib.sourceforge.net/pynifti/ for more information about
pynifti.

Instance Methods [hide private]
 
__init__(self, samples=None, mask=None, dsattr=None, **kwargs)
If samples and mapper arguments are not None the mapper is used to forward-map the samples array and the result is passed to the Dataset constructor.
source code
 
map2Nifti(self, data=None)
Maps a data vector into the dataspace and wraps it with a NiftiImage.
source code

Inherited from mapped.MappedDataset: mapForward, mapReverse, mapSelfReverse, selectFeatures

Class Variables [hide private]
  niftihdr = property(fget= lambda self: self._dsattr ['niftihdr...

Inherited from mapped.MappedDataset: O, __doc__, mapper, samples_original

Method Details [hide private]

__init__(self, samples=None, mask=None, dsattr=None, **kwargs)
(Constructor)

source code 
If samples and mapper arguments are not None the mapper is used to forward-map the samples array and the result is passed to the Dataset constructor.
Parameters:
  • samples, str, |, NiftiImage - Filename of a NIfTI image or a NiftiImage instance.
  • mask, str, |, NiftiImage - Filename of a NIfTI image or a NiftiImage instance.
Overrides: mapped.MappedDataset.__init__

map2Nifti(self, data=None)

source code 
Maps a data vector into the dataspace and wraps it with a NiftiImage. The header data of this object is used to initialize the new NiftiImage.
Parameters:
  • data (ndarray or Dataset) - The data to be wrapped into NiftiImage. If None (default), it would wrap samples of the current dataset. If it is a Dataset instance -- takes its samples for mapping

Class Variable Details [hide private]

niftihdr

Value:
property(fget= lambda self: self._dsattr ['niftihdr'], doc= 'Access to\
 the NIfTI header dictionary.')