Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with WaveFront OBJ meshes #1243

Open
neurolabusc opened this issue Sep 21, 2024 · 0 comments
Open

Issue with WaveFront OBJ meshes #1243

neurolabusc opened this issue Sep 21, 2024 · 0 comments

Comments

@neurolabusc
Copy link

Here is the same mesh as a WaveFront .obj file nd STL format mesh. I can easily convert the vtk format file, but the converting the obj file results in a iwm.cbor file that has nonsense values.

from itkwasm_image_io import imread, imwrite
from itkwasm_mesh_io import meshread, meshwrite
mesh = meshread('brain.obj')
meshwrite(mesh, 'brainOBJ.iwm.cbor')
mesh = meshread('brain.stl')
meshwrite(mesh, 'brainSTL.iwm.cbor')
mesh = meshread('brain.vtk')
meshwrite(mesh, 'brainVTK.iwm.cbor')

The cells from the STL file are BigUint64Array with each triangle listed as 2 3 i j k where 2 is indicates a triangle type and 3 indicates that three indices follows, with i j k being the indices:
Screenshot 2024-09-21 at 6 46 13 PM

In contrast, all the values for the converted OBJ files are huge - out of range of all triangles and of invalid cell types:

Screenshot 2024-09-21 at 6 45 24 PM

3DSlicer, Meshlab, Surfice and NiiVue all open the OBJ file fine. I note that the ITK code is designed to read faces (f), vertices (v) and the optional vertex normals (vn), while this file only has vertices and faces, so perhaps ITK demands the normals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant