Conversation
Wraps itk::Transform::ApplyToImageMetadata, which updates an image's origin, spacing, and direction in place, mapped through the inverse of the transform, without resampling pixel data. (cherry picked from commit 18a5f84)
…orms Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> (cherry picked from commit 7bb563e)
zivy
approved these changes
Sep 29, 2026
This branch has not been deployed
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.
Summary
Backport of #2721 to the
releasebranch.itk::Transform::ApplyToImageMetadataasTransform::ApplyToImageMetadata(Image &)in SimpleITK.TransformPoint/TransformVector(PimpleTransformBasevirtual method implemented inPimpleTransform<TTransformType>).ITK dependency (resolved)
This branch's pinned ITK (
v5.4.7, seeSuperBuild/External_ITK.cmake) had a null-pointer dereference initk::Transform::ApplyToImageMetadata()for non-invertible transforms, fixed upstream on ITKmainby InsightSoftwareConsortium/ITK#6583 but not present inv5.4.7. The backportedTransformTest.ApplyToImageMetadataunit test exercises exactly this case (a singularAffineTransform) and segfaulted without the fix.InsightSoftwareConsortium/ITK#6914 backported that fix to ITK's
release-5.4branch and has now merged (commitf51ee1e4fd63e435f8213556ef76e6c3b31ad04a). This branch'sSuperBuild/External_ITK.cmakenow pinsITK_GIT_TAGto that commit instead ofv5.4.7, until it lands in a taggedv5.4.xrelease.Test plan
SuperBuild/, Release,BUILD_TESTING=ON, elastix disabled) succeeds.ctestsuite (549/549) passes against the updatedITK_GIT_TAGpin, including the newTransformTest.ApplyToImageMetadata.