def test_read_stl_surface(input_datadir): reader = r.vmtkSurfaceReader() reader.InputFileName = os.path.join(input_datadir, 'fixture.stl') reader.Execute() conv = wrap.vmtkSurfaceToNumpy() conv.Surface = reader.Surface conv.Execute() assert sha1(conv.ArrayDict['Points']).hexdigest() == 'a3b3c7608de5a7a9fecf9f7280f9fc65565e7ded'
def test_read_vtp_surface(input_datadir): reader = r.vmtkSurfaceReader() reader.InputFileName = os.path.join(input_datadir, 'aorta-surface.vtp') reader.Execute() conv = wrap.vmtkSurfaceToNumpy() conv.Surface = reader.Surface conv.Execute() assert sha1(conv.ArrayDict['Points']).hexdigest() == '2d589cf877f713cf805d7be952fa5bdb2f2ef0ee'
def make_poly_to_np(surface): converter = surfacetonumpy.vmtkSurfaceToNumpy() converter.Surface = surface converter.Execute() return converter.ArrayDict