Commit graph

14 commits

Author SHA1 Message Date
96733e370d docs(benchmark): add rigid registration pipeline benchmark documentation
Document the unified benchmark contract, per-pipeline settings, and
evaluation details for the six rigid CT-to-T1c registration pipelines.
2026-10-02 18:59:08 +08:00
77653e4018 refactor(impact): replace KonfAI pip runtime with Docker elastix_impact image
Migrate register_impact from impact-reg-konfai (pip + one-time glibc/LibTorch
shim) to the vboussot/elastix_impact Docker image running a rigid 6-DOF
EulerTransform with MIND + TotalSegmentator static features and a Mattes-MI
secondary metric. Delete scripts/setup_impact_konfai.sh.

Vendor ImpactLoss (vboussot/ImpactLoss) into src/impact_loss.py and add
impact_loss as a per-case semantic scoring metric in the benchmark runner.

Update docs (AGENTS.md, REGISTRATION_BENCHMARK.md) to reflect the
all-rigid pipeline set and the new Docker-based IMPACT runtime.
2026-09-30 21:23:18 +08:00
5e525c07c8 Add setup script for IMPACT registration pipeline shim
This commit introduces a new script, `setup_impact_konfai.sh`, which facilitates a one-time setup for the IMPACT registration pipeline (impact-reg-konfai). The script builds a self-contained shim that includes:

- A glibc 2.35 loader and libraries extracted from the niftyreg:2.1.1-ubuntu Docker image.
- A self-contained LibTorch 2.8.0 (cu128) library.
- A wrapper script that runs the stock elastix-impact binary through the glibc 2.35 loader with the appropriate library paths.

The setup ensures compatibility with hosts that do not meet the required glibc and LibTorch versions, allowing the pipeline to function correctly. The script also verifies the installation and provides usage instructions.
2026-09-30 18:21:38 +08:00
73234db39e fix(benchmark): lower IMPACT sample-validity gate to unblock M6 runs
The no-mask CT→T1c FOV mismatch left only ~14% of spatial samples
inside the moving buffer at auto-init, below Elastix's default
RequiredRatioOfValidSamples of 0.25, so the IMPACT pipeline aborted
on every M6 case. Set the gate to 0.1 so the metric's native
in-buffer evaluation proceeds while still catching diverging
transforms.

Switch the default semantic model from TotalSegmentator (TS/M730.pt)
to MRSegmentator (MRSeg/MRSeg.pt), a multi-modality MRI+CT model
better suited to this cross-modality task. Update docstrings and
REGISTRATION_BENCHMARK.md with the new per-case MI results.
2026-09-30 05:57:46 +08:00
16b9828d15 Enhance registration pipelines with CT clipping and NiftyReg Docker support
- Added `--clip-ct LO HI` argument to clip CT intensities before registration and scoring, improving A/B comparisons.
- Implemented `_clip_image` function to handle intensity clipping of images.
- Updated registration functions to utilize CT clipping where beneficial, specifically in `register_niftyreg` and `register_synthmorph`.
- Enhanced `fixed_moving` function to ensure CT is always treated as the fixed image.
- Introduced Docker support for NiftyReg v2.1.1, including a Dockerfile for building the image.
- Updated documentation and help messages to reflect new features and usage instructions.
- Adjusted evaluation criteria for registration quality to account for intensity clipping.
2026-09-29 17:31:24 +08:00
a65189cd33 feat(pipelines): integrate niftyreg and adopt Mattes MI as the benchmark headline score
Add `register_niftyreg` as the sixth rigid CT→T1c pipeline using
`reg_aladin` (symmetric block matching + trimmed least squares, NCC
similarity). Runs natively via `conda install -c conda-forge niftyreg`;
no Docker required.

Change the benchmark's primary reported metric from geometric skull-ring
QA to the achieved Mattes MI (`mi_ct_mr`, nats) between the warped CT
and the original MR over the MR head. Geometric QA fields are still
recorded per case in the JSON output.

Raise the SimpleITK benchmark-mode optimizer budget from 150 to 2000
iterations per pyramid level so all toolkits are compared on an equal
iteration footing.

Update `REGISTRATION_BENCHMARK.md` (five→six pipelines, niftyreg row,
elastix bin count 10→32), `AGENTS.md` (toolkit list), and
`bench_registration.py` docstrings/usage accordingly.
2026-09-29 09:47:28 +08:00
8c083abe92 feat(benchmark): switch to per-toolkit native init and full-volume registration
Replace the shared CT head-box resampling and manual centroid pre-shift with
each toolkit's native automatic transform initialization (elastix/impact use
CenterOfGravity, antspyx uses center-of-mass, simpleitk uses identity). All
pipelines now register on the full volumes instead of a cropped head box.

Drop the _ct_head_box_mm helper and update the benchmark table to document
per-toolkit init methods in a dedicated "init" column.
2026-09-29 07:43:27 +08:00
4ad972b00f refactor(pipelines): remove shared resample helper and clarify init conventions
Drop the _ct_head_box_resample utility that was only needed for centered
initialization, since centroid alignment is now scoped to local optimizers
(antspyx, impact) rather than all pipelines. Reorder the pipeline table and
module docstring alphabetically and add explicit fixed/moving and centroid-init
columns so the per-toolkit registration convention is unambiguous.
2026-09-29 04:09:55 +08:00
f80f22dabe feat(pipelines): add SynthMorph Docker registration and drop DeepReg
Replace the unavailable DeepReg benchmark path with the freesurfer/synthmorph
Docker pipeline for rigid CT-to-T1c registration. Add a shared CT head-box
resample helper for centered initialization and update benchmark docs and CLI
for the new SynthMorph options.
2026-09-28 23:13:44 +08:00
6b85e950e5 feat(docs): update README and benchmark documentation for IMPACT pipeline details 2026-09-28 22:09:03 +08:00
7ac9979c62 fix(docs): update conda environment name to longitudinal-313 and Python version to 3.13
feat(benchmark): add IMPACT pipeline for CT to T1c registration
2026-09-28 21:01:45 +08:00
a9a4d9bba0 refactor(benchmark): use ITK Python API for elastix registration
Replace the conda-forge-dependent Elastix CLI path with the pip-installable
ITK-Elastix Python components so the benchmark can run elastix in the main
environment. Add SimpleITK/ITK image and transform conversion helpers, and
use the elastix 5.x EulerTransform rigid pipeline with Mattes MI and ASGD.

Update REGISTRATION_BENCHMARK.md and bench_registration.py documentation to
reflect the new elastix availability, results, and multi-environment merge
workflow. Ignore local elastix output directories in .gitignore.
2026-09-28 19:01:37 +08:00
214afd643b feat(benchmark): add Mattes MI metric and visual QA for registration evaluation 2026-09-28 17:29:09 +08:00
e8dfe0fe35 feat(registration): align CT to T1c and add benchmarking
Update M6 manifest building to register T1c to CT with rigid
Mattes MI on a CT-space head box, including multi-start initial
tilts for large inter-session head motion. The inverse transform
warps CT and GTV into T1c native space, with acceptance based on
concentricity of the warped CT skull ring and MR head silhouette.

Rerun preprocessing when a row has a label but the warped label file
is missing. Normalize volume orientation in read_nii_img.

Add registration benchmark documentation, benchmark script, and
shared registration pipeline helpers.
2026-09-28 16:20:30 +08:00