pyavs.preprocess_meg_block

pyavs.preprocess_meg_block(raw: mne.io.Raw, subject_id: int, session: int, block: int, apply_maxwell: bool = True, apply_filtering: bool = False, apply_resampling: bool = True, interpolate_bads: bool = True, l_freq: float = 0.2, h_freq: float = 200.0, resample_freq: float = 500.0, causal_filter: bool = False, bad_channels_file: str | None = None, crosstalk_file: str | None = None, fine_cal_file: str | None = None, verbose: bool = True) mne.io.Raw[source]

Complete preprocessing pipeline for a single MEG block.

Parameters:
  • raw (mne.io.Raw) – Raw MEG data

  • subject_id (int) – Subject ID

  • session (int) – Session number

  • block (int) – Block number

  • apply_maxwell (bool, optional) – Whether to apply Maxwell filtering (default: True)

  • apply_filtering (bool, optional) – Whether to apply bandpass filtering (default: False)

  • apply_resampling (bool, optional) – Whether to resample data (default: True)

  • interpolate_bads (bool, optional) – Whether to interpolate bad channels (default: True)

  • l_freq (float, optional) – Low-pass frequency in Hz (default: 0.2)

  • h_freq (float, optional) – High-pass frequency in Hz (default: 100.0)

  • resample_freq (float, optional) – Resampling frequency in Hz (default: 500.0)

  • causal_filter (bool, optional) – Whether to apply causal filtering (default: False) If True, uses minimum-phase filtering which preserves temporal order

  • bad_channels_file (str, optional) – Path to bad channels file

  • crosstalk_file (str, optional) – Path to crosstalk file

  • fine_cal_file (str, optional) – Path to fine calibration file

  • verbose (bool, optional) – Whether to print progress information (default: True)

Returns:

Preprocessed raw data

Return type:

mne.io.Raw

Notes

By default, this function applies Maxwell filtering, bad channel interpolation, and resampling, but NOT bandpass filtering. Filtering should be applied later using the AVS composer filter_meg_data() method to allow for flexible analysis-specific filter parameters.