Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.
brainprep.interfaces.qualcheck.mask_overlap¶
- brainprep.interfaces.qualcheck.mask_overlap(maskdiff_files_regex, output_dir, overlap_threshold=0.05, dryrun=False)[source]¶
Compute overlap ratios between mask pairs from maskdiff summary files.
This function loads TSV files produced by the
maskdifftool, extracts voxel counts for mask 2 and masks intersection, and computes the overlap ratio defined as:overlap = intersection_size / mask2_size
- Parameters:
- maskdiff_files_regexstr
A regular expression matching TSV files generated by
maskdiff. These files must contain voxel counts and physical volumes (mm³) for each mask and their intersection.- output_dirDirectory
Directory where a TSV file containing the mean correlation values is created.
- overlap_thresholdfloat
Quality control threshold applied on the overalp score. Default 0.05.
- dryrunbool
If True, skip actual computation and file writing. Default False.
- Returns:
- overlap_fileFile
A TSV file containing the overlap ratio between the intersection and the second mask for each subject/session/run. The table includes the columns
participant_id,session,run, andmask_size,intersection_size,overlap, as well as a binaryqccolumn indicating the quality control result.
Notes
A
qccolumn is added to the output table. It contains a binary flag indicating whether the overlap score do not exceeds the threshold:qc = 1ifoverlap < overlap_threshold, otherwiseqc = 0.