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.workflow.sulcirec.brainprep_group_sulcirec

brainprep.workflow.sulcirec.brainprep_group_sulcirec(output_dir, keep_intermediate=False)[source]

Group level sulci reconstruction pre-processing.

Applies the following quality control procedure:

  1. Generate a TSV table containing the intersection between the brain and defacing masks.

  2. Apply threshold-based quality checks on the selected quality metrics.

  3. Generate a histogram showing the distribution of these quality metrics.

Parameters:
output_dirDirectory

Directory where the quality assurance related outputs will be saved (i.e., the root of your dataset).

keep_intermediatebool

If True, retains intermediate results (no effect on this workflow). Default False.

Returns:
Bunch

A dictionary-like object containing:

  • morphometry_files : list[File] - two TSV files containing ROI-based sulcal and brain volumes morphometries.

  • group_stats_file : File - a TSV file containing a binary qc column indicating the morphologist quality control result.

Notes

This workflow assumes the subject-level analyses have already been performed.

A qc column is added to the TSV QC output table. It contains a binary flag indicating whether the produced results should be kept: qc = 1 if the result passes the thresholds, otherwise qc = 0.

Examples

>>> from brainprep.config import Config
>>> from brainprep.workflow import brainprep_group_sulcirec
>>>
>>> with Config(dryrun=True, verbose=False):
...     outputs = brainprep_group_sulcirec(
...         output_dir="/tmp/dataset/derivatives",
...     )
>>> outputs
Bunch(
    morphometry_files: [PosixPath('...'), PosixPath('...')],
    group_stats_file: PosixPath('...')
)