Multivariate Pattern Analysis in Python |
Inheritance diagram for mvpa.datasets.nifti:
Dataset that gets its samples from a NIfTI file
Bases: mvpa.datasets.event.EventDataset
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 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 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.
Parameters: |
|
---|
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).
Note
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 |
---|
Access to the NIfTI header dictionary.
Bases: mvpa.datasets.mapped.MappedDataset
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 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.
Parameters: |
|
---|
Time difference between two samples (in seconds). AKA TR in fMRI world.
Return the temporal distance of two samples/volumes.
This method tries to be clever and always returns dt in seconds, by using unit information from the NIfTI header. If such information is not present the assumed unit will also be seconds.
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).
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 |
---|
Access to the NIfTI header dictionary.
Sampling rate (based on .dt).
Convenience function to extract the data array from a NiftiImage
This function will make use of advanced features of PyNIfTI to prevent unnecessary copying if a sufficent version is available.
Load/access NIfTI data from files or instances.
Parameters: |
|
---|---|
Return type: | NiftiImage | None |
Returns: | If the source is not supported None is returned. |