Skip to main content

License PyPI version Python CI Paper

IMPACT-Reg logo

IMPACT-Reg-KonfAI

Fast and lightweight CLI for multimodal medical image registration using IMPACT-Reg presets within the KonfAI framework.


🧩 Overview

IMPACT-Reg-KonfAI is the command-line interface (CLI) for running IMPACT-Reg registration presets published in the VBoussot/ImpactReg Hugging Face repository, through the KonfAI deep learning framework.

IMPACT-Reg introduces a semantic similarity metric for multimodal registration, driven by deep features extracted from large pretrained segmentation and foundation models (TotalSegmentator, MIND, anatomix). The presets run it in three registration engines, elastix, ConvexAdam (through itk-impact) and FireANTs, beside intensity-based presets for pairs of the same modality.

A registration run combines:

  • fixed and moving images
  • one or more registration presets resolved from the published preset database (each preset is a KonfAI app)
  • optional image, segmentation, or landmark references (with an optional mask) for evaluation

🧠 Features

  • ⚡ Fast registration powered by KonfAI
  • 🤗 Automatic preset, parameter-map, and model download from Hugging Face
  • 🧩 Multi-preset ensembling (transforms averaged into a single displacement field)
  • 📏 Large images: a pair too large for the memory is registered whole on a grid sized to fit, then refined on native tiles by the presets that declare a tile pass; the outputs are on the native fixed grid
  • 🧠 Semantic IMPACT metric on deep features from pretrained segmentation / foundation models
  • 📐 Evaluation workflows against image, segmentation, and landmark references
  • 🧾 Multi-format compatibility: every format ITK reads, DICOM series, and OME-Zarr stores (the moved image comes back in the moving image's own format)

🗂️ Available presets

Each preset is a KonfAI app on VBoussot/ImpactReg, downloaded with its parameters and models on first use, and passed to register by name. List them with:

impact-reg-konfai list
Preset Pair Engine What it does
Elastix#rigid any elastix Rigid alignment, mutual information, multi-resolution
Elastix#rigid_bspline any elastix Rigid, then B-spline deformable refinement
Elastix#impact_static MRI / CT elastix + IMPACT Rigid, then a B-spline driven by TotalSegmentator (decoder, then segmentation head) and MIND, features extracted once
Elastix#impact_jacobian CT / CBCT elastix + IMPACT Rigid, then a B-spline driven by early TotalSegmentator layers, differentiated through the network
ConvexAdam#coarse any itk-impact The global coarse coupled-convex initialisation on MIND features
ConvexAdam#composite any itk-impact The same coarse pass followed by the Adam instance-optimisation refinement
ConvexAdam#impact_cbct CT / CBCT itk-impact The same pipeline on the second layer of TotalSegmentator MR
ConvexAdam#impact_mrct MRI / CT itk-impact The coarse initialisation alone, on the segmentation head of TotalSegmentator MR and MIND
FireANTs#syn any FireANTs Rigid, affine, then SyN diffeomorphic registration on the GPU
FireANTs#impact CT / CBCT FireANTs + IMPACT Rigid, affine, then SyN driven by IMPACT on early TotalSegmentator layers
FireANTs#anatomix any FireANTs + IMPACT anatomix and MIND features extracted once and registered as feature volumes
FireANTs#impact_mrct MRI / CT FireANTs + IMPACT Rigid, affine, then SyN on the last decoder layer of TotalSegmentator MR and MIND, extracted once

Every elastix and FireANTs deformable preset aligns the pair rigidly or affinely first, so a pair that starts centimetres apart needs no separate rigid run; the ConvexAdam presets have no such stage, their coarse search covering a few centimetres, and moments_init starts them from the translation between the centres. impact-reg-konfai show NAME says what a preset runs, needs and tunes, and the presets page which one suits which pair, with the benchmark behind that advice.

Give the CT a body mask (--fixed-mask) whenever it shows what the other image does not: a table, a head rest, a field of view past the MRI's. A deformable stage otherwise pulls the moving image onto them.


🚀 Installation

From PyPI:

python -m pip install impact-reg-konfai

The ConvexAdam presets run on itk-impact, whose wheels are built against torch 2.12: install that torch alongside, python -m pip install impact-reg-konfai "torch==2.12.*". A preset's requirements never replace the torch you have. The first elastix preset downloads the elastix-IMPACT binary (and, when your torch is another version than the one it was built with, the matching LibTorch), the first FireANTs preset installs fireants; see Installation, caches and troubleshooting.

From source:

git clone https://github.com/fideus-labs/KonfAI.git
cd KonfAI
# konfai and konfai-apps must come from the same checkout: this app pins both to its own
# setuptools_scm version, which only exists on PyPI at a release tag.
python -m pip install -e . -e konfai-apps -e apps/impact_reg

⚙️ Usage

The CLI is organised into sub-commands, matching the registration workflow:

Sub-command Purpose
list, show List the presets; say what one runs, needs, costs and tunes (show NAME).
register Register a moving image onto a fixed image with one or more presets. Several presets are ensembled (their displacement fields are averaged). Writes the transform, the moved image derived from it, a record of the run (register.json) and, with --uncertainty, the ensemble's stack (every preset's field, InferenceStack.mha).
eval Evaluate a registration on any subset of modalities: image (MAE), segmentation (Dice), landmarks (TRE), and for a displacement field its Jacobian (the fraction of folded voxels).
apply Warp more moving-side images through a transform: another sequence, or a label map (--labels, nearest neighbour).
uncertainty How an ensemble's registrations disagree, from its stack: the spread of the displacement vectors (a map, its mean and 95th percentile); with landmarks, their spread through every member and its calibration against the TRE; with a moving segmentation, how its propagations disagree.

