MCPcopy
hub / github.com/mne-tools/mne-python / get_mni_fiducials

Function get_mni_fiducials

mne/_freesurfer.py:432–477  ·  view source on GitHub ↗

Estimate fiducials for a subject. Parameters ---------- %(subject)s %(subjects_dir)s %(verbose)s Returns ------- fids_mri : list List of estimated fiducials (each point in a dict), in the order LPA, nasion, RPA. Notes ----- This takes th

(subject, subjects_dir=None, verbose=None)

Source from the content-addressed store, hash-verified

430
431@verbose
432def get_mni_fiducials(subject, subjects_dir=None, verbose=None):
433 """Estimate fiducials for a subject.
434
435 Parameters
436 ----------
437 %(subject)s
438 %(subjects_dir)s
439 %(verbose)s
440
441 Returns
442 -------
443 fids_mri : list
444 List of estimated fiducials (each point in a dict), in the order
445 LPA, nasion, RPA.
446
447 Notes
448 -----
449 This takes the ``fsaverage-fiducials.fif`` file included with MNE—which
450 contain the LPA, nasion, and RPA for the ``fsaverage`` subject—and
451 transforms them to the given FreeSurfer subject's MRI space.
452 The MRI of ``fsaverage`` is already in MNI Talairach space, so applying
453 the inverse of the given subject's MNI Talairach affine transformation
454 (``$SUBJECTS_DIR/$SUBJECT/mri/transforms/talairach.xfm``) is used
455 to estimate the subject's fiducial locations.
456
457 For more details about the coordinate systems and transformations involved,
458 see https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems and
459 :ref:`tut-source-alignment`.
460 """
461 # Eventually we might want to allow using the MNI Talairach with-skull
462 # transformation rather than the standard brain-based MNI Talaranch
463 # transformation, and/or project the points onto the head surface
464 # (if available).
465 fname_fids_fs = (
466 Path(__file__).parent / "data" / "fsaverage" / "fsaverage-fiducials.fif"
467 )
468
469 # Read fsaverage fiducials file and subject Talairach.
470 fids, coord_frame = read_fiducials(fname_fids_fs)
471 assert coord_frame == FIFF.FIFFV_COORD_MRI
472 if subject == "fsaverage":
473 return fids # special short-circuit for fsaverage
474 mni_mri_t = invert_transform(read_talxfm(subject, subjects_dir))
475 for f in fids:
476 f["r"] = apply_trans(mni_mri_t, f["r"])
477 return fids
478
479
480@verbose

Callers 13

_setup_fiducialsMethod · 0.85
estimate_head_mri_tFunction · 0.85
test_warp_montageFunction · 0.85
test_make_montage_volumeFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85
add_mni_fiducialsMethod · 0.85
_mgh_or_standardFunction · 0.85
test_montage_head_frameFunction · 0.85
test_get_mni_fiducialsFunction · 0.85

Calls 4

read_fiducialsFunction · 0.85
invert_transformFunction · 0.85
read_talxfmFunction · 0.85
apply_transFunction · 0.85

Tested by 5

test_warp_montageFunction · 0.68
test_make_montage_volumeFunction · 0.68
test_montage_head_frameFunction · 0.68
test_get_mni_fiducialsFunction · 0.68