seung-lab / cloud-volume

Read and write Neuroglancer datasets programmatically.
https://twitter.com/thundercloudvol
BSD 3-Clause "New" or "Revised" License
134 stars 47 forks source link

download mesh cutouts #580

Open BoyuLyu opened 1 year ago

BoyuLyu commented 1 year ago

Do you know if we can download part of the mesh similar to the segmentation? Such as obtaining the cutout given a bounding box.

william-silversmith commented 1 year ago

Hi HHHit, this is not currently implemented, but it is possible for multi-resolution meshes since the lower levels are stored as a grid of meshes for random access.

BoyuLyu commented 1 year ago

Does that mean I can download the mesh of only one part of a neuron using the multi-resolution mesh? How to do it? I learnt that the multi-resolution mesh can be accessed using cv.mesh.get(example_cell_id, lod=lod)[example_cell_id] But how to confine the bounding box?

william-silversmith commented 1 year ago

This is something that I didn't plan on implementing b/c I wasn't sure anyone would use it. Neuroglancer does this already to implement multi-level zoom for meshes. CloudVolume just downloads all of the LOD meshes and fuses them.

I'm a bit busy atm, so you'll have to consult and modify the CloudVolume code and/or the Neuroglancer multires spec in order to do this. Here's the code where CloudVolume downloads and parses the different mesh fragments.

https://github.com/seung-lab/cloud-volume/blob/master/cloudvolume/datasource/precomputed/mesh/multilod.py#L133-L152

BoyuLyu commented 1 year ago

Thanks!

On Mon, Mar 27, 2023 at 3:20 PM William Silversmith < @.***> wrote:

This is something that I didn't plan on implementing b/c I wasn't sure anyone would use it. Neuroglancer does this already to implement multi-level zoom for meshes. CloudVolume just downloads all of the LOD meshes and fuses them.

I'm a bit busy atm, so you'll have to consult and modify the CloudVolume code and/or the Neuroglancer multires spec in order to do this. Here's the code where CloudVolume downloads and parses the different mesh fragments.

https://github.com/seung-lab/cloud-volume/blob/master/cloudvolume/datasource/precomputed/mesh/multilod.py#L133-L152

— Reply to this email directly, view it on GitHub https://github.com/seung-lab/cloud-volume/issues/580#issuecomment-1485736283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6AIAMVK424VWRVP5FIC3LW6HR65ANCNFSM6AAAAAAWJNVZWA . You are receiving this because you authored the thread.Message ID: @.***>