Register a moving image onto a fixed image (ensemble several presets by listing them):

impact-reg-konfai register <PRESET> [<PRESET_2> ...] -f fixed.nii.gz -m moving.nii.gz -o ./Output --gpu 0
# an MRI onto a CT, with the CT's body mask:
impact-reg-konfai register Elastix#impact_static -f ct.nii.gz -m mr.nii.gz --fixed-mask ct_body.nii.gz -o ./Output --gpu 0

Each case gets its transform, Output/P000/Transform.h5 (an ITK transform mapping a fixed point to its moving partner, in mm) in the form the preset found: an affine for linear maps (Elastix#rigid), elastix's rigid then B-spline as such (kilobytes), a displacement field on the fixed grid for what is dense (ConvexAdam, FireANTs SyN). An ensemble, a TTA or a tiled run writes the field whatever the form, and --set transform_type=field forces it. The moving image resampled through it is Output/P000/Moved.<ext>. OME-Zarr stores go in and come out the same way:

impact-reg-konfai register FireANTs#syn -f fixed.ome.zarr -m moving.ome.zarr -o ./Output --gpu 0

The transform too: the preset's output dataset says where it goes, and Transform:omezarr writes Output/P000/Transform.ome.zarr, an NGFF RFC-5 displacements field in the images' unit, in place of the .h5. RFC-5 places a field by a scale and a translation: on an oblique grid, the store has no displacements entry, and its rotation stays in a sidecar only KonfAI reads.

impact-reg-konfai register FireANTs#syn -f fixed.ome.zarr -m moving.ome.zarr -o ./Output --gpu 0 \
  --set Predictor.outputs_dataset.DisplacementField.OutputDataset.dataset_filename=Transform:omezarr

Evaluate a registration on any subset of modalities, always from the original moving data (the transform warps it); without --transform it scores the pair as it came:

impact-reg-konfai eval \
  --transform ./Output/P000/Transform.h5 \
  -f fixed.nii.gz -m moving.nii.gz --mask roi.nii.gz \
  --gt-fixed-seg fixed_seg.nii.gz --gt-moving-seg moving_seg.nii.gz \
  --gt-fixed-fid fixed.fcsv --gt-moving-fid moving.fcsv \
  -o ./Output --gpu 0

Warp a label map of the moving image onto the fixed one:

impact-reg-konfai apply --transform ./Output/P000/Transform.h5 -f fixed.nii.gz -i moving_labels.nii.gz --labels -o ./Output/P000

Measure how an ensemble's registrations disagree, from the stack register --uncertainty keeps:

impact-reg-konfai register <PRESET_1> <PRESET_2> -f fixed.nii.gz -m moving.nii.gz -o ./Output --gpu 0 --uncertainty
impact-reg-konfai uncertainty -i ./Output/P000/InferenceStack.mha --gt-fixed-fid fixed.fcsv -o ./Uncertainty

register arguments

Flag Description Default
PRESET, -p, --preset One or more presets (several are ensembled); an unknown name is reported before anything runs required
-f, --fixed-images Fixed image(s), or a dataset directory required
-m, --moving-images Moving image(s), or a dataset directory required
--fixed-mask, --moving-mask Optional masks restricting the metric region unset
-o, --output Output directory ./Output/
--tta Test-time-augmentation draws per preset 0
--uncertainty Keep the ensemble's stack, every preset's field, as <case>/InferenceStack.mha (.ome.zarr beside a store) for uncertainty False
--fields-only Write the transforms and stop; skip deriving the moved images False
--out-of-core ROUTE auto: whole where the pair fits the device, sampled where it does not (tiled or resampled for a preset of another engine); whole, tiled or sampled for every pair (see Large images) auto
--set [PRESET:]NAME=VALUE Tune a preset parameter (repeatable); PRESET: limits it to one preset of an ensemble; checked before anything runs unset
--tmp-dir Where the volume-sized intermediates are staged, the engines' temporary files included hidden beside the output
--gpu / --cpu GPU id(s) / CPU worker processes CPU if unset
-q, --quiet Suppress console output False

eval arguments (at least one modality required)

Flag Description Default
--transform Transform(s) from a prior register (identity if omitted) unset
-f, -m Fixed / moving images: image modality (MAE) unset
--gt-fixed-seg, --gt-moving-seg Fixed / moving segmentations: seg modality (Dice) unset
--gt-fixed-fid, --gt-moving-fid Fixed / moving landmarks: fid modality (TRE) unset
--mask Evaluation mask(s) for the image modality unset
-o, --output Output directory: Evaluation_summary.json holds every metric, per case and over the cohort ./Output/

uncertainty arguments

Flag Description Default
-i, --stack The ensemble's stack of each case, from register --uncertainty required
--gt-fixed-fid Fixed landmarks: their spread through every member (mm per landmark) unset
--gt-moving-fid Moving landmarks, with --gt-fixed-fid: whether the spread predicts the TRE (Spearman) unset
--gt-moving-seg Moving segmentation: how its propagations disagree, voxel by voxel unset
-o, --output Output directory: Uncertainty_summary.json holds every measure, per case and over the cohort ./Output/

See the full help of any sub-command with:

impact-reg-konfai register --help

📖 Documentation and tutorials


📏 Large images

A pair of any size is registered with no option to set. Each preset declares what a voxel costs it on the GPU and in RAM, and KonfAI sizes the run from the GPU memory free when it starts and from the RAM budget, whichever holds fewer voxels. A pair that fits is registered in one piece, at native resolution. A larger one registers sampled: the preset in one pass on the native pair, never resampled and never held whole, an iteration on every box of the pair or, with --samples, on a random draw of them. ConvexAdam: the coarse stage's cost built by boxes of its grid, the fine stage on boxes of its control grid, the pooled feature maps on the GPU where they fit and in files otherwise. FireANTs: its rigid, affine and deformable stages on boxes, the warps on the GPU when they fit, else in host memory while the memory budget holds them, in files beyond. elastix: its own samples, with its images mapped from files and paged by the kernel. A preset of another engine goes in two passes where it declares them, else whole on a pair KonfAI resamples to fit.

--out-of-core chooses the route for every pair instead: whole, sampled, or tiled, two passes:

  1. Global pass: the whole preset runs on the pair resampled onto a grid coarse enough to fit, and its field comes back onto the native fixed grid.
  2. Tile pass: the preset's deformable stage refines that result on native tiles, and the two fields are composed.
[ImpactReg] FireANTs#syn: 257 x 665 x 887 voxels, more than the 19,636,779 it registers whole on this GPU: the preset
on the whole pair resampled to fit, then its deformable stage on native tiles of at most 17,705,407 voxels.

Everything around the presets is streamed, outputs included (.mha, .nii, .nii.gz, .nrrd, OME-Zarr). SlicerImpactReg is not streamed: it loads the moved image and, for uncertainty, every preset's field whole. Details, disk and RAM: Large images.


⚡ Performance

Two mouse brains imaged by ExaSPIM light-sheet microscopy at the Allen Institute for Neural Dynamics (specimens 841260, fixed, and 823508, moving, from the public aind-open-data bucket), registered from OME-Zarr to OME-Zarr at three levels of their pyramid on one NVIDIA RTX PRO 5000 Blackwell Laptop GPU (24 GB), with at most 64 GB of RAM, in a fresh environment as pip installs it. The time is the whole register command, the moved image at native resolution included; the tiles are those of Large images, for a pair larger than what the preset registers whole.

Preset S · 160 µm
128 × 332 × 443
M · 80 µm
257 × 665 × 887
L · 40 µm
514 × 1331 × 1775
Elastix#rigid 6 s 24 s 2 min 18 s
Elastix#rigid_bspline 8 s 33 s 7 min 15 s · 10 tiles
ConvexAdam#coarse 38 s 1 min 18 s 2 min 37 s
ConvexAdam#composite 42 s 2 min 30 s · 3 tiles 9 min 40 s · 30 tiles
FireANTs#syn 1 min 6 s 5 min 47 s · 5 tiles 48 min 7 s · 49 tiles
FireANTs#impact 3 min 10 s 27 min 51 s · 12 tiles
FireANTs#anatomix 1 min 54 s · 2 tiles 12 min 40 s · 18 tiles

Registration takes the correlation between the two brains, inside the fixed brain, from 0.27 to 0.65–0.70 with ConvexAdam#composite and the FireANTs presets, and the Dice of the two brains from 0.71 to 0.94–0.95, at every size; Elastix#rigid alone reaches 0.52–0.54 (Dice 0.89), Elastix#rigid_bspline 0.56–0.58 (0.91–0.92). At 40 µm, FireANTs#impact and FireANTs#anatomix would take about a hundred and a hundred and fifty tiles: at the time a tile takes them at 80 µm, some four and two hours, not run here. The process tree peaks under 17 GB of RAM at 80 µm and between 25 and 39 GB at 40 µm, where KonfAI streams what it resamples and composes within the memory it finds; the intermediates of a tiled run at 40 µm take up to 78 GB of disk, which register checks before it starts.

The elastix IMPACT presets compare TotalSegmentator features at 2 to 6 mm voxels, a scale made for human MRI/CT and CT/CBCT pairs, where a mouse brain is a few voxels across: they are not run here. How accurate each preset is on human MRI/CT, CBCT/CT, CT/CT and MRI/MRI pairs, on nine public datasets: the presets page.


📦 Notes

  • Available presets are resolved dynamically from the published IMPACT-Reg preset database.
  • Multiple presets can be provided in one command; their displacement fields are averaged into a single field.
  • The wrapper orchestrates the preset KonfAI apps (model inference), then ensembles, evaluates, and estimates uncertainty on their outputs.
  • SlicerImpactReg runs the same register from 3D Slicer, and KonfAI Studio from its assistant: konfai-mcp's run_app (action infer) on a preset runs register, and run_registration_evaluate runs eval.

📚 References

If you use IMPACT-Reg-KonfAI in your work, please cite KonfAI and the IMPACT-Reg paper.

  • Boussot, V., Hémon, C., Nunes, J.-C., Dowling, J., Rouzé, S., Lafond, C., Barateau, A., & Dillenseger, J.-L. IMPACT-Reg: A Generic Semantic Loss for Multimodal Medical Image Registration.

  • Boussot, V., & Dillenseger, J.-L. (2025). KonfAI: A Modular and Fully Configurable Framework for Deep Learning in Medical Imaging. arXiv preprint arXiv:2508.09823


Metadata

Release files for impact-reg-konfai 1.9.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 impact-reg-konfai 1.9.0
File Size Uploaded Provenance Actions
impact_reg_konfai-1.9.0.tar.gz 1.2 MB With provenance Details for impact_reg_konfai-1.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for impact-reg-konfai 1.9.0
File Interpreter ABI Platform Actions
impact_reg_konfai-1.9.0-py3-none-any.whl Python 3 none any Details for impact_reg_konfai-1.9.0-py3-none-any.whl

Total release size: 1.4 MB

Release files / impact_reg_konfai-1.9.0.tar.gz

Download URL impact_reg_konfai-1.9.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
7076d2e41dc7df6bbd599a34067ae98bd4a5c151d9aa61dfa7e1a97165a3d79a
BLAKE2b-256 checksum
How to use checksums
9c158f77837a7bd7a5956e06c23672c4adcdb94bab4e28bbc7c9b893bbaf3ca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / impact_reg_konfai-1.9.0-py3-none-any.whl

Download URL impact_reg_konfai-1.9.0-py3-none-any.whl
Size 219.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8dedf9fafb2b799a65d4d618f73e0e0e10573f999e4f4f92c96685910663b0e1
BLAKE2b-256 checksum
How to use checksums
4ae21d5b520c2416427c405abd75385a9c6de7de713d4e0339a4d871d5ece193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for impact-reg-konfai 1.9.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for impact_reg_konfai-1.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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