Skip to content

Commit

Permalink
BUG: Update expected segmentation geometry for test results
Browse files Browse the repository at this point in the history
SlicerBoundsTest and vtkSegmentationTest1 both failed as a result of changes in vtkSegmentationConverter::SerializeImageGeometry.
This updates the expected results of the test to match the actual output geometry.

From: Kyle Sunderland <[email protected]>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@28675 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information
jcfr committed Dec 12, 2019
1 parent 75f085d commit 03bbf97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Applications/SlicerApp/Testing/Python/SlicerBoundsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_Segmentation(self):
# Testing
bounds = list(range(6))
segmentationNode.GetRASBounds(bounds)
untransformedBounds = [-65.4164152220677, 237.23434621664234, -305.4495706784099, 289.7072339384947, -217.46321203583187, 213.68731403607347]
untransformedBounds = [-65.41641522206768, 237.23434621664228, -303.75878430165756, 289.7072339384945, -217.463212035832, 213.6873140360733]
self.assertListAlmostEquals(bounds, untransformedBounds)

segmentationNode.GetBounds(bounds)
Expand All @@ -189,7 +189,7 @@ def test_Segmentation(self):
transformNode.ApplyTransform(transform)

segmentationNode.SetAndObserveTransformNodeID(transformNode.GetID())
transformedBounds = [-690.2701685073098, 970.3186946284741, -744.3124542486084, 1018.260811721817, -2183.4639807718822, 2144.107746300856]
transformedBounds = [-690.2701685073093, 966.991271911892, -740.4842166018336, 1018.2608117218165, -2183.4229718546612, 2144.1077463008546]
segmentationNode.GetRASBounds(bounds)
self.assertListAlmostEquals(bounds, transformedBounds)

Expand Down
10 changes: 5 additions & 5 deletions Libs/vtkSegmentationCore/Testing/vtkSegmentationTest1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ int vtkSegmentationTest1(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
}
std::string defaultGeometryString = vtkSegmentationConverter::SerializeImageGeometry(defaultImageData);
std::string expectedDefaultGeometryString =
"0.235971522108411;0;0;20.7521629333496;"
"0;0.235971522108411;0;20.7521629333496;"
"0;0;0.235971522108411;20;"
"0.23597152210841135;0;0;20.75216293334961;"
"0;0.23597152210841135;0;20.75216293334961;"
"0;0;0.23597152210841135;20;"
"0;0;0;1;"
"0;248;0;248;0;255;";
"0;248;0;248;-1;255;";
if (defaultGeometryString != expectedDefaultGeometryString)
{
std::cerr << __LINE__ << ": Default reference geometry mismatch. Expected: "
Expand All @@ -107,7 +107,7 @@ int vtkSegmentationTest1(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
std::cerr << __LINE__ << ": Binary labelmap converted without reference geometry has no foreground voxels!" << std::endl;
return EXIT_FAILURE;
}
int expectedVoxelCount = 15872256;
int expectedVoxelCount = 15934257;
if (imageAccumulate->GetVoxelCount() != expectedVoxelCount)
{
std::cerr << __LINE__ << ": Binary labelmap voxel count mismatch after converting without reference geometry."
Expand Down

0 comments on commit 03bbf97

Please sign in to comment.