mne_bids.update_anat_landmarks#

mne_bids.update_anat_landmarks(bids_path, landmarks, *, fs_subject=None, fs_subjects_dir=None, kind=None, on_missing='raise', verbose=None)[source]#

Update the anatomical landmark coordinates of an MRI scan.

This will change the AnatomicalLandmarkCoordinates entry in the respective JSON sidecar file, or create it if it doesn’t exist.

Parameters:
bids_pathBIDSPath

Path of the MR image.

landmarksmne.channels.DigMontage | path-like

An mne.channels.DigMontage instance with coordinates for the nasion and left and right pre-auricular points in MRI voxel coordinates. Alternatively, the path to a *-fiducials.fif file as produced by the MNE-Python coregistration GUI or via mne.io.write_fiducials().

Note

mne_bids.get_anat_landmarks() provides a convenient and reliable way to generate the landmark coordinates in the required coordinate system.

Note

If path-like, fs_subject and fs_subjects_dir must be provided as well.

Changed in version 0.10: Added support for path-like input.

fs_subjectstr | None

The subject identifier used for FreeSurfer. Must be provided if landmarks is path-like; otherwise, it will be ignored.

fs_subjects_dirpath-like | None

The FreeSurfer subjects directory. If None, defaults to the SUBJECTS_DIR environment variable. Must be provided if landmarks is path-like; otherwise, it will be ignored.

kindstr | None

The suffix of the anatomical landmark names in the JSON sidecar. A suffix might be present e.g. to distinguish landmarks between sessions. If provided, should not include a leading underscore _. For example, if the landmark names in the JSON sidecar file are LPA_ses-1, RPA_ses-1, NAS_ses-1, you should pass 'ses-1' here. If None, no suffix is appended, the landmarks named Nasion (or NAS), LPA, and RPA will be used.

New in version 0.10.

on_missing‘ignore’ | ‘warn’ | ‘raise’

How to behave if the specified landmarks cannot be found in the MRI JSON sidecar file.

New in version 0.10.

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.

Notes

New in version 0.8.