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

Endianness affects meshing #41

Open
davidackerman opened this issue May 10, 2024 · 0 comments
Open

Endianness affects meshing #41

davidackerman opened this issue May 10, 2024 · 0 comments

Comments

@davidackerman
Copy link

davidackerman commented May 10, 2024

Hello,

I have noticed that the endianness of the labels array affects the ids that the mesher reports. For example

import zmesh
import numpy as np

for endian in ['<','>']:
    labels = np.zeros((11, 17, 19), dtype=np.dtype(f'{endian}i8'))
    labels[1:-1, 1:-1, 1:-1] = 1

    mesher = zmesh.Mesher((4, 4, 40))
    mesher.mesh(labels)

    print(f"{endian} endian, ids: {mesher.ids()}")

results in:

< endian, ids: [1]
> endian, ids: [72057594037927936]

I can fix the problem by swapping the byteorder, but figured I'd point it out. I had noticed a similar fix in the skeletonization code.

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