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

Open-source code for generating neuroglancer multires meshes from single res mesh #345

Closed
davidackerman opened this issue Oct 15, 2021 · 5 comments

Comments

@davidackerman
Copy link
Contributor

davidackerman commented Oct 15, 2021

Hello,

I have created a python repository called multiresolution-mesh-creator in order to create multiresolution meshes in the neurolgancer multires format. This was heavily inspired by this comment.

The code can either:

  1. Start from a single high resolution mesh for each object, and decimate them to get the lower resolution meshes required for the multiresolution format.
  2. Or it can be provided with meshes at the desired levels of detail and create the multiresolution format from those.

I had done this before, but this a more updated version, utilizing dask. It isn't finalized yet, but can currently process hundreds of meshes at a high resolution and produce the resulting multiresolution meshes in a matter of minutes on a single desktop computer with 10 cores. There will likely be issues for extremely large meshes, but for many practical purposes, this could be useful. I just figured I'd post it here since I have seen questions regarding multiresolution meshes here as well.

The gif below shows the result of creating multiresolution meshes using my code starting from high resolution meshes of a bunny and a teapot, provided in my repo.

Thanks for all you do with neuroglancer, and please let me know if there is a more appropriate place to post it.

recording (1)

@jbms
Copy link
Collaborator

jbms commented Oct 15, 2021

Awesome! Feel free to create a pull request that references this as a related tool on the README.

@davidackerman
Copy link
Contributor Author

Will do!

@davidackerman davidackerman changed the title Opensource code for generating neuroglancer multires meshes from single res mesh Open-source code for generating neuroglancer multires meshes from single res mesh Oct 15, 2021
@xgui3783
Copy link

Thanks for the hard work! I was on-and-off working on an implementation on my own, but you beat me to it 😅

(Apologies, hijacking the thread a little)

I noticed that in the example STL was the input, so the repo can handle more than ng precomputed as an input?

@davidackerman
Copy link
Contributor Author

davidackerman commented Oct 16, 2021

It actually wasn't able to handle ng precomputed as an input format until I just added it now. Otherwise, it uses trimesh to load meshes, which according to the documentation can load the following:

>>> trimesh.exchange.load.mesh_formats()
['dict', 'dict64', 'json', 'msgpack', 'stl', 'stl_ascii', 'ctm', 'ply', 'drc', 'obj', 'off', 'glb', 'gltf', 'xyz']

Probably most useful among those are stl, ply, drc and obj, at least from my experience.

Please let me know if you run into issues with the code or have suggestions!

@davidackerman
Copy link
Contributor Author

Now listed in Related Projects in README as of #346

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

3 participants