nigsp.operations.nifti.apply_atlas

nigsp.operations.nifti.apply_atlas(data, atlas, mask=None)[source]

Extract average timeseries from an atlas.

Parameters:
datanumpy.ndarray

A 3- or 4- D matrix (normally nifti data) of timeseries.

atlasnumpy.ndarray

A 2- or 3- D matrix representing the atlas, each parcel represented by a different int.

maskNone or numpy.ndarray, optional

A 2- or 3- D matrix representing a mask, all voxels == 0 are excluded from the computation.

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