Closed neurolabusc closed 1 month ago
I am trying to run this example but it is unable to read these files.
This version should work: https://data.kitware.com/#item/5aa18c268d777f06857863fd
I was able to reproduce the traceback received with the one that you created. It seems that there is not currently support for the type used in ITK Python.
The itkwasm-mesh-io package did succeed in reading it.
>>> from itkwasm_mesh_io import read_mesh
>>>
>>> from rich import print
>>> m = read_mesh('cow.vtk')
>>> print(m)
Mesh(
meshType=MeshType(
dimension=3,
pointComponentType='float32',
pointPixelComponentType='int8',
pointPixelType='Scalar',
pointPixelComponents=0,
cellComponentType='uint32',
cellPixelComponentType='int8',
cellPixelType='Scalar',
cellPixelComponents=0
),
name='Mesh',
numberOfPoints=4792,
points=array([ 3.6288500e-01, 2.1545650e-01, -1.3835599e-01, ...,
-1.0299051e+00, 2.0851559e-05, 5.5096006e-01], dtype=float32),
numberOfPointPixels=0,
pointData=array([], dtype=int8),
numberOfCells=5804,
cells=array([ 4, 3, 2, ..., 4581, 4582, 4791], dtype=uint32),
cellBufferSize=29020,
numberOfCellPixels=5804,
cellData=array([], dtype=int8)
)
>>>
Closing issue, as it does read the VTK cow you attached, even if it fails on other valid VTK files. This is curious, as it succeeds on a mesh that mixes quads and triangles, yet fails on geometrically simpler meshes of pure triangles.
I have ITK 5.4.0 installed on my MacOS computer. I am using a binary 'cow.vtk' mesh created by 3D Slicer cow.vtk.zip as well as an ASCII version from here.
I am trying to run this example but it is unable to read these files.
The VTK library does open these meshes, but my attempts to save and reopen with ITK also failed, claiming there is no CONNECTIVITY keyword despite the fact the file clearly lists
CONNECTIVITY vtktypeint64