BUG: ScaleLogarithmicTransform Jacobian ignores the center#6572
Merged
hjmjohnson merged 1 commit intoJul 9, 2026
Merged
Conversation
ComputeJacobianWithRespectToParameters() returned scale * p, while the transform maps p to scale * (p - center) + center. The base ScaleTransform already differentiates about the center. Registration with a non-zero center was fed a wrong gradient. Differentiate about the center, and cover the Jacobian in the test, which previously exercised none of it.
Contributor
|
| Filename | Overview |
|---|---|
| Modules/Core/Transform/include/itkScaleLogarithmicTransform.hxx | Updates the log-scale Jacobian to differentiate around the transform center; no issues found. |
| Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx | Adds a non-zero-center Jacobian regression test using log-scale parameters; no issues found. |
Reviews (1): Last reviewed commit: "BUG: ScaleLogarithmicTransform Jacobian ..." | Re-trigger Greptile
Member
|
ITK.Linux.Python failed with "We stopped hearing from agent Azure Pipelines 5" (agent VM died mid-build) — infrastructure flake, no code issue; CDash shows 0 errors / 0 test failures for this revision. Retriggering. |
Member
|
/azp run ITK.Linux.Python |
hjmjohnson
approved these changes
Jul 9, 2026
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.
ScaleLogarithmicTransform's Jacobian dropped the transform center:d/dLog(scale[i])isscale[i] * (p[i] - center[i]), notscale[i] * p[i]. Adds the missing Jacobian test case. Split out of #6569 per review.Root cause
itkScaleLogarithmicTransform.hxxcomputedjacobian(dim, dim) = scales[dim] * p[dim];but the transform (inherited from
ScaleTransform) mapsp -> scale * (p - center) + center.itkScaleTransform.hxxalreadydifferentiates about the center (
j(dim, dim) = p[dim] - center[dim]), sothe log-scale chain rule gives
scale[dim] * (p[dim] - center[dim]). With anon-zero center, any
Optimizerv4driving this transform received a wronggradient.
itkScaleLogarithmicTransformTestexercised no Jacobian at all. The addedcase: center
(5, 6, 7), scales(2, 3, 4), point(10, 10, 10)— expecteddiagonal
(10, 12, 12); the old code returns(20, 30, 40).AI assistance
of ITKv4 registration against this source
including
itkScaleLogarithmicTransformTest