io#
- utils.io.get_coord_list(raw: mne_io.BaseRaw) tuple[list, list] | tuple[None, None] [source]#
Return the coordinate list and names from mne RawArray
- utils.io.get_paths_example_data()[source]#
This function should provide RUN_NAME, PATH_RUN, PATH_BIDS, PATH_OUT and datatype for the example dataset used in most examples.
- utils.io.load_channels(channels: pd.DataFrame | _PathLike) pd.DataFrame [source]#
Read channels from path or specify via BIDS arguments. Necessary parameters are then ch_names (list), ch_types (list), bads (list), used_types (list), target_keywords (list) and reference Union[list, str].
- utils.io.loadmat(filename) dict [source]#
this function should be called instead of direct spio.loadmat as it cures the problem of not properly recovering python dictionaries from mat files. It calls the function check keys to cure all entries which are still mat-objects
- utils.io.read_BIDS_data(PATH_RUN: _PathLike | BIDSPath, line_noise: int = 50) tuple[mne_io.Raw, ndarray, float, int, list | None, list | None] [source]#
Given a run path and bids data path, read the respective data
- Parameters:
PATH_RUN (path to bids run file) – supported formats: https://bids-specification.readthedocs.io/en/v1.2.1/04-modality-specific-files/04-intracranial-electroencephalography.html#ieeg-recording-data
line_noise (int, optional) – by default 50
- Returns:
raw_arr (mne.io.RawArray)
raw_arr_data (np.ndarray)
sfreq (float)
line_noise (int)
coord_list (list | None)
coord_names (list | None)
- utils.io.read_grid(PATH_GRIDS: str | PathLike | None, grid_str: str) pd.DataFrame [source]#
Read grid file from path or PYNM_DIR
- Parameters:
PATH_GRIDS (_PathLike | None) – path to grid file, by default None
grid_str (str) – grid name
- Returns:
pd.DataFrame including mni x,y,z coordinates for each grid point
- Return type:
pd.DataFrame
- utils.io.read_mne_data(PATH_RUN: _PathLike | BIDSPath, line_noise: int = 50)[source]#
Read data in the mne.io.read_raw supported format.
- Parameters:
PATH_RUN (_PathLike | BIDSPath) – Path to mne.io.read_raw supported types https://mne.tools/stable/generated/mne.io.read_raw.html
line_noise (int, optional) – line noise, by default 50
- Returns:
raw (mne.io.Raw)
sfreq (float)
ch_names (list[str])
ch_type (list[str])
bads (list[str])