cortex.segment.cut_surface

cortex.segment.cut_surface(cx_subject, hemi, name='flatten', fs_subject=None, data=None, freesurfer_subject_dir=None, flatten_with='freesurfer', do_import_subject=True, \*\*kwargs)[source]

Initializes an interface to cut the segmented surface for flatmapping. This function creates or opens a blend file in your filestore which allows surfaces to be cut along hand-defined seams. Blender will automatically open the file. After edits are made, remember to save the file, then exit Blender.

The surface will be automatically extracted from blender then run through the mris_flatten command in freesurfer. The flatmap will be imported once that command finishes if do_import_subject is True (default value).

Parameters
cx_subjectstr

Name of the subject to edit (pycortex subject ID)

hemistr

Which hemisphere to flatten. Should be “lh” or “rh”

namestr, optional

String name of the current flatten attempt. Defaults to “flatten”

dataDataview

A data view object to display on the surface as a cutting guide.

fs_subjectstr

Name of Freesurfer subject (if different from pycortex subject) None defaults to cx_subject

freesurfer_subject_dirstr

Name of Freesurfer subject directory. None defaults to SUBJECTS_DIR environment varible

flatten_withstr

‘freesurfer’ or ‘SLIM’ - ‘freesurfer’ (default) uses freesurfer’s mris_flatten function to flatten the cut surface. ‘SLIM’ uses the SLIM algorithm, which takes much less time but tends to leave more distortions in the flatmap. SLIM is an optional dependency, and must be installed to work; clone the code (https://github.com/MichaelRabinovich/Scalable-Locally-Injective-Mappings) to your computer and set the slim dependency path in your pycortex config file to point to </path/to/your/slim/install>/ReweightedARAP

do_import_subjectbool

set option to automatically import flatmaps when both are completed (if set to false, you must import later with cortex.freesurfer.import_flat())