cortex.freesurfer.flatten(fs_subject, hemi, patch, freesurfer_subject_dir=None, save_every=None)[source]

Perform flattening of a brain using freesurfer


Freesurfer subject ID

hemistr [‘lh’ | ‘rh’]

hemisphere to flatten


name for freesurfer patch (used as name argument to format output of get_paths())


Freesurfer subjects directory location. None defaults to $SUBJECTS_DIR

save_every: int

If not None, this saves a version of the mesh every save_every iterations of the flattening process. Useful for determining why a flattening fails.


To look into: link below shows how to give continuous output for a subprocess. There maybe indications that a flattening is going badly that we could detect in the stdout; perhaps even continuously update a visualization of the generated files using segment.show_surface() with the outputs (triggered to update once stdout shows that a flattening iteration has completed)