nigsp.operations.nifti.apply_atlas¶
- nigsp.operations.nifti.apply_atlas(data, atlas, mask=None)[source]¶
Extract average timeseries from an atlas.
- Parameters:
- data
numpy.ndarray
A 3- or 4- D matrix (normally nifti data) of timeseries.
- atlas
numpy.ndarray
A 2- or 3- D matrix representing the atlas, each parcel represented by a different int.
- mask
None
ornumpy.ndarray
, optional A 2- or 3- D matrix representing a mask, all voxels == 0 are excluded from the computation.
- data
- Returns:
numpy.ndarray
A [data.ndim-1]D matrix representing the average timeseries of each parcels.
- Raises:
NotImplementedError
If atlas is 4+ D
ValueError
If atlas or mask have a different shape than the first dimensions of data