cortex.freesurfer.get_surf¶
- cortex.freesurfer.get_surf(subject, hemi, type, patch=None, flatten_step=None, freesurfer_subject_dir=None)[source]¶
Read freesurfer surface file
- Parameters:
- subjectstr
Freesurfer subject identifier.
- hemistr
‘lh’ or ‘rh’ for left or right hemisphere, respectively.
- typestr
Which surface to load, e.g. ‘smoothwm’, ‘pial’, ‘inflated’, or ‘fiducial’. Use ‘patch’ to load a flattened patch instead (in which case patch must also be given; the surface underlying the patch is always ‘smoothwm’).
- patchstr, optional
Name of the patch file to load (e.g. ‘flatten’), used only when type is “patch”.
- flatten_stepint, optional
If given, selects one of the intermediate patch snapshots saved during flattening (see the save_every argument to flatten), appended as a zero-padded 4-digit suffix to the patch filename.
- freesurfer_subject_dirstr, optional
Directory for Freesurfer subjects (defaults to the value of the environment variable $SUBJECTS_DIR if None).
- Returns:
- ptsndarray
Vertex coordinates for this surface (or patch, if patch is given).
- polysndarray
Triangle faces for this surface (or patch).
- idxndarray
If type is “patch”, a per-vertex flag array (1 for interior vertices, -1 for boundary/edge vertices, 0 for vertices not in the patch). Otherwise, the curvature values for this surface/hemisphere, as returned by get_curv.