Skip to content

Commit

Permalink
added test for readVTKVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
dave3d committed May 4, 2020
1 parent cef3cdb commit 16c4e5c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_vtkutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import vtk
import SimpleITK as sitk
import os
import create_data

class TestVTKUtils(unittest.TestCase):

Expand Down Expand Up @@ -81,6 +82,22 @@ def test_meshIO(self):
self.fail("readMesh failed")


def test_readVTKVolume(self):
print("Testing readVTKVolume")
tetra = create_data.make_tetra(32)
sitk.WriteImage(tetra, "tetra.vtk")
try:
vtkvol = vtkutils.readVTKVolume("tetra.vtk")
print(type(vtkvol))
print(vtkvol.GetDimensions())
except:
sitk.fail("readVTKVolume failed")

try:
os.remove("tetra.vtk")
except:
print("remove tetra.vtk failed")

if __name__ == "__main__":
unittest.main()

0 comments on commit 16c4e5c

Please sign in to comment.