mne.channels.read_custom_montage#

mne.channels.read_custom_montage(fname, head_size=0.095, coord_frame=None)[source]#

Read a montage from a file.

Parameters:
fnamepath-like

File extension is expected to be: '.loc' or '.locs' or '.eloc' (for EEGLAB files), '.sfp' (BESA/EGI files), '.csd', '.elc', '.txt', '.csd', '.elp' (BESA spherical), '.bvef' (BrainVision files), '.csv', '.tsv', '.xyz' (XYZ coordinates).

head_sizefloat | None

The size of the head (radius, in [m]). If None, returns the values read from the montage file with no modification. Defaults to 0.095m.

coord_framestr | None

The coordinate frame of the points. Usually this is "unknown" for native digitizer space. Defaults to None, which is "unknown" for most readers but "head" for EEGLAB.

New in version 0.20.

Returns:
montageinstance of DigMontage

The montage.

Notes

The function is a helper to read electrode positions you may have in various formats. Most of these format are weakly specified in terms of units, coordinate systems. It implies that setting a montage using a DigMontage produced by this function may be problematic. If you use a standard/template (eg. 10/20, 10/10 or 10/05) we recommend you use make_standard_montage(). If you can have positions in memory you can also use make_dig_montage() that takes arrays as input.

Examples using mne.channels.read_custom_montage#

EEG source localization given electrode locations on an MRI

EEG source localization given electrode locations on an MRI