-
Notifications
You must be signed in to change notification settings - Fork 48
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
mesh.get: return vertex->L2 ID map #461
Comments
Hi Philipp, This diagram might be helpful in understanding the relationship between filename and ID: https://github.com/seung-lab/cloud-volume/wiki/Graphene#directory-structure The level two meshes are only fetched if The level of the segid is encoded in the segid and can be retrieved via: The idea of this mapping seems pretty useful! Can you show me the an example pseudo-code usage of the function? What data structure are you thinking of? Will |
just to add to what will said, in order to speed mesh downloading, higher level fragments are stitched, and so when downloading meshes level2 mesh chunks are typically not used (it would take far longer than downloading higher level meshes). I think the feature that you would want, which is what lvl2chunk did a mesh vertex come from, while still reducing the number of mesh fragments being downloaded is a tough one. One flow you could go down , is for each mesh vertex, determine what chunk it came from, and do the same for lvl2 ids you are interested in. For the subset of chunks for which there is a 1-1 mapping there, you can label those mesh vertices. For a subset, there will be an ambiguity, and you will have to download the level2 fragments from that chunk to find out which vertices belong to which, and for another unfortunate subset, the level2 fragment will be missing (or doesn't exist because its too small to mesh). There you will have to fallback to downloading the segmentation in that chunk (and perhaps discovering that no voxels exist at the resolution you downloaded). |
Oh I see - nothing is ever easy, is it? Thanks both! Hmmm, I was hoping that there was a closer correspondence. Looking at this example neuron ( Do you reckon there might be a way to get a "best guess" using some heuristic? For example the second screenshot shows the chunk positions of the L2 IDs for this neuron. If I knew which L2 chunks were combined into a given fragment, I could use e.g. some k-means clustering to assign vertices to an L2 ID. |
You can use get_leaves to find out the level2ids underneath each of the fragments. |
OK cool! I think I need one more nudge in the right direction: For this neuron, for example, the first two fragment filenames are:
I am assuming that So turns out that the first, In this particular case, |
For this particular case, those are dynamic meshes, so the segment ID is in the name of the file like you indicated. You can extract the level of the mesh from the segment ID and avoid the get_leaves call in these redundant cases. |
But for non-L2 dynamic meshes I can't avoid |
I suspect it would be possible to implement a more efficient call on the server side, but I think that's probably your best bet at the moment. Generally speaking, these objects are extremely large so the strategy of the PyChunkGraph has been to do as much work at a high level as possible. Requiring L2 labels across the entire object runs counter to that strategy unfortunately. Low level operations are very useful, but we're still figuring out how to do it. |
we need to push the stop_layer functionality to master and deploy it... i'll ask @sdorkenw about it. |
i mean the stop_layer on get_leaves |
@fcollman We'll need to coordinate that with cloud-volume. Is the interface: |
it will be on the v1, it's already there on the microns version of the chunkedgraph so you can test it there. |
okay.. this is now fixed and deployed. For id=720575940619059120 i see 1264 lvl2IDs. One other thing to note, you can download the level2 fragments, and not the largest fragments available. You see here the 'level' parameter ends up being passed to the server to tell it to pull manifests that don't use fragments that go above this level. Cloudvolume hasn't exposed this functionality right now, but you can follow the pattern in the above function but pass level=2 instead and you'll get lvl2 mesh fragments instead. |
Thanks, that works! I was thinking of keeping this issue for the time being, so I can report back if having this mapping proves useful for working with meshes? |
Hi. This is a question that might lead into a feature/pull request.
For various operations it would be useful to get a mesh vertex to L2 chunk ID mapping. That way we could use e.g. the L2 graph to heal fragmented mesh or derived skeletons. Naively, I assume that the filenames in
fragments
(line) correspond to the L2 IDs?If that's the case, would you be open to a pull request that implements optionally returning a such mapping? At a first glance this looks fairly straight-forward as long as we don't need to worry about deduplicating vertices (which is not implemented for FlyWire meshes anyway). @ceesem might be interested in this too.
The text was updated successfully, but these errors were encountered: