Repository navigation
BUG: Include region in WarpImageFilter same-information fast path (B34, split of #6669) - #6672
Merged
hjmjohnson merged 1 commit intoJul 23, 2026
Conversation
The fast path iterated the displacement field over the output thread region, but the gate compared only origin, spacing and direction. A legitimately larger output over a smaller matching field died in the iterator containment check instead of taking the general clamped path. Issue InsightSoftwareConsortium#6575, item B34.
hjmjohnson
marked this pull request as ready for review
July 21, 2026 15:33
Contributor
|
| Filename | Overview |
|---|---|
| Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx | Adds largest-possible-region equality to the displacement-field same-information fast path, so larger output regions use the general region-safe path. |
| Modules/Filtering/ImageGrid/test/itkWarpImageFilterGTest.cxx | Adds a regression test covering a larger requested output than the displacement field while preserving matching origin, spacing, and direction. |
| Modules/Filtering/ImageGrid/test/CMakeLists.txt | Registers the new WarpImageFilter GoogleTest source with the ImageGrid GTest driver. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[GenerateOutputInformation sets output region] --> B[GenerateInputRequestedRegion]
B --> C{Output and displacement field have same region, origin, spacing, direction?}
C -- Yes --> D[Request output region from displacement field]
D --> E[DynamicThreadedGenerateData fast path uses paired output/field iterators]
C -- No --> F[Compute field request with EnlargeRegionOverBox]
F --> G[DynamicThreadedGenerateData general path samples displacement by physical point]
E --> H[Warped output]
G --> H[Warped output]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[GenerateOutputInformation sets output region] --> B[GenerateInputRequestedRegion]
B --> C{Output and displacement field have same region, origin, spacing, direction?}
C -- Yes --> D[Request output region from displacement field]
D --> E[DynamicThreadedGenerateData fast path uses paired output/field iterators]
C -- No --> F[Compute field request with EnlargeRegionOverBox]
F --> G[DynamicThreadedGenerateData general path samples displacement by physical point]
E --> H[Warped output]
G --> H[Warped output]
Reviews (1): Last reviewed commit: "BUG: Include region in WarpImageFilter s..." | Re-trigger Greptile
dzenanz
approved these changes
Jul 23, 2026
dzenanz
left a comment
Member
There was a problem hiding this comment.
Change looks good. Test looks good on a glance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
B34 —
WarpImageFiltersame-information fast path ignored the region. Split out of #6669 as an independent bug fix (#6669 closed in favor of focused PRs).The "same information" test compared origin/spacing/direction but not size, so a valid larger-output configuration took the fast path and died in an iterator-containment check instead of the general resampling path. The region is now part of the test.
New GTest
WarpImageFilter.LargerOutputThanFieldDoesNotThrowfails before / passes after.Local testing
Cherry-picked onto current
upstream/main(37ecafc); builtITKImageGridGTestDriverand ran the new test — PASSED.pre-commit run --all-filesclean.Fixes item B34 from the #6575 audit. Companion PRs (split from #6669): STYLE/DOC dispositions and the ExponentialDisplacementField B35 fix.