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


Name of the subject to edit (pycortex subject ID)


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

namestr, optional

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


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


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


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


‘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 ( to your computer and set the slim dependency path in your pycortex config file to point to </path/to/your/slim/install>/ReweightedARAP


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