brain_pipe.preprocessing.brain.load.MNELoader

class MNELoader(keys={'data_path': 'raw'}, copy_data_dict=False, *mne_args, **mne_kwargs)

Bases: PipelineStep

Load brain imaging data using MNE.

__init__(keys={'data_path': 'raw'}, copy_data_dict=False, *mne_args, **mne_kwargs)

Load a file using MNE.

Parameters:
  • keys (Union[str, Dict[str, str]]) – The key of the path in the data dict. If a dict is passed, the keys are the keys in the data dict and the values are the keys in the output dict.

  • mne_args (Sequence[Any]) – Extra arguments to pass to MNE’s read_raw.

  • mne_kwargs (Dict[str, Any]) – Extra keyword arguments to pass to MNE’s read_raw.

Methods

__init__([keys, copy_data_dict])

Load a file using MNE.

parse_dict_keys(key[, name, ...])

Parse a key or a sequence of keys.

parse_dict_keys(key: str | Sequence[str] | Mapping[str, str], name='key', require_ordered_dict=False) OrderedDict[str, str]

Parse a key or a sequence of keys.

Parameters:
  • key (Union[str, Sequence[str], Mapping[str,str]]) – A key or a sequence of keys.

  • name (str) – The name of the key. Used for error messages.

  • require_ordered_dict (bool) – If True, the key must be an OrderedDict. If False, the key can also be an ordinary dict.

Returns:

A mapping of input keys to output keys.

Return type:

OrderedDict[str, str]

Raises:

TypeError – If the key is not a string, a sequence of strings or a mapping of strings. If the key is a mapping but require_ordered_dict is True and the mapping is not an OrderedDict.