mne.viz.snapshot_brain_montage

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

Take a snapshot of a Mayavi 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:

fig : instance of Mayavi Scene

The figure on which you’ve plotted electrodes using plot_trans.

montage : instance of DigMontage or Info | dict of ch: xyz mappings.

The digital montage for the electrodes plotted in the scene. If Info, channel positions will be pulled from the loc field of chs.

hide_sensors : bool

Whether to remove the spheres in the scene before taking a snapshot.

Returns:

xy : array, shape (n_channels, 2)

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

im : array, shape (m, n, 3)

The screenshot of the current scene view

Examples using mne.viz.snapshot_brain_montage