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() and apply_lcmv_raw() functions, allowing quick access to the LCMV beamformer weights.

Parameters:
fwdForward

The forward solution to be used for source reconstruction.

regfloat

Regularization parameter for the LCMV beamformer.

weight_normstr

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_tstepfloat

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.

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_params()

Get the parameters of the LCMV beamformer.

get_weights()

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:
copyPipelineStep

A copy of the pipeline step.

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 using mne.make_ad_hoc_cov() with a standard deviation of 1.0.

Parameters:
dataRaw

The raw data to fit the LCMV beamformer on.

data_covCovariance | None, optional

The data covariance matrix. If None, it will be computed from the raw data.

noise_covCovariance | None, optional

The noise covariance matrix. If None, an ad-hoc covariance matrix will be created.

Returns:
selfLCMVBeamformer

The fitted LCMV beamformer.

fit_transform(data, data_cov=None, noise_cov=None)#

Fit the LCMV beamformer to the provided data and then apply it.

Parameters:
dataRaw

The raw data to fit and apply the LCMV beamformer on.

data_covCovariance | None, optional

The data covariance matrix. If None, it will be computed from the raw data.

noise_covCovariance | None, optional

The noise covariance matrix. If None, an ad-hoc covariance matrix will be created.

Returns:
stcSourceEstimate

The source estimate obtained by applying the LCMV beamformer.

get_names(names)#

Names for rows of the weight matrix that corresponds to this step.

Parameters:
nameslist of str | None

Names for rows of the weight matrix that corresponds to the previous step in the pipeline. None if the names are not available.

Returns:
row_nameslist of str

Names for rows of the weight matrix that corresponds to this step.

get_params()#

Get the parameters of the LCMV beamformer.

Returns:
paramsdict

A dictionary containing the parameters of the LCMV beamformer.

get_weights()#

Get the weight matrix corresponding to the fitted LCMV beamformer.

Returns:
weightsarray, shape (n_sources, n_sensors)

The weight matrix of the LCMV beamformer.

transform(data)#

Apply the fitted LCMV beamformer to the provided data.

Parameters:
dataRaw

The raw data to apply the LCMV beamformer on.

Returns:
stcSourceEstimate

The source estimate obtained by applying the LCMV beamformer.