Skip to main content

ASL-QC

ASL-QC

Python versions PyPI package

ASL-QC is a Python library for automated quality assessment of arterial spin labeling (ASL) cerebral blood flow (CBF) maps using deep learning. It is developed by the Detre Lab at the University of Pennsylvania and distributed as open-source software.

Overview

ASL-QC provides automated quality assessment of ASL-derived CBF maps. Given a single CBF NIfTI image, ASL-QC returns a continuous quality score between 0 and 1:

  • 0 — lowest predicted quality
  • 1 — highest predicted quality

The model operates directly on the CBF map and does not require the underlying ASL images, a structural image, or any additional input.

Installation

ASL-QC requires Python 3.13 or later. We recommend installing it in a dedicated environment, for example with conda:

conda create -n asl-qc python=3.13
conda activate asl-qc

ASL-QC can then be installed either from PyPI or directly from the source repository.

Option 1: Install from PyPI

python -m pip install asl-qc

Option 2: Install from repository

git clone https://github.com/xavibeltranurbano/ASL-QC
cd ASL-QC
python -m pip install .

Getting Started

Python API

from asl_qc import predict_quality

quality = predict_quality("/path/to/cbf.nii.gz")
print(quality)

By default the model runs on the GPU if one is available and on the CPU otherwise. To choose the device explicitly, pass device="cpu" or device="cuda":

quality = predict_quality("/path/to/cbf.nii.gz", device="cpu")

The returned quality score ranges from 0 to 1, with higher values indicating higher predicted CBF map quality.

Command-Line Interface

ASL-QC can also be run directly from the command line:

asl-qc --path-cbf /path/to/cbf.nii.gz

Use --device cpu or --device cuda to select the device (default: auto).

Input Preprocessing

Before quality estimation, each CBF image is automatically:

  1. Converted to canonical RAS orientation
  2. Resampled to 2.5 mm isotropic resolution
  3. Cropped or padded around the nonzero CBF support to 96 × 96 × 64
  4. Clipped to [-100, 100]
  5. Scaled by 100

Training

The training scripts can be found in src/training_scripts/.

Model Development

ASL-QC was developed using a 3D residual convolutional neural network with four convolutional blocks and a fully connected regression head. Model development and evaluation used nested five-fold cross-validation, with folds stratified by scanner vendor and quality rating. The released model is an ensemble of the five models trained across the outer cross-validation folds. Each model was optimized using mean squared error (MSE) between the predicted quality score and the mean expert rating for the corresponding CBF map.

ASL-QC architecture

Training Dataset

The training dataset contains 450 CBF maps from multiple cohorts, sites, scanner vendors, ASL acquisition protocols, and background-suppression (BS) configurations.

Cohort Scanner Age
(mean ± SD)
Female
n (%)
PLD Labeling
time
Protocol BS Maps
ADNI Siemens 73.3 ± 7.4 17 (40%) 1.9 s 0.7 s 2D PASL No 43
ADNI GE 74.9 ± 7.5 12 (40%) 2.025 s 1.45 s 3D PCASL Yes 30
MESA Siemens 66.9 ± 8.6 25 (56%) 2 s 1.5 s 3D PCASL Yes 45
SPRINT Siemens 65.5 ± 8.2 13 (42%) 1.5 s 1.5 s 2D PCASL No 31
SPRINT GE 74.2 ± 7.7 7 (23%) 2.025 s 1.45 s 3D PCASL Yes 30
SPRINT Philips 67.3 ± 8.9 21 (42%) 1.5 s 1.5 s 2D PCASL No 50
DLBS Philips 54.9 ± 22.6 16 (64%) 1.525 s 1.65 s 2D PCASL No 25
CARDIA Siemens 50.5 ± 3.5 12 (63%) 1.5 s 1.5 s 2D PCASL No 19
NACC Siemens 69.1 ± 12.8 29 (53%) 1.8 s 1.8 s 3D PCASL Yes 55
VCID Siemens 54.4 ± 9.2 26 (58%) 2 s 3 s 3D PCASL Yes 45
VCID GE 61.2 ± 11.0 22 (55%) 2 s 3 s 3D PCASL Yes 40
Institutional data Siemens 45.5 ± 19.2 18 (49%) 1.2–2 s 1.8–3 s 3D PCASL Yes 37
Total Siemens 275; GE 100; Philips 75 63.9 ± 14.4 218 (48%) 1.2–2.025 s 0.7–3 s 3D PCASL 282; 2D PCASL 125; 2D PASL 43 Yes 282; No 168 450

Rating Strategy

Four expert raters independently evaluated each CBF map using a five-point quality scale. The ground-truth quality score was defined as the mean of the four expert ratings and normalized to the range [0, 1].

Rating Interpretation guidelines
0.00 No discernible brain anatomy; severe artifacts and/or poor resolution; completely uninterpretable.
0.25 Anatomy is barely recognizable; major artifacts and/or poor resolution; very limited interpretability.
0.50 Anatomy is recognizable; minor artifacts and/or smoothness; moderate spatial resolution; basic interpretability.
0.75 Good anatomical detail; limited artifacts and/or smoothness; good spatial resolution; good interpretability.
1.00 Excellent anatomical detail; no artifacts; high spatial resolution; good interpretability.

Rating strategy

Citation

If you use ASL-QC or its pretrained model in your work, please cite:

Beltran-Urbano X, Taso M, Nasrallah I, Detre JA, Wang Z, Dolui S.
QEI-Net: A deep learning-based automated quality evaluation index for ASL CBF maps.
Proceedings of the 2025 ISMRM & ISMRT Annual Meeting & Exhibition. 2025;0730.

License

Please see the LICENSE file for licensing information.

Metadata

Release files for asl-qc 0.1.0

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

Source distribution (sdist)

Source distribution for asl-qc 0.1.0
File Size Uploaded Provenance
asl_qc-0.1.0.tar.gz 66.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asl-qc 0.1.0
File Interpreter ABI Platform
asl_qc-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 133.4 MB

Release files / asl_qc-0.1.0.tar.gz

Download URL asl_qc-0.1.0.tar.gz
Size 66.7 MB
Tags Source
SHA-256 checksum
How to use checksums
9ec1d681406bda5f19a123e291c104d69d033446d2592f85b93dd52ca8204734
BLAKE2b-256 checksum
How to use checksums
4e2fecb09b8361b1ce60f42e519048075322547575ea4c1b7067453fbf78db5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Release files / asl_qc-0.1.0-py3-none-any.whl

Download URL asl_qc-0.1.0-py3-none-any.whl
Size 66.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d8392516aa97bcc4759a5293e399cd8fa76efd94be192ecae28db7151f9af7a0
BLAKE2b-256 checksum
How to use checksums
b97a8c340898fc5403c790f2632e691adcd00a25e2f48cb4ae6b5fc97ef62b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Security for asl-qc 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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