-
-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similarity3DTransform::SetScale should recompute m_Offset #2629
Labels
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Comments
N-Dekker
added
the
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
label
Jul 2, 2021
Oh, I guess #2627 is testing this. |
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this issue
Jul 8, 2021
Addressed issue InsightSoftwareConsortium#2629 "Similarity3DTransform::SetScale should recompute m_Offset", which said: > When `Similarity3DTransform::SetScale` is called, it does not compute > `m_Offset`, which appears to cause an incorrect result from > `similarity3DTransform.TransformPoint` when `TransformPoint` is called > directly after `SetScale`. Included a unit test (GoogleTest) to ensure that the issue is fixed.
N-Dekker
added a commit
to SuperElastix/elastix
that referenced
this issue
Jul 8, 2021
Following ITK issue InsightSoftwareConsortium/ITK#2629 and pull request InsightSoftwareConsortium/ITK#2627
This was referenced Jul 8, 2021
Merged
dzenanz
pushed a commit
that referenced
this issue
Jul 8, 2021
Addressed issue #2629 "Similarity3DTransform::SetScale should recompute m_Offset", which said: > When `Similarity3DTransform::SetScale` is called, it does not compute > `m_Offset`, which appears to cause an incorrect result from > `similarity3DTransform.TransformPoint` when `TransformPoint` is called > directly after `SetScale`. Included a unit test (GoogleTest) to ensure that the issue is fixed.
N-Dekker
added a commit
to SuperElastix/elastix
that referenced
this issue
Jul 12, 2021
Following ITK issue InsightSoftwareConsortium/ITK#2629 and pull request InsightSoftwareConsortium/ITK#2627
thewtex
pushed a commit
that referenced
this issue
Aug 11, 2021
Addressed issue #2629 "Similarity3DTransform::SetScale should recompute m_Offset", which said: > When `Similarity3DTransform::SetScale` is called, it does not compute > `m_Offset`, which appears to cause an incorrect result from > `similarity3DTransform.TransformPoint` when `TransformPoint` is called > directly after `SetScale`. Included a unit test (GoogleTest) to ensure that the issue is fixed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Description
When
Similarity3DTransform::SetScale
is called, it does not computem_Offset
, which appears to cause an incorrect result fromsimilarity3DTransform.TransformPoint
whenTransformPoint
is called directly afterSetScale
.ITK/Modules/Core/Transform/include/itkSimilarity3DTransform.hxx
Lines 59 to 65 in 895fc71
The 2D version behaves differently:
Similarity2DTransform::SetScale
does computem_Offset
:ITK/Modules/Core/Transform/include/itkSimilarity2DTransform.hxx
Lines 112 to 119 in 895fc71
Steps to Reproduce
The 2D transform:
Prints [-14, -14], which looks fine to me. However, the 3D version:
Prints [0, 0, 0], which appears wrong!
Expected behavior
In general,
PointType(center + (scale * (input - center))
. When the input point is entirely zero ({}
),center = PointType(7.0)
andscale = 3.0
, I would expectPointType(7.0 + (3.0 * (0.0 - 7.0))
==PointType(-14.0)
.Versions
ITK 5.2, as well as revision 895fc71 (today July 2, 2021 at the master branch)
Additional Information
It looks like this inconsistency between the 2D and the 3D version of the similarity transform has been there for a long time already! Comparing the 2D and 3D version from commit 5d9e2fc by Luis Ibanez (@luisibanez), 29 April 2005:
ITK/Code/Common/itkSimilarity2DTransform.txx
Lines 121 to 129 in 5d9e2fc
ITK/Code/Common/itkSimilarity3DTransform.txx
Lines 56 to 64 in 5d9e2fc
The text was updated successfully, but these errors were encountered: