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

Class ERNiftiDataset

source code


Dataset with event-defined samples from a NIfTI timeseries image.

This is a convenience dataset to facilitate the analysis of event-related
fMRI datasets. Boxcar-shaped samples are automatically extracted from the
full timeseries using :class:`~mvpa.misc.support.Event` definition lists.
For each event all volumes covering that particular event in time
(including partial coverage) are used to form the corresponding sample.

The class supports the conversion of events defined in 'realtime' into the
descrete temporal space defined by the NIfTI image. Moreover, potentially
varying offsets between true event onset and timepoint of the first selected
volume can be stored as an additional feature in the dataset.

Additionally, the dataset supports masking. This is done similar to the
masking capabilities of :class:`~mvpa.datasets.nifti.NiftiDataset`. However,
the mask can either be of the same shape as a single NIfTI volume, or
can be of the same shape as the generated boxcar samples, i.e.
a samples consisting of three volumes with 24 slices and 64x64 inplane
resolution needs a mask with shape (3, 24, 64, 64). In the former case the
mask volume is automatically expanded to be identical in a volumes of the
boxcar.

Instance Methods [hide private]
 
__init__(self, samples=None, events=None, mask=None, evconv=False, storeoffset=False, tr=None, enforce_dim=4, scale_data=True, **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. The header data of this object is used to initialize the new NiftiImage (scl_slope and scl_inter are reset to 1.0 and 0.0 accordingly).
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, events=None, mask=None, evconv=False, storeoffset=False, tr=None, enforce_dim=4, scale_data=True, **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:
  • mask, str, |, NiftiImage, |, ndarray - Filename of a NIfTI image or a NiftiImage instance or an ndarray of appropriate shape.
  • evconv, bool - Convert event definitions using onset and duration in some temporal unit into #sample notation.
  • storeoffset, bool - Whether to store temproal offset information when converting Events into descrete time. Only considered when evconv == True.
  • tr, float - Temporal distance of two adjacent NIfTI volumes. This can be used to override the corresponding value in the NIfTI header.
  • enforce_dim (int or None) - If not None, it is the dimensionality of the data to be enforced, commonly 4D for the data, and 3D for the mask in case of fMRI.
  • scale_data (bool) - NIfTI header specifies scl_slope and scl_inter for scaling and offsetting the data. By default those will get applied to the data (change in behavior post 0.4.6).
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 (scl_slope and scl_inter are reset to 1.0 and 0.0 accordingly).

Only the features corresponding to voxels are mapped back -- not any additional features passed via the Event definitions.
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.')