Skip to main content

CivetQC

python-version pypi-version license tests

About

CivetQC is a fully automated pipeline for quality control of CIVET outputs. Using the random forest algorithm implemented in scikit-learn, CivetQC categorises outputs as acceptable or unacceptable based on a variety of quality metrics, including number of surface-surface intersections, self-intersections, and brain mask error, among others. The model was developed using 1216 T1-weighted scans from several studies affiliated with McGill University in Montreal, Canada. A separate sample of 120 individuals from the UK Biobank served to evaluate final model performance.

We rated the output quality for each subject on a scale from 0 to 2 (0 = fail, 1 = questionable, 2 = pass) based on visual inspection of CIVET outputs. Ratings of 1 or 2 were considered acceptable, whereas ratings of less than one were considered unacceptable. The model was trained using stratified fivefold cross validation, and the optimal set of parameters were chosen based on the mean ROC-AUC score from fifty iterations of a randomised search of the hyperparameter space. Finally, we selected the optimum discrimination threshold in terms of maximising the F2 score.

The training data contained 1163 acceptable scans (95.6%) and 53 unacceptable scans (4.4%). During cross-validation, the mean AUC score for the best model was 0.91. As depicted below, the optimal F2 score was achieved with a discrimination threshold of 0.2, which yielded 1.00 precision and 0.98 recall for acceptable scans, and 0.71 precision and 0.98 recall for unacceptable scans.

Discrimination Thresholds

The testing data, on the other hand, included 98 scans of acceptable quality and 22 scans of unacceptable quality. The mean AUC score was 0.98, with 1.0 precision and 0.97 recall for acceptable scans, and 0.88 precision and 1.0 recall for unacceptable scans.

Install

CivetQC is available via the Python Package Index (PyPI):

pip install civetqc

Usage

In most cases, the preferred method of using CivetQC is through the command line interface. Users must provide an input path, which may be either a file or a directory. If available, it is recommend to provide the file outputted by CIVET with aggregated tabular QC metrics. However, if this file is not available, users may instead provide a path to a directory containing files of the format prefix_id_civet_qc.txt, in which case CivetQC will attempt to extract the relevant metrics for each subject.

positional arguments:
input_path        path to file or directory with CIVET QC outputs

optional arguments:
-h, --help        show this help message and exit
-v, --version     show program's version number and exit
--threshold       probability above which a failure will be predicted (default: 0.2)
--output_dir      directory for results (default: $PWD)
--output_format   format for output file: csv, json (default: csv)

Metadata

Release files for civetqc 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for civetqc 0.1.6
File Size Uploaded Provenance Actions
civetqc-0.1.6.tar.gz 508.4 kB Without provenance Details for civetqc-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for civetqc 0.1.6
File Interpreter ABI Platform Actions
civetqc-0.1.6-py3-none-any.whl Python 3 none any Details for civetqc-0.1.6-py3-none-any.whl

Total release size: 1.0 MB

Release files / civetqc-0.1.6.tar.gz

Download URL civetqc-0.1.6.tar.gz
Size 508.4 kB
Tags Source
SHA-256 checksum
How to use checksums
04a77deb879a5b1b09a335c2d6ee51b17af6eca6fe012222733fa6e2d13e00ba
BLAKE2b-256 checksum
How to use checksums
93dbacedfde89c5e37aa62711de5318b4ac68bfd93a39d643b1740175ba3d420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / civetqc-0.1.6-py3-none-any.whl

Download URL civetqc-0.1.6-py3-none-any.whl
Size 535.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d9e2c17cfb72668f0a5a93ed490f70a6df7dc0d2b30616a7f1833455a6cf271
BLAKE2b-256 checksum
How to use checksums
1a6468636e3a1b250a9a5f12c41b7715414f874f58e8950b6703020ce281f62a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for civetqc 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page