fsqc.fsqcMain

This module provides the main functionality of the fsqc package.

fsqc.fsqcMain.get_help(print_help=True, return_help=False)[source]

A function to return a help message.

Parameters:
print_helpbool, optional, default: True

Whether to print the help message.

return_helpbool, optional, default: False

Whether to return the help message as a string.

Returns:
None or str

If print_help is True, the help message is printed. If return_help is True, the help message is returned as a string.

fsqc.fsqcMain.get_version()[source]

A function to get the version of the ‘fsqc’ package.

Returns:
str

The version of the ‘fsqc’ package if installed; otherwise, “unknown”.

Notes

This function uses the ‘importlib.metadata’ module to retrieve the package version. If the package is not installed, it returns “unknown”.

fsqc.fsqcMain.run_fsqc(subjects_dir, output_dir, argsDict=None, subjects=None, subjects_file=None, shape=False, screenshots=False, screenshots_html=False, screenshots_base='default', screenshots_overlay='default', screenshots_surf='default', screenshots_views='default', screenshots_layout='default', screenshots_orientation='radiological', surfaces=False, surfaces_html=False, surfaces_views=None, skullstrip=False, skullstrip_html=False, fornix=False, fornix_html=False, hypothalamus=False, hypothalamus_html=False, hippocampus=False, hippocampus_html=False, hippocampus_label=None, outlier=False, outlier_table=None, fastsurfer=False, no_group=False, group_only=False, exit_on_error=False, skip_existing=False, logfile=None)[source]

Run the fsqc submodules.

This is the main function to run the fsqc submodules.

Parameters:
subjects_dirstr

Subjects directory.

output_dirstr

Output directory.

argsDictdict, default: None

Dictionary of input arguments.

subjectslist of str, default: None

List of subjects to process. If None, all valid cases in the input directory will be processed. Cannot be used with subjects_file.

subjects_filestr, default: None

A text file that contains a list of subjects to be processed. Cannot be used with subjects.

shapebool, default: False

Conduct shape analysis using brainprint.

screenshotsbool, default: False

Create screenshots of MR image with optional overlays.

screenshots_htmlbool, default: False

Create screenshots and html summary page.

screenshots_basestr, default: “default”

Filename for base image for screenshots.

screenshots_overlaystr, default: “default”

Filename for overlay image for screenshots.

screenshots_surf(list of) str, default: “default”

List of filenames of surface files to include in screenshots.

screenshots_views(list of) str, default: “default”

List of parameters to set the views of the screenshots. Example: [‘x=0’, ‘x=-10’, ‘x=10’, ‘y=20’, ‘z=0’].

screenshots_layoutstr or list of int, default: “default”

Layout describing rows and columns of the screenshots. Example: [1, 4] (one row, four columns).

screenshots_orientationstr, default: “radiological”

Orientation of screenshots. Either “radiological” or “neurological”.

surfacesbool, default: False

Create screenshots of pial and inflated surfaces.

surfaces_htmlbool, default: False

Create screenshots of pial and inflated surfaces and html summary page.

surfaces_viewslist of str, default: [“left”, “right”, “superior”, “inferior”]

List of parameters to set the views of the surface plots.

skullstripbool, default: False

Create screeenshot of MR image and skullstrip overlay.

skullstrip_htmlbool, default: False

Create screeenshot of MR image and skullstrip overlay, and create html summary page.

fornixbool, default: False

Create screenshot of MR imge and corpus callosum overlay to identify fornix oversegmentation.

fornix_htmlbool, default: False

Create screenshot of MR imge and corpus callosum overlay with html summary page.

hypothalamusbool, default: False

Create screenhots of hypothalamic segmentation. Requires running FreeSurfer’s hypothalamus add-on module.

hypothalamus_htmlbool, default: False

Create screenhots of hypothalamic segmentation with html summary page. Requires running FreeSurfer’s hypothalamus add-on module.

hippocampusbool, default: False

Create screenhots of hippocampal segmentation. Requires running FreeSurfer’s hippocampus add-on module.

hippocampus_htmlbool, default: False

Create screenhots of hippocampal segmentation with html summary page. Requires running FreeSurfer’s hippocampus add-on module.

hippocampus_labelstr, default: None

Label used for the hippocampal segmentations. Example: “T1.v21”. The full filename would be [lr]h.hippoAmygLabels-<LABEL>.FSvoxelSpace.mgz.

outlierbool, default: False

Conduct outlier analysis.

outlier_tablestr, default: None

Specify custom norms table for outlier analysis.

fastsurferbool, default: False

Use FastSurfer instead of FreeSurfer input.

no_groupbool, default: False

Run script in subject-level mode. will compute individual files and statistics, but not create group-level summaries.

group_onlybool, default: False

Run script in group mode. will create group-level summaries from existing inputs.

exit_on_errorbool, default: False

Exit on error. If False, a warning is thrown and the analysis continues.

skip_existingbool, default: False

Skip processing for a given case if output already exists, even with possibly different parameters or settings.

logfilestr, default: None

Specify a custom location for the logfile. Default location is the output directory.

Returns:
dict

A dictionary of input arguments and processing directives.