← Projects

Project · Medical Imaging

PyCa — Python Calcium Score Analyzer

A historical, methodological and practical journey · v1.0 · 2026

From Agatston's origins to PyCa: a calcium-score journey told by those who use it

A historical, methodological and practical journey: from the first 1990 paper on EBCT to the integration of artificial intelligence in PyCa, the open-research tool developed within the AITeRTC Scientific Committee.


1. The origins: Agatston's idea

In 1990 Arthur S. Agatston and colleagues, working on a GE Imatron Electron Beam CT (EBCT) platform, published in the Journal of the American College of Cardiology a method to quantify coronary calcium directly from non-contrast scans. The idea was simple: calcium is hyperdense, you can see it without contrast media, and its extent correlates with atherosclerotic burden.

EBCT had acquisition times below 100 ms per slice with intrinsic cardiac gating: it was the only modality able to "freeze" the coronary artery in the 1990s. In the 2000s ECG-gated multidetector CT replaced EBCT, but the calculation method has remained essentially unchanged.

[Image 1 — placeholder]
EBCT GE Imatron scanner / first Agatston publication 1990 (suggestion: historical JACC cover figure)
The first coronary calcium scans were obtained on EBCT, a now-superseded technology that remains methodologically seminal.

2. The Agatston methodology in practice

The Agatston calculation rests on four elements:

  1. Hounsfield Unit threshold: every voxel with HU ≥ 130 is a calcium candidate.
  2. Minimum lesion area: the lesion, evaluated slice-by-slice via 2D connected components, must have area ≥ 1 mm² (≈ 3 voxels on a 512×512 matrix with cardiac FOV).
  3. Density factor: 1 for HU 130–199, 2 for 200–299, 3 for 300–399, 4 for ≥ 400, computed on the maximum value of the lesion within the slice.
  4. Thickness normalisation: the standard Agatston score is defined on 3 mm slices; for different thicknesses a linear factor is applied.

The final per-artery score is the sum of (area × density factor) for each lesion on each slice. The three main arteries (LM+LAD, LCX, RCA) and, by extension, the aortic valve and great vessels are quantified separately.

[Image 2 — placeholder]
Example axial slice with manual segmentation of coronary territories (LM red, LAD green, CX blue, RCA yellow) — PyCa

3. From EBCT to MESA: the epidemiological confirmation

In the 2000s calcium scoring established itself as a marker of subclinical atherosclerosis thanks to longitudinal cohorts such as MESA (Multi-Ethnic Study of Atherosclerosis, McClelland et al., 2006), which allowed the construction of coronary percentiles stratified by age, sex and ethnicity. Those percentiles have become the de facto reference for contextualising a patient's absolute score.

The calcium score is typically reported in Agatston Units (AU), according to this stratification:

  • 0 AU: no detectable calcium, very low 10-year cardiovascular risk.
  • 1–99 AU: minimal calcium, low-to-intermediate risk.
  • 100–299 AU: moderate calcium, increased risk.
  • ≥ 400 AU: severe calcium, high risk, potential indication for intensive pharmacological therapy.

4. SCOT-Heart and the clinical turning point

The SCOT-Heart trial (Scottish Computed Tomography of the Heart, NEJM 2018) changed the paradigm: in patients with stable chest pain, adding coronary CT angiography to standard care reduced 5-year coronary death/MI by 41% compared to standard care alone. The calcium score is the first piece of information in that diagnostic chain: it is the non-invasive entry door to coronary risk.

From SCOT-Heart onward, the ESC 2024 guidelines on chronic chest pain and the ACC/AHA 2018 cholesterol guidelines have integrated calcium scoring as a decision tool for statin prescription in intermediate-risk populations, reducing overtreatment and undertreatment.

[Image 3 — placeholder]
Agatston risk-stratification chart (MESA percentile curve) — exportable from PyCa's PDF report

5. Beyond the coronaries: non-coronary calcium

The same HU ≥ 130 principle can be applied to non-coronary structures where calcium accumulation has independent clinical meaning:

  • Aortic valve (AVC, Aortic Valve Calcium): a severity marker of calcific aortic stenosis, particularly useful in low-flow low-gradient cases and in cases with discordance between valve area and mean gradient on echocardiography.
  • Mitral annulus: associated with atrial fibrillation and thromboembolic events.
  • Thoracic aorta: marker of systemic atherosclerotic burden.

5.1 AVC and ESC 2021 guidelines

The ESC/EACTS 2021 valvular heart disease guidelines (Vahanian et al.) and Pawade et al. 2018 defined specific AVC cutoffs to suspect severe aortic stenosis in echocardiographically equivocal cases:

  • Men: AVC ≥ 2,000 AU highly suggestive, ≥ 3,000 confirms; below 1,200 excludes.
  • Women: AVC ≥ 1,200 AU highly suggestive, ≥ 1,600 confirms; below 800 excludes.

AVC CT is typically used when echocardiography shows valve area < 1 cm² but mean gradient < 40 mmHg in a patient with preserved ejection fraction (paradoxical low-flow low-gradient): in those cases AVC distinguishes true from pseudo-severe stenosis.

[Image 4 — placeholder]
Radial heatmap of calcium distribution across the three leaflets (RCC / LCC / NCC) — an original PyCa feature

6. From Syngo.via to PyCa: why another tool

Commercial workstations (Syngo.via, IntelliSpace, Aquarius iNtuition) offer calcium-scoring modules that are clinically validated and integrated into the hospital workflow. Excellent in that context, but:

  • They require expensive licenses and dedicated network infrastructure;
  • They are not portable (no USB-friendly standalone install);
  • They offer little algorithm transparency: calculation steps are internal;
  • Their UI is complex, designed for expert radiologists in clinical use, less suited for teaching and research.

PyCa is built to answer those needs on a different plane:

Feature Syngo.via PyCa
LicenseProprietary, paidFree for research
InstallServer-side, dedicatedStandalone, USB-friendly
MESA percentile built inYes (module)Yes (native)
AVC leaflet heatmapNoYes (original)
AI coronary segmentationYes (proprietary)Yes (SEGMENT-CACS, Apache 2.0)
Algorithm transparencyClosed sourceInspectable code, exposed parameters
[Image 5 — placeholder]
Side-by-side comparison Syngo.via vs PyCa on the same DICOM series (same patient, same slice)
[Image 6 — placeholder]
Score tables comparison: per-territory coronary scores Syngo.via vs PyCa on the same case

7. How analysis works in PyCa

The workflow is designed to be linear, even for those approaching calcium scoring for the first time:

  1. DICOM loading: drag-and-drop a folder, automatic series parsing, fix for HU = -3024 voxels (NaN in Siemens output) → -2048.
  2. MPR visualisation: Axial, Coronal, MIP with adjustable slab; Slicer-style oblique reslice to intercept the valvular plane.
  3. Segmentation: Click&Grow on 130 HU threshold, brush and eraser for refinements, undo/redo. Cyan preview of candidate voxels.
  4. AI Analysis (optional): automatic LM/LAD/CX/RCA segmentation with the SEGMENT-CACS multi-task model (Föllmer 2024). Interactive cardiac ROI for wide FOVs.
  5. Calcium Score: per-territory Agatston + MESA percentile + risk stratification. For the aortic valve: radial heatmap of the three leaflets (RCC / LCC / NCC) and ESC cutoffs.
  6. PDF report: compact layout with scores, percentile, screenshots and citations.
[Image 7 — placeholder]
End-to-end analysis workflow: from DICOM load to PDF report (suggestion: 4-step collage)

8. The PyCa project: born as a teaching tool

PyCa was born within the AITeRTC Scientific Committee with an initial clear goal: to provide a teaching tool to explain calcium scoring to radiology technologists, radiology trainees, and non-imaging cardiologists. The transparency of the algorithm (HU ≥ 130 visible as overlay, density factor shown per lesion, configurable minimum area) was meant to make every step inspectable in a calculation often perceived as a "black box" in commercial workstations.

