FastSurferCNN.quick_qc

FastSurferCNN.quick_qc.check_volume(asegdkt_segfile, voxvol, thres=0.7)[source]

Check if total volume is bigger or smaller than threshold.

Parameters:
asegdkt_segfilenp.ndarray

The segmentation file.

voxvolfloat

The volume of a voxel.

thresfloat, default=0.7

The threshold for the total volume (Default value = 0.70).

Returns:
bool

Whether or not total volume is bigger or smaller than threshold.

FastSurferCNN.quick_qc.get_region_bg_intersection_mask(seg_array, region_labels={'Left-Lateral-Ventricle': 4, 'Left-choroid-plexus': 31, 'Right-Lateral-Ventricle': 43, 'Right-choroid-plexus': 63}, bg_label=0)[source]

Return a mask of the intersection between the voxels of a given region and background voxels.

This is obtained by dilating the region by 1 voxel and computing the intersection with the background mask.

The region can be defined by passing in the region_labels dict.

Parameters:
seg_arraynumpy.ndarray

Segmentation array.

region_labelsdict, default=<dict VENT_LABELS>

Dictionary whose values correspond to the desired region’s labels (see Note).

bg_labelint, default as in <BG_LABEL>

Label id of the background.

Returns:
bg_intersectnumpy.ndarray

Region and background intersection mask array.

Notes

VENT_LABELS is a dictionary containing labels for four regions related to the ventricles: “Left-Lateral-Ventricle”, “Right-Lateral-Ventricle”, “Left-choroid-plexus”, “Right-choroid-plexus” along with their corresponding integer label values (see also FreeSurferColorLUT.txt).

FastSurferCNN.quick_qc.get_ventricle_bg_intersection_volume(seg_array, voxvol)[source]

Return a volume estimate for the intersection of ventricle voxels with background voxels.

Parameters:
seg_arraynumpy.ndarray

Segmentation array.

voxvolfloat

Voxel volume.

Returns:
intersection_volumefloat

Estimated volume of voxels in ventricle and background intersection.

FastSurferCNN.quick_qc.options_parse()[source]

Command line option parser.

Returns:
options

Object holding options.