neuromaps.parcellate.Parcellater
- class neuromaps.parcellate.Parcellater(parcellation, space, resampling_target='data', hemi=None)[source]
Class for parcellating arbitrary volumetric / surface data
- Parameters
parcellation (str or os.PathLike or Nifti1Image or GiftiImage or tuple) – Parcellation image or surfaces, where each region is identified by a unique integer ID. All regions with an ID of 0 are ignored.
space (str) – The space in which parcellation is defined
resampling_target ({'data', 'parcellation', None}, optional) – Gives which image gives the final shape/size. For example, if resampling_target is ‘data’, the parcellation is resampled to the space + resolution of the data, if needed. If it is ‘parcellation’ then any data provided to .fit() are transformed to the space + resolution of parcellation. Providing None means no resampling; if spaces + resolutions of the parcellation and data provided to .fit() do not match a ValueError is raised. Default: ‘data’
hemi ({'L', 'R'}, optional) – If provided parcellation represents only one hemisphere of a surface atlas then this specifies which hemisphere. If not specified it is assumed that parcellation is (L, R) hemisphere. Ignored if space is ‘MNI152’. Default: None
- inverse_transform(data)[source]
Project data to space + density of parcellation
- Parameters
data (array_like) – Parcellated data to be projected to the space of parcellation
- Returns
data – Provided data in space + resolution of parcellation
- Return type
Nifti1Image or tuple-of-nib.GiftiImage
- transform(data, space, hemi=None)[source]
Applies parcellation to data in space
- Parameters
data (str or os.PathLike or Nifti1Image or GiftiImage or tuple) – Data to parcellate
space (str) – The space in which data is defined
hemi ({'L', 'R'}, optional) – If provided data represents only one hemisphere of a surface dataset then this specifies which hemisphere. If not specified it is assumed that data is (L, R) hemisphere. Ignored if space is ‘MNI152’. Default: None
- Returns
parcellated – Parcellated data
- Return type
np.ndarray