Skip to content

Add BasicFilters_InverseDisplacementFieldImageFilter_2d.1.nrrd - #53

Merged
blowekamp merged 1 commit into
SimpleITK:mainfrom
blowekamp:InverseDisplacementFieldImageFilter_2d.1.nrrd
Aug 28, 2026
Merged

Add BasicFilters_InverseDisplacementFieldImageFilter_2d.1.nrrd#53
blowekamp merged 1 commit into
SimpleITK:mainfrom
blowekamp:InverseDisplacementFieldImageFilter_2d.1.nrrd

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Alternate baseline for SimpleITK's InverseDisplacementFieldImageFilter 2D test, needed for InsightSoftwareConsortium/ITK#6582 (lattice-centering fix in PrepareKernelBaseSpline()). Test output written by ImageCompare, verified byte-identical across two runs.

@blowekamp
blowekamp marked this pull request as ready for review August 28, 2026 12:40
@blowekamp
blowekamp merged commit bb5dd60 into SimpleITK:main Aug 28, 2026
1 check passed
blowekamp added a commit to SimpleITK/SimpleITK that referenced this pull request Aug 29, 2026
…D fix

ITK commit d6558919459a ("BUG: Center subsampled lattice in
InverseDisplacementFieldImageFilter", InsightSoftwareConsortium/ITK#6582,
follow-up to #6577, item B32 of #6575) fixes PrepareKernelBaseSpline()
placing the thin-plate-spline landmark lattice at fine index 0 with no
low-side margin, leaving up to SubsamplingFactor-1 unsampled voxels on
the high side of every axis. The fix starts the lattice at fine index
(SubsamplingFactor-1)/2 instead, balancing the margins.

SimpleITK's 2d test uses the default SubsamplingFactor of 16 on a
100x100 image, so the landmark lattice has only 6 points per axis;
before the fix they sat at indices 0,16,...,80 (19-pixel margin on the
high edge, 0 on the low edge), after the fix at 7,23,...,87 (balanced
~7/12 margins). With that few landmarks a thin-plate spline is very
sensitive to the shift: RMS difference between old and new output is
0.53 (max pixel difference 1.70), against the test's 0.001 tolerance.

Ruled out the companion direction-propagation fix (3acbd4d95d2, same
issue #6575 item B32) as the cause: the test's input
(Testing/Data/Input/displacement.mha) has identity direction
(TransformMatrix = 1 0 0 1), so that fix is a no-op here.

Add the post-fix output as a .1.nrrd alternate baseline so
BasicFilters.InverseDisplacementFieldImageFilter and
Python.InverseDisplacementFieldImageFilter pass with both pre- and
post-fix ITK. Generated via the same mechanism as other alternates in
this series: the actual ImageCompare harness output, confirmed
byte-identical across two independent runs, and numerically identical
(max abs diff 0.0) between the C++ and Python bindings modulo NRRD
encoding.

Binary data uploaded via a companion draft PR:
SimpleITK/SimpleITKExternalData#53.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant