mne_bids.get_anat_landmarks¶
- mne_bids.get_anat_landmarks(image, info, trans, fs_subject, fs_subjects_dir=None)[source]¶
Get anatomical landmarks in MRI voxel coordinates.
This function transforms the fiducial points from “head” to MRI “voxel” coordinate space. The landmarks obtained are defined w.r.t. the MRI passed via the
image
parameter.- Parameters
- image
str
|pathlib.Path
|NibabelImageObject
Path to an MRI scan (e.g. T1w) of the subject. Can be in any format readable by nibabel. Can also be a nibabel image object of an MRI scan. Will be written as a .nii.gz file.
- info
mne.Info
The measurement information from an electrophysiology recording of the subject with the anatomical landmarks stored in its
mne.channels.DigMontage
.- trans
mne.transforms.Transform
|str
The transformation matrix from head to MRI coordinates. Can also be a string pointing to a
.trans
file containing the transformation matrix. IfNone
and nolandmarks
parameter is passed, no sidecar JSON file will be created.- fs_subject
str
The subject identifier used for FreeSurfer. If
None
, defaults to thesubject
entity inbids_path
. Must be provided to write the anatomical landmarks if they are not provided in MRI voxel space. This is because the head coordinate of amne.channels.DigMontage
is aligned using FreeSurfer surfaces.- fs_subjects_dir
str
|pathlib.Path
|None
The FreeSurfer subjects directory. If
None
, defaults to theSUBJECTS_DIR
environment variable. Must be provided to write anatomical landmarks if they are not provided in MRI voxel space.
- image
- Returns
- landmarks
mne.channels.DigMontage
A montage with the landmarks in MRI voxel space.
- landmarks