Skip to content

Maxwell filtering

Maxwell filtering for a single continuous MEG recording or for multiple recording blocks.

almkanal.almkanal_steps.channel_utils.Maxwell

Bases: AlmKanalStep

Apply Maxwell filtering to a continuous raw MEG recording.

Maxwell applies Signal Space Separation (SSS) and, optionally, temporal Signal Space Separation (tSSS) to a single :class:mne.io.BaseRaw recording.

The step can also transform the data to a specified destination head position and use system-specific fine-calibration and cross-talk compensation files.

Parameters:

Name Type Description Default
mw_coord_frame str

Coordinate frame used for Maxwell filtering. Typically 'head' or 'meg'.

'head'
mw_destination array - like | None

Destination head position used during Maxwell filtering. None keeps the destination behavior defined by the underlying Maxwell-filtering routine.

None
mw_st_duration float | None

Temporal Signal Space Separation (tSSS) buffer duration, in seconds. None disables temporal SSS.

None
mw_calibration_file str | bool | None

Fine-calibration information passed to Maxwell filtering. A path specifies an external calibration file. With None, calibration embedded in data.info is used when available. True requires embedded calibration information, whereas False disables fine calibration.

None
mw_cross_talk_file str | bool | None

Cross-talk compensation passed to Maxwell filtering. A path specifies an external cross-talk file. With None, cross-talk information embedded in data.info is used when available. True requires embedded cross-talk information, whereas False disables it.

None
mw_st_correlation float

Correlation threshold used by temporal Signal Space Separation (tSSS). Only relevant when mw_st_duration is not None.

0.98
Notes

The input must be a continuous :class:mne.io.BaseRaw object. Maxwell filtering is performed through :func:run_maxwell using the configured coordinate frame, destination, calibration file, cross-talk file, and tSSS settings.

The processed raw object is returned under 'data'.

The processing metadata returned by :meth:run is stored under 'maxwell_info' and contains the effective coordinate frame, destination, calibration file, cross-talk file, and tSSS duration.

Maxwell can occur only once in a pipeline and is intended to run before ICA, forward modelling, spatial filtering, and source reconstruction.

See Also

run_maxwell Apply Maxwell filtering to a raw MEG recording. MultiBlockMaxwell Apply Maxwell filtering to multiple recording blocks before concatenating them.

almkanal.almkanal_steps.channel_utils.MultiBlockMaxwell

Bases: AlmKanalStep

Apply Maxwell filtering to multiple raw MEG recording blocks.

MultiBlockMaxwell applies Maxwell filtering independently to each raw MEG block and then concatenates the filtered blocks into a single continuous recording.

All blocks are transformed to a common destination position before concatenation. If mw_destination is not provided, the destination is computed from the median device-to-head translation across all input blocks.

Parameters:

Name Type Description Default
mw_coord_frame str

Coordinate frame used for Maxwell filtering. Typically 'head' or 'meg'.

'head'
mw_destination array - like | None

Destination head position used during Maxwell filtering. If None, a common destination is derived by taking the median of the translation components of info['dev_head_t'] across all input blocks.

None
mw_calibration_file str | None

Path to the fine-calibration file used by Maxwell filtering.

None
mw_cross_talk_file str | None

Path to the cross-talk compensation file used by Maxwell filtering.

None
mw_st_duration float | None

Temporal Signal Space Separation (tSSS) buffer duration, in seconds. None disables temporal SSS.

None
mw_st_correlation float

Correlation threshold used by temporal Signal Space Separation (tSSS) for each recording block. Only relevant when mw_st_duration is not None.

0.98
Notes

The input to :meth:run must be a list of :class:mne.io.BaseRaw objects. Each block is Maxwell filtered separately using the same coordinate frame, destination, calibration file, cross-talk file, and tSSS configuration.

When mw_destination is None, the common destination is computed from the median three-dimensional translation of the device-to-head transforms across all blocks. This provides a shared head position to which all blocks are aligned before concatenation.

After Maxwell filtering, the processed blocks are concatenated with :func:mne.concatenate_raws and returned as a single continuous raw object.

The processing metadata returned by :meth:run is stored under 'maxwell_info' and contains the effective coordinate frame, destination, calibration file, cross-talk file, and tSSS duration.

MultiBlockMaxwell can occur only once in a pipeline and is intended to run before ICA, forward modelling, spatial filtering, and source reconstruction.

See Also

run_maxwell Apply Maxwell filtering to an individual raw recording. mne.concatenate_raws Concatenate the filtered raw blocks.