Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.experimental.surface.SurfaceLabelsMasker#

class nilearn.experimental.surface.SurfaceLabelsMasker(labels_img, label_names=None)[source]#

Extract data from a SurfaceImage, averaging over atlas regions.

Parameters:
labels_imgSurfaceImage object

Region definitions, as one image of labels.

label_nameslist of str, default=None

Full labels corresponding to the labels image.

Attributes:
labels_data_numpy.ndarray
labels_numpy.ndarray
label_names_numpy.ndarray
__init__(labels_img, label_names=None)[source]#
labels_img#
label_names#
labels_data_#
labels_#
label_names_#
fit(img=None, y=None)[source]#

Prepare signal extraction from regions.

Parameters:
imgSurfaceImage object

Mesh and data for both hemispheres.

yNone

This parameter is unused. It is solely included for scikit-learn compatibility.

Returns:
SurfaceLabelsMasker object
transform(img)[source]#

Extract signals from fitted surface object.

Parameters:
imgSurfaceImage object

Mesh and data for both hemispheres.

Returns:
outputnumpy.ndarray

Signal for each element. shape: (img data shape, total number of vertices)

fit_transform(img, y=None)[source]#

Prepare and perform signal extraction from regions.

Parameters:
imgSurfaceImage object

Mesh and data for both hemispheres.

yNone

This parameter is unused. It is solely included for scikit-learn compatibility.

Returns:
numpy.ndarray

Signal for each element. shape: (img data shape, total number of vertices)

inverse_transform(masked_img)[source]#

Transform extracted signal back to surface object.

Parameters:
masked_imgnumpy.ndarray

Extracted signal.

Returns:
SurfaceImage object

Mesh and data for both hemispheres.

Examples using nilearn.experimental.surface.SurfaceLabelsMasker#

A short demo of the surface images & maskers

A short demo of the surface images & maskers