roiextract.pipeline.MeanAggregation#
- class roiextract.pipeline.MeanAggregation(flip=False)#
Averaging-based aggregation of reconstructed source time courses within the ROI. Optionally, a sign flip can be applied before averaging to reduce potential cancellation of activity. This pipeline step corresponds to the
mne.extract_label_time_course()function withmode="mean"ormode="mean_flip".- Parameters:
- flipbool, default=False
Whether to apply a sign flip before averaging. Sign flip is determined based on the singular value decomposition of the leadfield, as performed in
mne.label_sign_flip().
Methods
fit(data, src, labels)Fit the aggregation step to the provided data, source space, and labels.
fit_transform(data, src, labels)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
flipparameter of the aggregation step as a dictionary.Weight matrix corresponding to the resulting aggregation transformation.
transform(data)Apply the fitted aggregation to the provided data.
- fit(data, src, labels)#
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.
- data
- Returns:
- self
MeanAggregation The fitted aggregation step.
- self
- fit_transform(data, src, labels)#
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
flipparameter of the aggregation step as a dictionary.- Returns:
- params
dict The parameters of the aggregation step.
- params
- get_weights()#
Weight matrix corresponding to the resulting aggregation transformation.
- Returns:
- weights
array The weight matrix.
- weights
- transform(data)#
Apply the fitted aggregation to the provided data. The applied transformation corresponds to the
mne.extract_label_time_course()function withmode="mean"ormode="mean_flip"forflip=Falseandflip=True, respectively.- 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