Skip to content
Snippets Groups Projects
Commit 57f0cc5e authored by Julien Michel's avatar Julien Michel
Browse files

BUG: When computing image point from physical point, we must first offset by...

BUG: When computing image point from physical point, we must first offset by origin and then apply spacing.
parent c0f3f472
No related branches found
No related tags found
No related merge requests found
......@@ -141,10 +141,10 @@ VectorDataGlComponent<TVectorData>
{
// Take into account pixel spacing and origin
PointType spacePoint = vIt.Value();
spacePoint[0] *= m_Spacing[0];
spacePoint[1] *= m_Spacing[1];
spacePoint[0] += m_Origin[0];
spacePoint[1] += m_Origin[1];
spacePoint[0] -= m_Origin[0];
spacePoint[1] -= m_Origin[1];
spacePoint[0] /= m_Spacing[0];
spacePoint[1] /= m_Spacing[1];
// Transform to a screen point
PointType screenPoint = transform->TransformPoint(spacePoint);
......@@ -180,12 +180,12 @@ VectorDataGlComponent<TVectorData>
while (vIt != extRing->GetVertexList()->End())
{
// Take into account pixel spacing and origin
PointType spacePoint = vIt.Value();
spacePoint[0] *= m_Spacing[0];
spacePoint[1] *= m_Spacing[1];
spacePoint[0] += m_Origin[0];
spacePoint[1] += m_Origin[1];
PointType spacePoint = vIt.Value();
spacePoint[0] -= m_Origin[0];
spacePoint[1] -= m_Origin[1];
spacePoint[0] /= m_Spacing[0];
spacePoint[1] /= m_Spacing[1];
// Transform to a screen point
PointType screenPoint = transform->TransformPoint(spacePoint);
......@@ -220,10 +220,10 @@ VectorDataGlComponent<TVectorData>
{
// Take into account pixel spacing and origin
PointType spacePoint = vIt.Value();
spacePoint[0] *= m_Spacing[0];
spacePoint[1] *= m_Spacing[1];
spacePoint[0] += m_Origin[0];
spacePoint[1] += m_Origin[1];
spacePoint[0] -= m_Origin[0];
spacePoint[1] -= m_Origin[1];
spacePoint[0] /= m_Spacing[0];
spacePoint[1] /= m_Spacing[1];
// Transform to a screen point
PointType screenPoint = transform->TransformPoint(spacePoint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment