Fast and lightweight CLI for synthetic CT generation using IMPACT-Synth models within the KonfAI framework.
Project description
IMPACT-Synth-KonfAI
Fast and lightweight CLI for synthetic CT generation using IMPACT-Synth models within the KonfAI framework.
🧩 Overview
IMPACT-Synth-KonfAI is the command-line interface (CLI) for performing inference and uncertainty estimation with the IMPACT-Synth models.
It provides a streamlined way to generate synthetic CT (sCT) images from MR or CBCT scans, leveraging the KonfAI framework for efficient inference, test-time augmentation (TTA), model ensembling, and uncertainty quantification.
The underlying IMPACT-Synth models are a family of supervised convolutional neural networks (CNNs) dedicated to sCT generation.
They build upon the research presented in “Why Registration Quality Matters: Enhancing sCT Synthesis with IMPACT-Based Registration” (Boussot et al., 2025).
These models are trained on carefully aligned MR–CT pairs, where alignment is optimized through the IMPACT-Reg loss to minimize spatial bias. Their training further integrates the IMPACT-Synth loss, a perceptual loss derived from semantic representations of segmentation networks. Together, precise spatial alignment and semantic perceptual supervision reinforce anatomical fidelity and realistic tissue contrast in the synthesized CT images.
The official IMPACT-Synth models are available on Hugging Face and can be executed directly through this CLI.
🚀 Installation
From PyPI:
python -m pip install impact-synth-konfai
From source:
git clone https://github.com/vboussot/KonfAI.git
python -m pip install -e apps/impact_synth
⚙️ Usage
The CLI is organised into sub-commands, mirroring the KonfAI Apps operations:
| Sub-command | Purpose |
|---|---|
synthesize |
Generate the synthetic CT (inference). |
eval |
Evaluate a synthetic CT against a reference CT. |
uncertainty |
Estimate uncertainty (TTA / MC-dropout / ensemble spread). |
pipeline |
Run synthesis, then evaluation and uncertainty in one command. |
Generate a synthetic CT:
impact-synth-konfai synthesize MR -i path/to/input.nii.gz -o ./Output/
Evaluate against a reference CT, or run everything at once:
impact-synth-konfai eval MR -i input.nii.gz --gt reference_ct.nii.gz -o ./Output/
impact-synth-konfai pipeline CBCT -i patient01.nii.gz --gt ct.nii.gz -o patient01 --gpu 0 --tta 2 --ensemble 5 -uncertainty
Arguments
| Flag | Description | Default |
|---|---|---|
MODEL |
Model name on Hugging Face (MR or CBCT) — determines what is predicted |
required |
-i, --inputs |
Input file(s) or a dataset directory | required |
-o, --output |
Output directory | ./Output/ |
--ensemble |
Number of models to ensemble (synthesize / pipeline) |
0 |
--tta |
Number of test-time augmentations (synthesize / pipeline) |
0 |
--mc |
Monte Carlo dropout samples (synthesize / pipeline) |
0 |
-uncertainty |
Also write the inference stack (synthesize / pipeline) |
False |
--gt |
Reference CT(s) — required by eval, optional in pipeline |
unset |
--mask |
Evaluation mask(s) (eval / pipeline) |
unset |
--gpu |
GPU id(s), e.g. 0 or 0 1 |
CPU if unset |
--cpu |
Number of CPU worker processes | unset |
-q, --quiet |
Suppress console output | False |
🧠 Features
- ⚡ Fast inference powered by KonfAI
- 🤗 Automatic model download from Hugging Face
- 🧩 Multi-model ensembling and test-time augmentation (TTA)
- 🧠 Supports evaluation workflows with reference data, and uncertainty estimation without reference
- 🧾 Multi-format compatibility: supports all major medical image formats handled by ITK
📚 References
If you use IMPACT-Synth-KonfAI in your work, please cite:
-
Boussot, V., Hémon, C., Nunes, J.-C., & Dillenseger, J.-L. (2025).
Why Registration Quality Matters: Enhancing sCT Synthesis with IMPACT-Based Registration.
arXiv preprint arXiv:2510.21358 -
Boussot, V., & Dillenseger, J.-L. (2025).
KonfAI: A Modular and Fully Configurable Framework for Deep Learning in Medical Imaging.
arXiv preprint arXiv:2508.09823
⚡ Performance & VRAM
Benchmarked on a single NVIDIA RTX PRO 5000 (24 GB) with a real whole-body MR (295 × 259 × 219, 2 mm), patch [1, 512, 512]. The app auto-selects the batch size from your free GPU VRAM (vram_plan); override it in SlicerKonfAI (⚙ Advanced) or on the CLI with --patch-size / --batch-size.
| Free VRAM | Batch (auto) | Peak VRAM | Time / case |
|---|---|---|---|
| 8 GB | 16 | ~7.6 GB | — |
| 16 GB | 28 | ~15 GB | — |
| 24 GB | 32 | ~16 GB | ~24 s |
Single-model sCT keeps system RAM ~2 GB. The plan leaves memory headroom — a larger batch saturates the card and slows inference (batch 48 → ~22 GB). A full 5-model ensemble runs in ~82 s. Inference scales with the case size.
🔗 Links
- 🤗 Model Hub: huggingface.co/VBoussot/ImpactSynth
- 📦 PyPI Package: pypi.org/project/impact_synth_konfai
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file impact_synth_konfai-1.5.9.tar.gz.
File metadata
- Download URL: impact_synth_konfai-1.5.9.tar.gz
- Upload date:
- Size: 740.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
199e69dadc2d9dcaa430a3b52a93941996696bf3d03d70cca8b00f4fa815be41
|
|
| MD5 |
0d95384b76dcceb9b1eab32fc4779326
|
|
| BLAKE2b-256 |
87ee2e485ebfc623fbc7b2b9dd6670c0ea84b38fa7e1b70d13740d3cf7576cee
|
Provenance
The following attestation bundles were made for impact_synth_konfai-1.5.9.tar.gz:
Publisher:
publish.yml on vboussot/KonfAI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
impact_synth_konfai-1.5.9.tar.gz -
Subject digest:
199e69dadc2d9dcaa430a3b52a93941996696bf3d03d70cca8b00f4fa815be41 - Sigstore transparency entry: 2089267736
- Sigstore integration time:
-
Permalink:
vboussot/KonfAI@d19ef4ab18157dea4a24458b898d1c3e117a572e -
Branch / Tag:
refs/tags/v1.5.9 - Owner: https://github.com/vboussot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d19ef4ab18157dea4a24458b898d1c3e117a572e -
Trigger Event:
push
-
Statement type:
File details
Details for the file impact_synth_konfai-1.5.9-py3-none-any.whl.
File metadata
- Download URL: impact_synth_konfai-1.5.9-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76a36da45e5a89b40e91f9bb937a61e016dc98a939bf10942c6a9651ba3cdcc6
|
|
| MD5 |
19e3f90deecc1d1370947e50b59bc965
|
|
| BLAKE2b-256 |
65afd104a5701a117762329033368514a320cdd0cb08e17e80b2d33f4caee408
|
Provenance
The following attestation bundles were made for impact_synth_konfai-1.5.9-py3-none-any.whl:
Publisher:
publish.yml on vboussot/KonfAI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
impact_synth_konfai-1.5.9-py3-none-any.whl -
Subject digest:
76a36da45e5a89b40e91f9bb937a61e016dc98a939bf10942c6a9651ba3cdcc6 - Sigstore transparency entry: 2089268522
- Sigstore integration time:
-
Permalink:
vboussot/KonfAI@d19ef4ab18157dea4a24458b898d1c3e117a572e -
Branch / Tag:
refs/tags/v1.5.9 - Owner: https://github.com/vboussot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d19ef4ab18157dea4a24458b898d1c3e117a572e -
Trigger Event:
push
-
Statement type: