cortex.align.manual

cortex.align.manual(subject, xfmname, output_name='register.lta', wm_color='yellow', pial_color='blue', wm_surface='white', noclean=False, reference=None, inspect_only=False)[source]

Open Freesurfer FreeView GUI for manually aligning/adjusting a functional volume to the cortical surface for subject. This creates a new transform called xfmname. The name of a nibabel-readable file (e.g. NIfTI) should be supplied as reference. This image will be copied into the database.

IMPORTANT: This function assumes that the resulting .lta file is saved as: “{default folder chosen by FreeView (should be /tmp/fsalign_xxx)}/{output_name}”.

NOTE: Half-fixed some potential bugs in here, related to assumptions about how results from mri_info calls would be formatted. IFF .dat files are written based on nii files that have been stripped of their headers, then there will be an extra line at the top stating that the coordinates are assumed to be in mm. Without this line, the code here fails. Seems brittle, ripe for future bugs.

ALSO: all the freesurfer environment stuff shouldn’t be necessary, except that I don’t know what vox2ras-tkr is doing.

Renamed from fs_manual() to manual(), since old manual() function was no longer supported (or functional) for a while due to changes in mayavi.

Parameters
subjectstr

Subject identifier.

xfmnamestr

The name of the transform to be modified.

output_namestr

The name of the .lta file generated after FreeView editing.

wm_colorstr | “blue”

Color of the white matter surface. Default is “blue”. This can also be adjusted in the FreeView GUI.

pial_colorstr | “red”

Color of the pial surface. Default is “red”. This can also be adjusted the FreeView GUI.

nocleanboolean | False

If True, intermediate files will not be removed from /tmp/fsalign_xxx (this is useful for debugging things), and the returned value will be the name of the temp directory. Default False.

referencestr

name of reference (generally, functional) volume. Only provide this if you are working from scratch (if no transform exists already), else it will throw an error.

inspect_onlyboolean | False

Whether to open transform to view only (if True, nothing is saved when freeview is closed)

wm_surfacestring

name for white matter surface to use. ‘white’ or ‘smoothwm’

Returns
Nothing unless noclean is true.