cortex.utils.get_ctmmap

cortex.utils.get_ctmmap(subject, **kwargs)[source]

Return a mapping from the vertices in the CTM surface to the vertices in the freesurfer surface. The mapping is a numpy array, such that ctm2fs_left[i] = j means that the i-th vertex in the CTM surface corresponds to the j-th vertex in the freesurfer surface.

Parameters:
subjectstr

Subject name

**kwargs

Additional keyword arguments are forwarded to get_ctmpack:

typestuple, optional

Surfaces between which to interpolate. Default (“inflated”,).

methodstr, optional

Method for computing inverse transforms for labels (determines how labels are displayed on the 3D viewer). One of ‘mg2’, ‘raw’. Default ‘raw’.

levelint, optional

Level-of-detail value used (together with decimate) to build a distinct cache filename for the generated ctm pack. Default 0.

recachebool, optional

Whether to re-generate .ctm files. Can resolve some errors but takes more time to re-generate cached files. Default False.

decimatebool, optional

Whether to decimate the mesh geometry of the hemispheres to reduce file size. Default False.

external_svgstr, optional

File path for an .svg file containing alternative overlays for the brain viewer. If None, the subject’s own overlays.svg file is used.

overlays_availabletuple, optional

Which overlays in the svg file to include in the viewer. If None, all layers in the relevant svg file are included.

Returns:
ctm2fs_leftarray (n_vertices_left,)

Mapping from CTM vertices to freesurfer vertices for the left hemisphere.

ctm2fs_rightarray (n_vertices_right,)

Mapping from CTM vertices to freesurfer vertices for the right hemisphere.

Notes

This mapping is absolutely necessary when the CTM surfaces are saved with the mg2 method, which corresponds to storing surfaces with a compressed format.