Instructions to use VBoussot/ImpactReg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KonfAI
How to use VBoussot/ImpactReg with KonfAI:
pip install "konfai[imaging]" konfai-apps
# List the apps this repository holds konfai-apps list VBoussot/ImpactReg # Run one of them on an image konfai-apps infer VBoussot/ImpactReg:<app> -i image.nii.gz -o Output
- Notebooks
- Google Colab
- Kaggle
Commit History
23 days ago
-
Each preset names its demo sample, a case of the fidopt corpus
Verified signature4b7eec7
24 days ago
-
Merge tag 'v1.8.7' into plan/main-presets
Verified signaturev1.8.7 # -----BEGIN PGP SIGNATURE----- # # iHUEABYKAB0WIQRnPuW9t7psxtNBRlaXoT3cgaKwWwUCasKW2QAKCRCXoT3cgaKw # W9ioAQCmMaYrKqG3QwWEUvGcPyUlQ5H0AXVO0bKt/LTY72SOEgD8CTzncbtw0iWo # NptgsfLU5Qzo+2gl+vBsAAQ6pUTUqgY= # =U/Wo # -----END PGP SIGNATURE----- # gpg: Signature made Sun 04 Oct 2026 08:11:37 PM CEST # gpg: using EDDSA key 673EE5BDB7BA6CC6D341465697A13DDC81A2B05B # gpg: Good signature from "vboussot <valentin@fideus.io>" [ultimate]268783a
25 days ago
-
Evaluation_with_seg: cast labels to int32, not uint8
Verified signatureuint8 folded every label above 255 into another (256 became background), so the segmentation metrics of a registration scored the wrong structures for a label map with more than 255 labels.31fcdb4
-
build: pin itk-impact to 0.1.6 in the ConvexAdam presets
Verified signatureThe four ConvexAdam presets asked for itk-impact>=0.1.6, so a later release that changes the stages' interface would break an installed impact-reg-konfai 1.8.7. They now ask for the release they are written against.09d2a19
-
feat: presets for impact-reg-konfai 1.8.7, without integrator_n and with their model files
Verified signatureThe 1.8.7 presets of 7fc77d1 again, on top of the 1.8.6 restore: the FireANTs configs no longer pass integrator_n, which RegistrationNet dropped, each app.json declares the model files it downloads (model_files, at the models revision KonfAI pins), and the ConvexAdam presets ask for itk-impact 0.1.6, whose shared IMPACT loss they call.efdeefe -
Restore 8acfab54 for impact-reg-konfai 1.8.6
Verified signaturePuts main back as it was at 8acfab54, which impact-reg-konfai 1.8.6 reads. The 1.8.7 files stay at 7fc77d1c, the revision 1.8.7 pins, and come back to main with its release.06efc39 -
Presets for impact-reg-konfai 1.8.7: one IMPACT loss, sized from their declared cost
Verified signature7fc77d1
-
Write the configs in KonfAI 1.8.7's spellings
Verified signatureThe sink is OutputDataset, and a repeated stage is keyed Name, Name#2 in the order it runs; KonfAI 1.8.7 refuses OutSameAsGroupDataset and Name/N.8acfab5
-
fix: the ConvexAdam presets run the settings ConvexAdam runs
Verified signatureThe two presets carried their own tuning -- a fifth of the step size over nearly twice the iterations, a coarser Adam grid, a lighter regulariser -- and the refinement ran on an unsmoothed control grid, which no preset could change until konfai exposed the setting. They now take the reference's own values: grid 6, half-width 4, 80 iterations at step 1.0, lambda 1.25, the Adam grid at half the image, and the three smoothing passes the method applies at every iteration. Measured against the reference implementation on four ThoraxCBCT pairs (mean Dice over 57 structures, 0.369 unregistered): 0.471 for convexAdam's own defaults, 0.450 for these settings here, 0.424 once the preset's linear pre-alignment runs first. The pre-alignment is kept, being what makes the preset usable on a pair that starts far apart, and it is the one setting left to revisit. Needs konfai 1.8.6 for control_grid_smoothing.bd726b5
-
feat: no VRAM plan, every preset leaves its patch free and blends its tiles
Verified signatureNo app declares a `vram_plan` any more. Every preset leaves its patch free (`patch_size: [0, 0, 0]`): the volume runs as one patch when it fits, and the engine is handed exactly what it was without a patch. Otherwise konfai tiles it on the measured VRAM, the fewest equal patches that fit, overlapping by 20 % and blended with a `Cosinus` window: without a declared overlap and window the last patch written won, which left a seam in the displacement field where a patch starts. A registration forwards one pair: its batch stays 1.ae888a5
-
Drop the config keys konfai 1.8 no longer reads
Verified signatureimages_log, Dataset.filter, Dataset.use_cache, Dataset.Patch.mask, OutputDataset.inverse_transform, Predictor.Concat, the Evaluator's is_input/patch_transforms and StepLR's verbose: nothing binds them since konfai 1.8.2, so every run printed an unknown-key warning. Found by building each workflow file and reading strict_config's report; each edit checked to parse to the old tree minus those keys. The ImpactSynth MR sCT on a test case is bit-identical before and after.9b707f7
-
Write the registration result as Transform.h5 through the itktransform backend
Verified signatureb7287c9
-
Drop the mask key from Patch, which konfai never binds
Verified signaturekonfai binds a config by walking the callable's signature and does not check for unknown keys, so 'mask' was silently dropped -- Patch takes patch_size, overlap, pad_value and extend_slice, and nothing else. The key promised masked patching and configured nothing. It cannot be honoured as written either: the blend weights each patch by its share of a total summed over the WHOLE grid, so a skipped patch leaves its neighbours' shares summing to less than one and the overlap band decays smoothly to zero -- measured, a constant displacement falling 1.0 to 0 across the band. Skipping requires renormalising over the live set, which means the volume-sized weight buffer and the final division this design exists to avoid.fc7e61a -
A preset declares its displacement field, and only that
Verified signatureThe moved image was the required output and the field the optional one, which is backwards: the field IS the registration, and the moved image is that field applied to the moving -- something the orchestrator derives. Declaring both made every preset write a second output nobody needed, and a tiled preset blend it across every patch seam before throwing it away. outputs_dataset now carries DisplacementField alone, and app.json marks it required. Needs the impact-reg-konfai that derives the moved image (>=1.8.0); an older one looks for a Moved and fails to find it.ee3e448
-
Add per-app icons and declare the registration task
Verified signature3d2686d
-
Require impact_reg_konfai 1.7.0 for the OME-Zarr displacement field
Verified signatureab82a1c
-
Pin itk-impact>=0.1.1 in the ConvexAdam presets for the Windows GIL fix
Verified signature22cec16
-
Drop the placeholder checkpoint; these engines are weightless
model.pt was a dummy 1249-byte checkpoint that only existed to satisfy the predictor's 'at least one checkpoint' rule. These registration engines have no trained weights, and konfai now runs a weightless model (0 parameters) with no checkpoint, so each preset declares 'models': [] and ships no .pt. Requires konfai >= 1.6.1.564cff2 -
Move engine code to impact_reg_konfai.models; keep only config + weights
Each preset's Prediction.yml now points its classpath at impact_reg_konfai.models.<engine>:RegistrationNet instead of a bundled Model.py, and declares impact_reg_konfai>=1.6.1. The duplicated engine code (Model.py, plus elastix_engine.py/install.py) is removed; the elastix parameter-map .txt stay, as they are per-preset config. Requires impact_reg_konfai>=1.6.1 (ships the models subpackage).2f7c1ac
-
Ignore __pycache__ and drop tracked bytecode
a45bf82
-
Add FireANTs presets (Affine/SyN/IMPACT); optional-mask defaults; elastix skips non-restrictive masks
Verified signature6afc1ec
-
fix(convexadam): disable only the TensorExpr fuser during registration
The TS feature models trip torch's TensorExpr fuser alias analysis (INTERNAL ASSERT on aten::size/dim in FuseTensorExprs) when itk-impact runs them. Verified via itk-impact: model-side is impossible (itk-impact passes an undefined direction, so guarding it needs a shape op = the fuser trigger); disabling the fuser is the only fix. Scope it (_no_texpr_fuser) to the registration: modern profiling executor stays on (not legacy), measured ~1% cost (fuser only touches the few feature forwards, not the 150-iter C++ optimisation loop).d2b63cb -
revert(convexadam): drop the legacy-JIT workaround, fixed model-side
The aten::dim JIT-fuser crash is fixed at the source (TS models rebuilt with a Canonical that drops direction.dim() and is device-safe), so the _legacy_jit_executor workaround is no longer needed. Keep only the grad fix (inference_mode(False)+enable_grad) that ConvexAdam's itk-impact optimisation requires.86c3da0 -
refactor(convexadam): scope the legacy-JIT-executor workaround to the registration
Replace the module-import global torch JIT flag (which would impose the legacy executor on every itk-impact / torch user in the process) with a scoped _legacy_jit_executor() context manager around the registration run, restoring the caller's setting on exit. The proper fix belongs in itk-impact's C++ TorchScript execution; this is the bundle-side stopgap.045bd3a -
fix(convexadam): disable JIT profiling executor for TorchScript feature models
The TS segmentation TorchScript exports crash itk-impact's libtorch in the TensorExpr fuser ('INTERNAL ASSERT FAILED ... aten::dim'); MIND (simpler graph) was fine. Disable the JIT profiling/fusion executor at module import so every registry model runs on the stable legacy path (itk-impact shares Python's libtorch).cc45df7 -
fix(convexadam): layers_mask as a 1/0 bitmask string, like elastix
ModelSpec.layers_mask is now a str ('1', '0000001' — one char per model layer, '1'=use) matching the elastix ModelSpec, instead of a list[bool]. The engine converts it to the bool list itk-impact's ModelConfiguration expects; '1' -> [True] keeps the current single-layer configs byte-identical.9b3f426
-
feat(convexadam): models as ModelSpec objects for ref/distance pickers
Replace the flat parallel lists (models/voxel_size/layers_mask/distance/layers_weight/pca) with models: dict[str, ModelSpec] — one object per feature model, carrying its ref (Annotated Choices -> combo of the 30 registry models), voxel_size, layers_mask, layers_weight, pca (Range), distance (Literal -> combo). Mirrors the elastix ModelSpec so SlicerKonfAI renders a repeatable model block with dropdowns, no editor change. The engine unpacks the objects back into the same per-model lists it feeds itk-impact, so single-model configs are byte-identical. Re-adds the models.json registry helpers.b22e3a0 -
fix(convexadam): quiet the per-patch Registration bar in captured output
The itk-impact fine stage opened a tqdm 'Registration' bar per patch with leave=True, stacking a stuck '0/150' line under KonfAI's own Prediction bar in Slicer's captured (non-TTY) log. Use disable=None (auto-hide off-TTY) + leave=False, and fill the bar on completion.0a71243 -
fix(convexadam): re-enable autograd for the itk-impact optimisation
The predictor runs forward under torch.inference_mode(), which forbids autograd, but ConvexAdam's itk-impact stage optimises the field by gradient descent (.backward() inside .Update()) and raised 'element 0 of tensors does not require grad'. Wrap the per-sample registration in torch.inference_mode(False) + torch.enable_grad(); inputs already cross to numpy/ITK so no inference tensors leak into the graph.173f532 -
refactor: split elastix engine and type model parameters across presets
Split each elastix preset's Model.py into a parameter mapper plus an elastix_engine.py runtime, and type the constructor parameters (Literal / Annotated Range / Choices) so UIs derive their constraints. Reg presets set tta=0 and carry the real grid-spacing / spatial-samples in the config (source of truth). ConvexAdam presets carry typed Range parameters.269b189
-
Remove stale __pycache__/.pyc from preset bundles
Verified signature6a3ecbf -
Update reg presets: mode knob + FOV evaluator + dimension-aware patch; models.json fetched from HF (unbundled)
Verified signature442bdf8
-
Add itk-impact ConvexAdam presets (coarse, fine, composite)
Verified signaturefd85e78