cortex.utils.get_aseg_mask(subject, aseg_name, xfmname=None, order=1, threshold=None, **kwargs)[source]

Return an epi space mask of the given ID from freesurfer’s automatic segmentation


pycortex subject ID

aseg_namestr or list

Name of brain partition or partitions to return. See freesurfer web site for partition names: … or inspect cortex.freesurfer.fs_aseg_mask.keys() Currently (2017.03) only the first 256 indices in the freesurfer lookup table are supported. If a name is provided that does not exactly match any of the freesurfer partitions, the function will search for all partitions that contain that name (caps are ignored). For example, ‘white-matter’ will generate a mask that combines masks for the following partitions: ‘Right-Cerebral-White-Matter’, ‘Left-Cerebellum-White-Matter’, ‘Right-Cerebellum-White-Matter’, and ‘Left-Cerebral-White-Matter’)


Name for transform of mask to functional space. If None, anatomical-space mask is returned.

orderint, [0-5]

Order of spline interpolation for transform from anatomical to functional space (ignored if xfmname is None). 0 is like nearest neighbor; 1 returns bilinear interpolation of mask from anatomical space. To convert either of these volumes to a binary mask for voxel selection, set the threshold argument. Setting order > 1 is not recommended, as it will give values outside the range of 0-1.


Threshold value for aseg mask. If None, function returns result of spline interpolation of mask as transformed to functional space (will have continuous float values from 0-1)


array with float or boolean values denoting the location of the requested cortical partition.


See also get_anat(subject, type=’aseg’)