lw_pipeline.helper.mne.raw_from_source#

lw_pipeline.helper.mne.raw_from_source(source, n_jobs=1, suppress_runtime_warning=True, **kwargs)[source]#

Produce an mne raw object from different sources.

Possible sources: (lists will be concatenated)

  • BIDSPath

  • list of BIDSPath

  • mne.io.BaseRaw

  • list of mne.io.BaseRaw

Parameters:
  • source (BIDSPath | list of BIDSPath | mne.io.BaseRaw | list of mne.io.BaseRaw) – The source to read the raw data from.

  • suppress_runtime_warning (bool) – If True, suppresses RuntimeWarning when reading raw data. This is useful when reading raw data from BIDSPath, as it may raise a RuntimeWarning if coordsystem/electrode data, etc. is not found.

  • kwargs (dict) – Additional keyword arguments to pass to mne.io.read_raw.

Returns:

raw – The raw data object.

Return type:

mne.io.BaseRaw

Raises:

ValueError – If the source is not a BIDSPath, list of BIDSPath, mne.io.BaseRaw, or list of mne.io.BaseRaw.