From that initial core, the software has grown:

  • Native MESA percentile, with multicentre study tables, avoiding dependence on external spreadsheets.
  • Radial AVC heatmap: an original feature that maps valvular calcium across the three leaflets in angular coordinates, useful for identifying asymmetric patterns (calcium prevalent on the right vs non-coronary leaflet).
  • Local patient database in SQLite, USB-friendly: the software runs from a stick, data does not leave the machine.
  • Compact PDF reports with automatic citation of scientific references.

8.1 The AI integration: SEGMENT-CACS

In 2024 SEGMENT-CACS was published (Föllmer et al., Insights into Imaging, doi:10.1186/s13244-024-01827-0), a multi-task 2D U-Net model that segments at the coronary segment level (LM, proximal/mid/distal LAD, CX, RCA) on non-contrast CT. The model is released under Apache 2.0, an essential condition for integration into an open-research project like PyCa without proprietary constraints.

The integration was designed to maximise portability:

  • Model conversion from PyTorch to ONNX (opset 17, dynamic batch), file size 5.6 MB.
  • Inference via ONNX Runtime with DirectML backend: runs on any Windows GPU (NVIDIA, AMD, Intel) without requiring CUDA or cuDNN installs. Automatic CPU fallback.
  • Typical times: ~30 seconds on GPU for 143 slices, ~5 minutes on pure CPU.
  • Interactive cardiac ROI for wide chest scans: the user places a circle on the cardiac region and the AI ignores ribs/spine outside it (necessary because the model is trained on CACS-protocol FOV).
  • Calcium is then quantified using PyCa's native Agatston algorithm: the AI provides the segmentation, not the score.

The integration is treated as an experimental feature by default: users are invited to visually verify the segmentation and refine with brush/eraser where needed, following the "human-in-the-loop" philosophy typical of responsible clinical research.

[Image 8 — placeholder]
Cardiac ROI placement dialog (yellow circle) — PyCa AI Analysis
[Image 9 — placeholder]
Automatic AI segmentation on an axial slice: 4 coronary territories recognised automatically

9. Who PyCa is for

  • Radiology technologists: to learn the calcium scoring workflow, understand acquisition parameters, simulate cases.
  • Radiology and cardiology trainees: as a complement to textbooks.
  • Researchers: for retrospective analyses on non-contrast scan cohorts, with standardised reports exportable to CSV.
  • Smaller clinical centres without access to dedicated workstations: for a preliminary assessment, always within the "research / non-clinical" frame.

10. Limitations and roadmap

PyCa is explicitly not a medical device and is not validated for clinical use. Known current limitations include:

  • The AI is trained on cardiac FOV; on wide chest CT it requires a manual ROI to avoid false positives on ribs/spine.
  • The model does not cover the aortic valve (AoV): valvular segmentation remains manual.
  • There is no over-the-air update system yet: new releases are downloaded from the website.

The roadmap includes: comparative validation on multicentre datasets, integration of a second AI model for AoV, DICOM-SEG export, Linux/macOS support.


References

  1. Agatston AS et al. Quantification of coronary artery calcium using ultrafast computed tomography. J Am Coll Cardiol. 1990;15:827–832.
  2. McClelland RL et al. Distribution of coronary artery calcium by race, gender, and age: results from the Multi-Ethnic Study of Atherosclerosis (MESA). Circulation. 2006;113:30–37.
  3. SCOT-Heart Investigators. Coronary CT angiography and 5-year risk of myocardial infarction. N Engl J Med. 2018;379:924–933.
  4. Pawade T et al. Computed tomography aortic valve calcium scoring in patients with aortic stenosis. Circ Cardiovasc Imaging. 2018;11:e007146.
  5. Vahanian A et al. 2021 ESC/EACTS Guidelines for the management of valvular heart disease. Eur Heart J. 2022;43:561–632.
  6. Föllmer B et al. Automated segment-level coronary artery calcium scoring on non-contrast CT: a multi-task deep-learning approach. Insights into Imaging. 2024;15:225. doi:10.1186/s13244-024-01827-0

PyCa is a research tool, provided "AS IS". It is not a medical device, it is not validated for clinical use, and it does not replace the physician's judgement in any case. © 2026 Vittorio Censullo — AITeRTC ETS.

PortfolioPyCa (EN)PyCa (IT)

© 2026 Vittorio Censullo · AITeRTC ETS