Commit 439be45a authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri 💬
Browse files

FIX: SetImageConnection instead of SetImageData

SetImageConnection(a) is the same as SetInputConnection(1,a)
where, a=vtkAlgorithmOutput*

vtkImageDifference changes:
Use GetInputConnection(0,0) instead of GetInput()
Use GetInputConnection(1,0) instead of GetImage()
parent 65aae67c
......@@ -182,12 +182,10 @@ def compareImageWithSavedImage(src_img, img_fname, threshold=10):
pngr = vtk.vtkPNGReader()
pngr.SetFileName(img_fname)
pngr.Update
idiff = vtk.vtkImageDifference()
idiff.SetInputData(src_img)
idiff.SetImageData(pngr.GetOutput())
idiff.Update()
idiff.SetImageConnection(pngr.GetOutputPort())
min_err = idiff.GetThresholdedError()
img_err = min_err
......@@ -306,12 +304,12 @@ def _handleFailedImage(idiff, pngr, img_fname):
# Write out the image that was generated. Write it out as full so that
# it may be used as a baseline image if the tester deems it valid.
pngw.SetInputData(idiff.GetInput())
pngw.SetInputConnection(idiff.GetInputConnection(0,0))
pngw.SetFileName(_getTempImagePath(f_base + ".png"))
pngw.Write()
# write out the valid image that matched.
pngw.SetInputData(idiff.GetImage())
pngw.SetInputConnection(idiff.GetInputConnection(1,0))
pngw.SetFileName(_getTempImagePath(f_base + ".valid.png"))
pngw.Write()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment