meg_wiki.eeg.load_mapping🔗

meg_wiki.eeg.load_mapping(fname)🔗

Load a mapping TXT file into an MNE-compatible dictionary.

The loaded mapping can be used to rename the channels from a recording with inst.rename_channels(mapping).

fname = "mapping.txt"
mapping = load_mapping(fname)
raw.rename_channels(mapping)
Parameters:
fnamestr | Path

Path to the TXT file containing the mapping to load. Each line yields one channels formatted as old: new.

Returns:
mappingdict

A dictionary mapping the old channel name to the new channel name.