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

Module nifti

source code

Dataset that gets its samples from a NIfTI file
Classes [hide private]
  NiftiDataset
Dataset loading its samples from a NIfTI image or file.
  ERNiftiDataset
Dataset with event-defined samples from a NIfTI timeseries image.
Functions [hide private]
 
getNiftiFromAnySource(src, ensure=False, enforce_dim=None, scale_data=True)
Load/access NIfTI data from files or instances.
source code
 
getNiftiData(nim)
Convenience function to extract the data array from a NiftiImage
source code
 
_get_safe_header(nids)
Given *NiftiDataset, returns a copy of NIfTI header with reset scl_ fields...
source code
Variables [hide private]
  oldname = __name__
  __name__ = __name__

Imports: externals, sys, N, deepcopy, debug, NiftiImage, Dataset, MappedDataset, EventDataset, CombinedMapper, DescreteMetric, cartesianDistance, DenseArrayMapper, warning


Function Details [hide private]

getNiftiFromAnySource(src, ensure=False, enforce_dim=None, scale_data=True)

source code 
Load/access NIfTI data from files or instances.
Parameters:
  • src, str, |, NiftiImage - Filename of a NIfTI image or a NiftiImage instance.
  • ensure (bool) - If True, through ValueError exception if cannot be loaded.
  • 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).
Returns:
NiftiImage | None
If the source is not supported None is returned.

getNiftiData(nim)

source code 

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.

_get_safe_header(nids)

source code 
Given *NiftiDataset, returns a copy of NIfTI header with reset scl_ fields