mne.viz.snapshot_brain_montage#

mne.viz.snapshot_brain_montage(fig, montage, hide_sensors=True)[source]#

Take a snapshot of a PyVista Scene and project channels onto 2d coords.

Note that this will take the raw values for 3d coordinates of each channel, without applying any transforms. If brain images are flipped up/dn upon using imshow, check your matplotlib backend as this behavior changes.

Parameters:
figinstance of Figure3D

The figure on which you’ve plotted electrodes using mne.viz.plot_alignment().

montageinstance of DigMontage or Info | dict

The digital montage for the electrodes plotted in the scene. If Info, channel positions will be pulled from the loc field of chs. dict should have ch:xyz mappings.

hide_sensorsbool

Whether to remove the spheres in the scene before taking a snapshot. The sensors will always be shown in the final figure. If you want an image of just the brain, use mne.viz.Brain instead.

Returns:
xyarray, shape (n_channels, 2)

The 2d location of each channel on the image of the current scene view.

imarray, shape (m, n, 3)

The screenshot of the current scene view.

Examples using mne.viz.snapshot_brain_montage#

Working with ECoG data

Working with ECoG data

How to convert 3D electrode positions to a 2D image

How to convert 3D electrode positions to a 2D image