--- license: apache-2.0 library_name: konfai pipeline_tag: image-to-image tags: - medical-imaging - registration - deformable - multimodal - ct - mri - cbct - konfai --- # IMPACT-Reg โ€” Multimodal Medical Image Registration Robust **multimodal** (**MR / CT / CBCT**) deformable **registration** presets, built with [**KonfAI**](https://github.com/vboussot/KonfAI). Alignment is driven by the **IMPACT** semantic similarity metric โ€” deep features from pretrained segmentation / foundation models (**MIND**, **TotalSegmentator**, **MRSegmentator**) โ€” so cross-modality pairs align while the deformation stays smooth and physically plausible. Each preset is a **self-contained KonfAI app**: on the **fixed** grid it produces the moving image resampled onto the fixed image (**`MovedImage`**) and the **`DisplacementField`**. Presets can be **ensembled** (their displacement fields are averaged into one transform). ## ๐Ÿงฉ Presets | Preset | Pair | Engine | Description | |:--|:--|:--|:--| | `Generic_Rigid` | any | elastix | Rigid alignment (mutual information, multi-resolution) | | `Generic_Rigid_BSpline` | any | elastix | Rigid, then B-spline deformable refinement | | `MR_CT_HeadNeck` | MR/CT | elastix + IMPACT | MR/CT head & neck preset | | `MR_CT_TS` | MR/CT | elastix + IMPACT | MR/CT with MIND + TotalSegmentator features | | `MR_CT_MRSeg` | MR/CT | elastix + IMPACT | MR/CT with MIND + MRSegmentator features | | `CBCT_CT_HeadNeck` | CBCT/CT | elastix + IMPACT | CBCT/CT head & neck preset | | `CBCT_CT_TS` | CBCT/CT | elastix + IMPACT | CBCT/CT with TotalSegmentator features | | `CBCT_CT_MRSeg` | CBCT/CT | elastix + IMPACT | CBCT/CT with MRSegmentator features | | `ConvexAdam_Coarse` | any | itk-impact (native) | Global coarse coupled-convex init (IMPACT/MIND) | | `ConvexAdam_Fine` | any | itk-impact (native) | Adam instance-optimisation (tileable; expects a pre-aligned start) | | `ConvexAdam_Composite` | any | itk-impact (native) | Coarse + fine ConvexAdam in one app (IMPACT/MIND) | Inputs: **Fixed**, **Moving**, and optional **FixedMask** / **MovingMask** (restrict the metric region). ## ๐Ÿš€ Usage ```bash pip install impact-reg-konfai # Register a moving image onto a fixed image (ensemble several presets by listing them): impact-reg-konfai register ConvexAdam_Composite -f fixed.nii.gz -m moving.nii.gz -o ./Output --gpu 0 ``` - **Generic runner (single preset):** `konfai-apps infer VBoussot/ImpactReg:ConvexAdam_Composite -i fixed.nii.gz -i moving.nii.gz -o output/` - **Interactive:** [**SlicerImpactReg**](https://github.com/vboussot/SlicerImpactReg) โ€” a 3D Slicer extension driving these presets. > The `ConvexAdam_*` presets depend on [`itk-impact`](https://pypi.org/project/itk-impact/); resolving the app installs it automatically (it reuses your existing PyTorch, CPU or GPU). ## โšก Performance & VRAM `ConvexAdam` presets (native, GPU) benchmarked on an **NVIDIA RTX PRO 5000 (24 GB)** with a real abdomen **MRโ†’CT** pair, **222 ร— 226 ร— 124 @ 2 mm** (single pass, no TTA): | Preset | Stages | Time / case | Peak VRAM | |:--|:--|:--:|:--:| | `ConvexAdam_Fine` | fine (150 Adam iters) | **โ‰ˆ 0.5 s** | ~2.1 GB | | `ConvexAdam_Coarse` | linear + coarse | **โ‰ˆ 4.6 s** | ~2.1 GB | | `ConvexAdam_Composite` | linear + coarse + fine | **โ‰ˆ 5.1 s** | ~2.1 GB | Per-stage breakdown: linear pre-align **โ‰ˆ 4.2 s** (ITK affine, MI) ยท coarse **โ‰ˆ 0.4 s** ยท fine **โ‰ˆ 0.5 s**. One-time TorchScript feature-model load **โ‰ˆ 7 s** (amortised across a batch). Times scale with case size; `--tta k` multiplies runtime. The `elastix + IMPACT` presets run through elastix and scale differently. ## ๐Ÿ”— Links & Citation - ๐Ÿง  **KonfAI:** [github.com/vboussot/KonfAI](https://github.com/vboussot/KonfAI) - ๐Ÿ“ฆ **PyPI:** [impact_reg_konfai](https://pypi.org/project/impact_reg_konfai/) - ๐Ÿฉป **Slicer:** [SlicerImpactReg](https://github.com/vboussot/SlicerImpactReg) - ๐Ÿ“„ **Paper:** KonfAI โ€” [arXiv:2508.09823](https://arxiv.org/abs/2508.09823)