Command line usage - T1w MRI

Command line usage - T1w MRI

Command line usage - T1w MRI

visualqc_t1_mri: rate quality of anatomical MR scan.

usage: visualqc_t1_mri [-h] [-b BIDS_DIR] [-i ID_LIST] [-u USER_DIR] [-m MRI_NAME] [-o OUT_DIR] [-f FS_DIR]
                       [-vt {Original,Saturate,Background_only,Tails_trimmed}] [-sp SATURATE_PERC] [-olm OUTLIER_METHOD]
                       [-olf OUTLIER_FRACTION] [-olt OUTLIER_FEAT_TYPES] [-old] [-w VIEWS [VIEWS ...]] [-s NUM_SLICES]
                       [-r NUM_ROWS] [-so]

Input and output

-b, --bids_dir

Absolute path to the top-level BIDS folder containing the dataset. Each subject will be named after the longest/unique ID encoding info on sessions and anything else available in the filename in the deepest hierarchy etc

E.g. --bids_dir /project/dataset_bids

-i, --id_list

Abs path to file containing list of subject IDs to be processed. If not provided, all the subjects with required files will be processed.

E.g.

sub001
sub002
cn_003
cn_004
-u, --user_dir

Absolute path to an input folder containing the MRI scan. Each subject will be queried after its ID in the metadata file, and is expected to have the MRI (specified --mri_name), in its own folder under –user_dir.

E.g. --user_dir /project/images_to_QC

-m, --mri_name

Specifies the name of MRI image to serve as the reference slice. Typical options include orig.mgz, brainmask.mgz, T1.mgz etc. Make sure to choose the right vis_type.

Default: orig.mgz (within the mri folder of Freesurfer format).

-o, --out_dir Output folder to store the visualizations & ratings. Default: a new folder called visualqc will be created inside the input folder
-f, --fs_dir

Absolute path to SUBJECTS_DIR containing Freesurfer runs. Each subject will be queried after its ID in the metadata file.

E.g. --fs_dir /project/freesurfer_v5.3

Visualization

-vt, --vis_type
 

Possible choices: Original, Saturate, Background_only, Tails_trimmed

Type of visualization/processed image to start review with. Allowed options: (‘Original’, ‘Saturate’, ‘Background_only’, ‘Tails_trimmed’)

Default: Original.

-sp, --saturate_perc
 

Sets all intensities in the image above this percentile to max intensity. This is helpful to reveal and detect any ghosting.

Specific formula used to compute threshold: threshold = numpy.percentile(image, saturate_perc) image[image > threshold] = max_value

Default: 33. It must be within [1, 99]

Outlier detection

options related to automatically detecting possible outliers

-olm, --outlier_method
 

Method used to detect the outliers.

For more info, read http://scikit-learn.org/stable/modules/outlier_detection.html

Default: isolation_forest.

-olf, --outlier_fraction
 

Fraction of outliers expected in the given sample. Must be >= 1/n and <= (n-1)/n, where n is the number of samples in the current sample.

For more info, read http://scikit-learn.org/stable/modules/outlier_detection.html

Default: 0.2.

-olt, --outlier_feat_types
 

Type of features to be employed in training the outlier detection method. It could be one of ‘cortical’ (aparc.stats: mean thickness and other geometrical features from each cortical label), ‘subcortical’ (aseg.stats: volumes of several subcortical structures), or ‘both’ (using both aseg and aparc stats).

Default: (‘histogram_whole_scan’,).

-old, --disable_outlier_detection
 This flag disables outlier detection and alerts altogether.

Layout options

-w, --views Specifies the set of views to display - could be just 1 view, or 2 or all 3. Example: –views 0 (typically sagittal) or –views 1 2 (axial and coronal) Default: 0 1 2 (show all the views in the selected segmentation)
-s, --num_slices
 Specifies the number of slices to display per each view. This must be even to facilitate better division. Default: 12.
-r, --num_rows Specifies the number of rows to display per each axis. Default: 2.

Workflow

Options related to workflow e.g. to pre-compute resource-intensive features, or generate screenshots only

-so, --screenshot_only
 This flag enables the batch generation of screenshots of the visualizations generated, for archival purposes. This would skip the interactive and deeper review of the visualizations, and directly saves the screenshots to the output folder. Hence, only some static options would work, and dynamic animations would not. This is NOT recommended as a QC procedure as the generated screenshots can become out of sync with the actual data for a number of reasons, and for reliable and accurate QC, we recommend interactive review which presents fresh visualizations based on latest version of data on disk.