mne.warp_montage_volume

mne.warp_montage_volume(montage, base_image, reg_affine, sdr_morph, subject_from, subject_to='fsaverage', subjects_dir_from=None, subjects_dir_to=None, thresh=0.5, max_peak_dist=1, voxels_max=100, use_min=False, verbose=None)[source]

Warp a montage to a template with image volumes using SDR.

Find areas of the input volume with intensity greater than a threshold surrounding local extrema near the channel location. Monotonicity from the peak is enforced to prevent channels bleeding into each other.

Note

This is likely only applicable for channels inside the brain (intracranial electrodes).

Parameters
montageinstance of mne.channels.DigMontage

The montage object containing the channels.

base_imagestr | pathlib.Path | nibabel.spatialimages.SpatialImage

Path to a volumetric scan (e.g. CT) of the subject. Can be in any format readable by nibabel. Can also be a nibabel image object. Local extrema (max or min) should be nearby montage channel locations.

reg_affinendarray of float, shape (4, 4)

The affine that registers one volume to another.

sdr_morphinstance of dipy.align.DiffeomorphicMap

The class that applies the the symmetric diffeomorphic registration (SDR) morph.

subject_fromstr

The name of the subject used for the Freesurfer reconstruction.

subject_tostr

The name of the subject to use as a template to morph to (e.g. ‘fsaverage’).

subjects_dir_fromstr | pathlib.Path | None

The path to the Freesurfer recon-all directory for the subject_from subject. The SUBJECTS_DIR environment variable will be used when None.

subjects_dir_tostr | pathlib.Path | None

The path to the Freesurfer recon-all directory for the subject_to subject. subject_dir_from will be used when None.

threshfloat

The threshold relative to the peak to determine the size of the sensors on the volume.

max_peak_distint

The number of voxels away from the channel location to look in the image. This will depend on the accuracy of the channel locations, the default (one voxel in all directions) will work only with localizations that are that accurate.

voxels_maxint

The maximum number of voxels for each channel.

use_minbool

Whether to hypointensities in the volume as channel locations. Default False uses hyperintensities.

verbosebool | 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.

Returns
montage_warpedmne.channels.DigMontage

The modified montage object containing the channels.

image_fromnibabel.spatialimages.SpatialImage

An image in Freesurfer surface RAS space with voxel values corresponding to the index of the channel. The background is 0s and this index starts at 1.

image_tonibabel.spatialimages.SpatialImage

The warped image with voxel values corresponding to the index of the channel. The background is 0s and this index starts at 1.

Examples using mne.warp_montage_volume