roiextract.pipeline.CentroidAggregation#
- class roiextract.pipeline.CentroidAggregation(surf='sphere')#
Centroid-based aggregation of reconstructed source time courses within the ROI. The time course of the source that is the closest to the center of mass of the ROI is selected as the representative time course of the ROI.
- Parameters:
- surf
str, default=”sphere” The surface to use for computing the center of mass. The provided value is forwarded to
mne.Label.center_of_mass()without modification.
- surf
Methods
fit(data, src, labels[, subject, subjects_dir])Fit the aggregation step to the provided data, source space, and labels.
fit_transform(data, src, labels[, subject, ...])Fit the aggregation step to the provided data, source space, and labels, and apply the aggregation to extract the ROI time courses.
Label names are used as names for rows of the weight matrix.
Get the single
surfparameter of the aggregation step as a dictionary.The weight matrix corresponding to the resulting aggregation transformation.
transform(data)Apply centroid-based aggregation to the provided data.
- fit(data, src, labels, subject=None, subjects_dir=None)#
Fit the aggregation step to the provided data, source space, and labels.
- Parameters:
- data
SourceEstimate The source estimate containing the reconstructed source time courses.
- src
SourceSpaces The definition of the considered source space for inverse modeling.
- labels
Label|listofLabel The label or list of labels defining the ROIs for which time courses should be extracted.
- subject
str|None The subject name. If
None, it will be inferred from the source space.- subjects_dir
str|None The directory containing the subjects’ MRI data. If
None, it will be inferred from the environment by MNE-Python. Set the path explicitly in case of errors.
- data
- Returns:
- self
CentroidAggregation The fitted aggregation step.
- self
- fit_transform(data, src, labels, subject=None, subjects_dir=None)#
Fit the aggregation step to the provided data, source space, and labels, and apply the aggregation to extract the ROI time courses. See
fit()andtransform()for details on the parameters and return values, respectively.
- get_names()#
Label names are used as names for rows of the weight matrix.
- get_params()#
Get the single
surfparameter of the aggregation step as a dictionary.- Returns:
- params
dict The parameters of the aggregation step.
- params
- get_weights()#
The weight matrix corresponding to the resulting aggregation transformation.
- Returns:
- weights
array The weight matrix that contains one non-zero entry per row corresponding to the selected centroid source for each label.
- weights
- transform(data)#
Apply centroid-based aggregation to the provided data.
- Parameters:
- data
SourceEstimate The source estimate containing the reconstructed source time courses.
- data
- Returns:
- label_tc
array, shape (n_labels, n_times) The extracted time courses for each label.
- label_tc