Skip to content

Commit

Permalink
BUG: Fix SetCenterInObjectSpace calls in Registration test
Browse files Browse the repository at this point in the history
Calls to `EllipseSpatialObject::SetCenterInObjectSpace` should have a
point as argument, not an offset.

Bug found by locally (temporarily) declaring converting constructors of
`itk::Point` "explicit".
  • Loading branch information
N-Dekker authored and hjmjohnson committed Feb 24, 2022
1 parent 0c6c3a9 commit 12a501c
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,18 @@ itkImageToSpatialObjectRegistrationTest(int, char *[])
ellipse3->SetRadiusInObjectSpace(10);

// Place each ellipse at the right position to form a triangle
EllipseType::TransformType::OffsetType offset;
offset[0] = 100;
offset[1] = 40;
ellipse1->SetCenterInObjectSpace(offset);
EllipseType::PointType point;
point[0] = 100;
point[1] = 40;
ellipse1->SetCenterInObjectSpace(point);
ellipse1->Update();

offset[0] = 40;
offset[1] = 150;
ellipse2->SetCenterInObjectSpace(offset);
point[0] = 40;
point[1] = 150;
ellipse2->SetCenterInObjectSpace(point);
ellipse2->Update();

EllipseType::TransformType::OffsetType offset;
offset[0] = 150;
offset[1] = 150;
// Moving the object using the ObjectToParentTransform should
Expand Down

0 comments on commit 12a501c

Please sign in to comment.