Skip to content

Commit

Permalink
Option to specify regularisation in beamforming.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohil8 committed Feb 14, 2024
1 parent 8d7927b commit 1578f52
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions osl/source_recon/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def beamform(
freq_range,
chantypes,
rank,
reg=0,
):
"""Wrapper function for beamforming.
Expand All @@ -433,6 +434,8 @@ def beamform(
Channel types to use in beamforming.
rank : dict
Keys should be the channel types and the value should be the rank to use.
reg : float
The regularization for the whitened data covariance.
"""
logger.info("beamforming")

Expand Down Expand Up @@ -470,6 +473,7 @@ def beamform(
chantypes=chantypes,
weight_norm="nai",
rank=rank,
reg=reg,
save_filters=True,
)

Expand All @@ -485,6 +489,7 @@ def beamform(
"beamform": True,
"chantypes": chantypes,
"rank": rank,
"reg": reg,
"freq_range": freq_range,
"filters_cov_plot": filters_cov_plot,
"filters_svd_plot": filters_svd_plot,
Expand Down Expand Up @@ -665,6 +670,7 @@ def beamform_and_parcellate(
spatial_resolution=None,
reference_brain="mni",
extra_chans="stim",
reg=0,
):
"""Wrapper function for beamforming and parcellation.
Expand Down Expand Up @@ -704,6 +710,8 @@ def beamform_and_parcellate(
extra_chans : str or list of str
Extra channels to include in the parc-raw.fif file. Defaults to 'stim'.
Stim channels are always added to parc-raw.fif in addition to extra_chans.
reg : float
The regularization for the whitened data covariance in the beamforming stage.
"""
logger.info("beamform_and_parcellate")

Expand Down Expand Up @@ -741,6 +749,7 @@ def beamform_and_parcellate(
chantypes=chantypes,
weight_norm="nai",
rank=rank,
reg=reg,
save_filters=True,
)

Expand Down Expand Up @@ -823,6 +832,7 @@ def beamform_and_parcellate(
"parcellate": True,
"chantypes": chantypes,
"rank": rank,
"reg": reg,
"freq_range": freq_range,
"filters_cov_plot": filters_cov_plot,
"filters_svd_plot": filters_svd_plot,
Expand Down

0 comments on commit 1578f52

Please sign in to comment.