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.brainprep_group_quasiraw¶
- brainprep.workflow.brainprep_group_quasiraw(output_dir, correlation_threshold=0.5, keep_intermediate=False)[source]¶
Group level Quasi-RAW pre-processing.
Applies the quality control described in [1]. This includes:
Generate a TSV file containing the mean correlation of each image to the template.
Apply threshold-based quality checks on the selected quality metrics.
Generate a histogram showing the distribution of these quality metrics.
Computing a PCA embedding of the images.
Generating a scatter plot of the first two PCA components with BIDS annotations for visual inspection.
- Parameters:
- output_dirDirectory
Working directory containing all the subjects.
- correlation_thresholdfloat
Quality control threshold on the correlation score. Default 0.5.
- keep_intermediatebool
If True, retains intermediate results (i.e., the workspace); useful for debugging. Default False.
- Returns:
- Bunch
A dictionary-like object containing:
correlations_file : File - a TSV file containing mean correlation of each input image to the atlas image quality check (QC) data.
correlation_histogram_file : File - PNG file containing the histogram of the computed mean correlations.
pca_file : File - a TSV file containing PCA two first components as two columns named
pc1andpc2, as well as BIDSparticipant_id,session, andrun.pca_image_file : File - PNG file containing the two first PCA components with
participant_id,session, andrunannotations.
Notes
This workflow assumes the subject-level analyses have already been performed.
A
qccolumn is added to the TSV QC output table. It contains a binary flag indicating whether the produced results should be kept:qc = 1if the result passes the thresholds, otherwiseqc = 0.The associated PNG histograms help verify that the chosen thresholds are neither too restrictive nor too permissive.
Examples
>>> from brainprep.config import Config >>> from brainprep.reporting import RSTReport >>> from brainprep.workflow import brainprep_group_quasiraw >>> >>> with Config(dryrun=True, verbose=False): ... report = RSTReport() ... outputs = brainprep_group_quasiraw( ... output_dir="/tmp/dataset/derivatives", ... ) >>> outputs Bunch( correlations_file: PosixPath('...') correlation_histogram_file: PosixPath('...') pca_file: PosixPath('...') pca_image_file: PosixPath('...') )