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_image
str
|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_affine
ndarray
offloat
, 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_from
str
The name of the subject used for the Freesurfer reconstruction.
- subject_to
str
The name of the subject to use as a template to morph to (e.g. ‘fsaverage’).
- subjects_dir_from
str
|pathlib.Path
|None
The path to the Freesurfer
recon-all
directory for thesubject_from
subject. TheSUBJECTS_DIR
environment variable will be used whenNone
.- subjects_dir_to
str
|pathlib.Path
|None
The path to the Freesurfer
recon-all
directory for thesubject_to
subject.subject_dir_from
will be used whenNone
.- thresh
float
The threshold relative to the peak to determine the size of the sensors on the volume.
- max_peak_dist
int
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_max
int
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 andmne.verbose()
for details. Should only be passed as a keyword argument.
- montageinstance of
- Returns
- montage_warped
mne.channels.DigMontage
The modified montage object containing the channels.
- image_from
nibabel.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_to
nibabel.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.
- montage_warped