cloud-volume icon indicating copy to clipboard operation
cloud-volume copied to clipboard

save meshes in sharded neuroglancer precomputed

Open fb0l opened this issue 2 years ago • 2 comments

Hi everyone, I have a local dataset in neuroglancer precomputed format (sharded) which also contains meshes. Following the tutorial, I'm loading the meshes and I'm applying some transformations to them. After the transformations have been applied, I'd like to save the updated meshes back as sharded neuroglancer precomputed format, ideally into a new output folder.

Is this possible with cloud-volume? Do you have experience with this use-case and know how to continue?

Thanks!

fb0l avatar May 16 '23 13:05 fb0l

Hi fb0l,

Producing a shard is kind of convoluted, but if you do the updates in batches, you could try following the code here and replacing the original shard filename:

https://github.com/seung-lab/igneous/blob/master/igneous/tasks/mesh/multires.py#L356-L358

You can also generate an unsharded volume and convert it to sharded using igneous mesh xfer and then delete the original.

Let me know if you need additional help!

william-silversmith avatar May 16 '23 17:05 william-silversmith

I forgot to mention, you might find it beneficial to use disassemble_shard

https://github.com/seung-lab/cloud-volume/blob/fb3a8c3364a30e82a38fe7607e7602405c873799/cloudvolume/datasource/precomputed/sharding.py#L520

You'll need to use logic in this file in order to read the multi-lod format:

https://github.com/seung-lab/cloud-volume/blob/fb3a8c3364a30e82a38fe7607e7602405c873799/cloudvolume/datasource/precomputed/mesh/multilod.py#L18

william-silversmith avatar May 16 '23 22:05 william-silversmith