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

infomne.Info

The measurement information from an electrophysiology recording of the subject with the anatomical landmarks stored in its mne.channels.DigMontage.

transmne.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. If None and no landmarks parameter is passed, no sidecar JSON file will be created.

fs_subjectstr

The subject identifier used for FreeSurfer. If None, defaults to the subject entity in bids_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 a mne.channels.DigMontage is aligned using FreeSurfer surfaces.

fs_subjects_dirstr | pathlib.Path | None

The FreeSurfer subjects directory. If None, defaults to the SUBJECTS_DIR environment variable. Must be provided to write anatomical landmarks if they are not provided in MRI voxel space.

Returns
landmarksmne.channels.DigMontage

A montage with the landmarks in MRI voxel space.