roiextract.pipeline.LCMVBeamformer#
- class roiextract.pipeline.LCMVBeamformer(fwd, reg=0.05, weight_norm='unit-noise-gain-invariant', cov_tstep=2.0)#
Source reconstruction via an LCMV beamformer. This step wraps the
make_lcmv()andapply_lcmv_raw()functions, allowing quick access to the LCMV beamformer weights.- Parameters:
- fwd
Forward The forward solution to be used for source reconstruction.
- reg
float Regularization parameter for the LCMV beamformer.
- weight_norm
str The weight normalization method to use. Supported methods include
None(corresponding to a unit-gain beamformer),"unit-noise-gain","unit-noise-gain-invariant"(default), and"nai".- cov_tstep
float The time step for computing the data covariance matrix. It is used to compute the covariance matrix from the raw data using
mne.compute_raw_covariance()if no data covariance is provided.
- fwd
Methods
copy()Create a copy of the pipeline step.
fit(data[, data_cov, noise_cov])Fit the LCMV beamformer to the provided data, optionally using custom data and noise covariance matrices.
fit_transform(data[, data_cov, noise_cov])Fit the LCMV beamformer to the provided data and then apply it.
get_names(names)Names for rows of the weight matrix that corresponds to this step.
Get the parameters of the LCMV beamformer.
Get the weight matrix corresponding to the fitted LCMV beamformer.
transform(data)Apply the fitted LCMV beamformer to the provided data.
- copy()#
Create a copy of the pipeline step.
- Returns:
- copy
PipelineStep A copy of the pipeline step.
- copy
- fit(data, data_cov=None, noise_cov=None)#
Fit the LCMV beamformer to the provided data, optionally using custom data and noise covariance matrices. If the custom matrices are not provided, by default, the data covariance is computed from the raw data using
mne.compute_raw_covariance(), and the noise covariance is generated usingmne.make_ad_hoc_cov()with a standard deviation of 1.0.- Parameters:
- data
Raw The raw data to fit the LCMV beamformer on.
- data_cov
Covariance|None, optional The data covariance matrix. If None, it will be computed from the raw data.
- noise_cov
Covariance|None, optional The noise covariance matrix. If None, an ad-hoc covariance matrix will be created.
- data
- Returns:
- self
LCMVBeamformer The fitted LCMV beamformer.
- self
- fit_transform(data, data_cov=None, noise_cov=None)#
Fit the LCMV beamformer to the provided data and then apply it.
- Parameters:
- data
Raw The raw data to fit and apply the LCMV beamformer on.
- data_cov
Covariance|None, optional The data covariance matrix. If None, it will be computed from the raw data.
- noise_cov
Covariance|None, optional The noise covariance matrix. If None, an ad-hoc covariance matrix will be created.
- data
- Returns:
- stc
SourceEstimate The source estimate obtained by applying the LCMV beamformer.
- stc
- get_names(names)#
Names for rows of the weight matrix that corresponds to this step.
- get_params()#
Get the parameters of the LCMV beamformer.
- Returns:
- params
dict A dictionary containing the parameters of the LCMV beamformer.
- params
- get_weights()#
Get the weight matrix corresponding to the fitted LCMV beamformer.
- Returns:
- weights
array, shape (n_sources, n_sensors) The weight matrix of the LCMV beamformer.
- weights
- transform(data)#
Apply the fitted LCMV beamformer to the provided data.
- Parameters:
- data
Raw The raw data to apply the LCMV beamformer on.
- data
- Returns:
- stc
SourceEstimate The source estimate obtained by applying the LCMV beamformer.
- stc