Montage for digitized electrode and headshape position data.
Warning
Montages are typically created using one of the helper
functions in the See Also
section below instead of
instantiating this class directly.
See also
Notes
New in version 0.9.0.
Methods
|
Add two DigMontages. |
|
Estimate fiducials based on FreeSurfer |
|
Add fiducials to a montage in MNI space. |
|
Apply a transformation matrix to the montage. |
|
Copy the DigMontage object. |
Get all channel and fiducial positions. |
|
|
Plot a montage. |
|
Remove the fiducial points from a montage. |
|
Rename the channels. |
|
Save digitization points to FIF. |
Estimate fiducials based on FreeSurfer fsaverage
subject.
This takes a montage with the mri
coordinate frame,
corresponding to the FreeSurfer RAS (xyz in the volume) T1w
image of the specific subject. It will call
mne.coreg.get_mni_fiducials()
to estimate LPA, RPA and
Nasion fiducial points.
str
The FreeSurfer subject name.
None
The path to the directory containing the FreeSurfer subjects
reconstructions. If None
, defaults to the SUBJECTS_DIR
environment
variable.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
DigMontage
The instance, modified in-place.
Notes
Since MNE uses the FIF data structure, it relies on the head
coordinate frame. Any coordinate frame can be transformed
to head
if the fiducials (i.e. LPA, RPA and Nasion) are
defined. One can use this function to estimate those fiducials
and then use mne.channels.compute_native_head_t(montage)
to get the head <-> MRI transform.
Examples using add_estimated_fiducials
:
Locating intracranial electrode contacts
Add fiducials to a montage in MNI space.
None
The path to the directory containing the FreeSurfer subjects
reconstructions. If None
, defaults to the SUBJECTS_DIR
environment
variable.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
DigMontage
The instance, modified in-place.
Notes
fsaverage
is in MNI space and so its fiducials can be
added to a montage in “mni_tal”. MNI is an ACPC-aligned
coordinate system (the posterior commissure is the origin)
so since BIDS requires channel locations for ECoG, sEEG and
DBS to be in ACPC space, this function can be used to allow
those coordinate to be transformed to “head” space (origin
between LPA and RPA).
Examples using add_mni_fiducials
:
Apply a transformation matrix to the montage.
mne.transforms.Transform
The transformation matrix to be applied.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
Examples using apply_trans
:
Locating intracranial electrode contacts
How to convert 3D electrode positions to a 2D image
Copy the DigMontage object.
DigMontage
The copied DigMontage instance.
Get all channel and fiducial positions.
dict
A dictionary of the positions for channels (ch_pos
),
coordinate frame (coord_frame
), nasion (nasion
),
left preauricular point (lpa
),
right preauricular point (rpa
),
Head Shape Polhemus (hsp
), and
Head Position Indicator(hpi
).
E.g.:
{
'ch_pos': {'EEG061': [0, 0, 0]},
'nasion': [0, 0, 1],
'coord_frame': 'mni_tal',
'lpa': [0, 1, 0],
'rpa': [1, 0, 0],
'hsp': None,
'hpi': None
}
Examples using get_positions
:
Plot a montage.
float
Determines the size of the points.
list
Whether to display all channel names. If a list, only the channel names in the list are shown. Defaults to True.
str
Whether to plot the montage as ‘3d’ or ‘topomap’ (default).
Show figure if True.
float
| array-like | instance of ConductorModel
| None
| ‘auto’ | ‘eeglab’The sphere parameters to use for the head outline. Can be array-like of
shape (4,) to give the X/Y/Z origin and radius in meters, or a single float
to give just the radius (origin assumed 0, 0, 0). Can also be an instance
of a spherical ConductorModel
to use the origin and
radius from that object. If 'auto'
the sphere is fit to digitization
points. If 'eeglab'
the head circle is defined by EEG electrodes
'Fpz'
, 'Oz'
, 'T7'
, and 'T8'
(if 'Fpz'
is not present,
it will be approximated from the coordinates of 'Oz'
). None
(the
default) is equivalent to 'auto'
when enough extra digitization points
are available, and (0, 0, 0, 0.095) otherwise. Currently the head radius
does not affect plotting.
New in version 0.20.
Changed in version 1.1: Added 'eeglab'
option.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
matplotlib.figure.Figure
The figure object.
Examples using plot
:
EEG source localization given electrode locations on an MRI
Remove the fiducial points from a montage.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
DigMontage
The instance, modified in-place.
Notes
MNE will transform a montage to the internal “head” coordinate
frame if the fiducials are present. Under most circumstances, this
is ideal as it standardizes the coordinate frame for things like
plotting. However, in some circumstances, such as saving a raw
with intracranial data to BIDS format, the coordinate frame
should not be changed by removing fiducials.
Rename the channels.
dict
| callable()
A dictionary mapping the old channel to a new channel name e.g. {‘EEG061’ : ‘EEG161’}. Can also be a callable function that takes and returns a string.
Changed in version 0.10.0: Support for a callable function.
If True (default False), allow duplicates, which will automatically
be renamed with -N
at the end.
New in version 0.22.0.
DigMontage
The instance. Operates in-place.
Examples using rename_channels
:
EEG forward operator with a template MRI
Save digitization points to FIF.
The filename to use. Should end in .fif or .fif.gz.
If True (default False), overwrite the destination file if it exists.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
Examples using save
:
mne.channels.DigMontage
#Importing data from fNIRS devices
Frequency-tagging: Basic analysis of an SSVEP/vSSR dataset
EEG forward operator with a template MRI
EEG source localization given electrode locations on an MRI
Locating intracranial electrode contacts
Identify EEG Electrodes Bridged by too much Gel
Removing muscle ICA components
How to convert 3D electrode positions to a 2D image
Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)
Receptive Field Estimation and Prediction