Skip to content

Commit

Permalink
BUG: fix python tests for VTK6
Browse files Browse the repository at this point in the history
Same fix as compiling for VTK6, SetImage -> SetImageData
Fixes:
 py_ReportingSelfTest
 py_LabelToDICOMSEGConverterSelfTest
  • Loading branch information
Nicole Aucoin committed Aug 6, 2014
1 parent 75f280f commit 2def664
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Testing/Python/ReportingSelfTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,10 @@ def test_ReportingAIMRoundTrip(self):
labelDisplayNode.SetAndObserveColorNodeID('vtkMRMLColorTableNodeFileGenericAnatomyColors.txt')
image = volume.GetImageData()
thresh = vtk.vtkImageThreshold()
thresh.SetInput(image)
if vtk.vtkVersion().GetVTKMajorVersion() < 6:
thresh.SetInput(image)
else:
thresh.SetInputData(image)
thresh.ThresholdBetween(10,400)
thresh.SetInValue(report.GetFindingLabel())
thresh.SetOutValue(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ def test_LabelToDICOMSEGConverterRoundTrip(self):
labelDisplayNode.SetAndObserveColorNodeID('vtkMRMLColorTableNodeFileGenericAnatomyColors.txt')
image = volume.GetImageData()
thresh = vtk.vtkImageThreshold()
thresh.SetInput(image)
if vtk.vtkVersion().GetVTKMajorVersion() < 6:
thresh.SetInput(image)
else:
thresh.SetInputData(image)
thresh.ThresholdBetween(10,400)
thresh.SetInValue(10)
thresh.SetOutValue(0)
Expand Down Expand Up @@ -384,7 +387,10 @@ def test_LabelToDICOMSEGConverterRoundTrip(self):
image = volume.GetImageData()
previousImage = thresh.GetOutput()
diff = vtk.vtkImageDifference()
diff.SetInput(thresh.GetOutput())
if vtk.vtkVersion().GetVTKMajorVersion() < 6:
diff.SetInput(thresh.GetOutput())
else:
diff.SetInputData(thresh.GetOutput())
diff.SetImage(image)
diff.Update()
if diff.GetThresholdedError() > 1:
Expand Down

0 comments on commit 2def664

Please sign in to comment.