meeg_utils.steps.HFC#

class meeg_utils.steps.HFC(order=1, *, accuracy='accurate')[source]#

Remove environmental fields from OPM data by a homogeneous or harmonic field model.

On-head OPM arrays have no reference sensors or fixed helmet, so the interference is modelled as a spatially smooth field: homogeneous (order=1; Tierney et al., 2021, NeuroImage 244:118484) or a low-order spherical-harmonic expansion (order=2 adds gradients; Tierney et al., 2022, NeuroImage 258:119338). The field is fitted from the sensor positions and orientations alone (mne.preprocessing.compute_proj_hfc()) and projected out of the good MEG channels.

Parameters:
  • order (int) – Order of the field model: 1 (homogeneous, 3 components), 2 (plus gradients, 8 components), …

  • accuracy ({"point", "normal", "accurate"}) – Coil-definition accuracy used for the model.

projs_#

The projectors, fitted from the sensor geometry.

Type:

list of Projection

qc_#

n_components (projected out), n_channels, axes_per_location (median number of sensors per location; with one, HFC also removes brain signal and a warning is raised), power_change_db (good MEG channels, after relative to before; strongly negative values mean much interference was removed) and shielding_db (power reduction below 10 Hz, where environmental fields dominate).

Type:

dict

psd_#

PSDs before and after the last transform.

Type:

dict

Notes

The projectors are applied to the data and stored as active projectors in info["projs"], so later rank estimates (e.g. for ICA) account for them; existing projectors are left as they are. Mark bad channels first: they are excluded from the model and left unchanged.

Figures (plot()): "psd", spectra before and after.

__init__(order=1, *, accuracy='accurate')[source]#

Methods

__init__([order, accuracy])

fit(inst[, y, system])

Learn the step's state from the data.

fit_transform(inst[, y, system, copy])

Fit the step on the data and transform the same data.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

plot([kind, inst])

Draw quality-control figures.

set_fit_request(*[, inst, system])

Configure whether metadata should be requested to be passed to the fit method.

set_params(**params)

Set the parameters of this estimator.

set_transform_request(*[, copy, inst])

Configure whether metadata should be requested to be passed to the transform method.

transform(inst, *[, copy])

Apply the fitted step to the data.

Attributes

accepts

Data types the step accepts.

adds_annotations

Whether the step may add BAD_ annotations (existing ones are kept).

changes_channels

Whether the step may add, drop or reorder channels.

changes_times

Whether the step may change the time axis (e.g. resampling, cropping).

drops_epochs

Whether the step may drop epochs (e.g. artifact rejection).

plot_kinds

kind -> whether it needs data (inst).

returns

Data type the step returns; None means the same type as its input.

systems

Acquisition systems the step applies to; None means all systems.

accepts: ClassVar[tuple[type, ...]] = (<class 'mne.io.base.BaseRaw'>, <class 'mne.epochs.BaseEpochs'>, <class 'mne.evoked.Evoked'>)#

Data types the step accepts.

systems: ClassVar[frozenset[str] | None] = frozenset({'opm'})#

Acquisition systems the step applies to; None means all systems.

plot_kinds: ClassVar[dict[str, bool]] = {'psd': False}#

kind -> whether it needs data (inst). Each kind is drawn by a _plot_<kind>(inst, **kwargs) method.

Type:

Figures the object can draw once fitted