Mesh example

102 views
Skip to first unread message

Andrei Mancu

unread,
Feb 1, 2021, 10:19:12 AM2/1/21
to Neuroglancer
Hello,

I am trying to add an implementation of precomputed meshes into python Neuroglancer. I tried wrapping my LocalVolume object with the precomputed mesh inside a SegmentationLayer, no error was thrown, but the mesh does not seem to render. A further attempt was to wrap the LocalVolume inside a SingleMeshLayer, but I don't seem to understand how to use it. Could you please provide a python example, where you use SingleMeshLayer?

Thank you for the help!

Best regards,
Andrei Mancu

Jeremy Maitin-Shepard

unread,
Feb 1, 2021, 11:38:10 AM2/1/21
to Andrei Mancu, Neuroglancer
SingleMeshLayer can be used from Python but there is no special integration --- there is no Python-specific single mesh source:

with viewer.txn() as s:
  s.layers['mesh'] = neuroglancer.SingleMeshLayer(source='vtk://https://storage.googleapis.com/neuroglancer-fafb-data/elmr-data/FAFB.surf.vtk.gz')

Most likely that isn't what you are looking for, though.

Likewise, for precomputed meshes you can use them from Python but there is also no special integration -- you need to arrange for them to be served by some other web server:

with viewer.txn() as s:
  s.layers['mesh'] = neuroglancer.SegmentationLayer(source='precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation/mesh')

If you have both a local volume and a precomputed mesh, you can specify both sources in a single SegmentationLayer:

with viewer.txn() as s:
  s.layers['mesh'] = neuroglancer.SegmentationLayer(source=[neuroglancer.LocalVolume(...), 'precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation/mesh')])

If that doesn't answer your question, if you share your code I can better understand what you are trying to accomplish.

--
You received this message because you are subscribed to the Google Groups "Neuroglancer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neuroglancer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/neuroglancer/59385c4e-9884-4b3c-a701-f1d8960a93fbn%40googlegroups.com.

Andrei Mancu

unread,
Feb 2, 2021, 3:29:58 AM2/2/21
to Neuroglancer
Thank you for the mesh examples.

What I am trying to do is pass directly the bytes of our precomputed mesh through a local volume, so it can be gotten by the Neuroglancer server though the "get_object_mesh()" function. I have checked and the bytes are in the format Neuroglancer requires for a legacy single-resolution mesh.

Screenshot from 2021-02-02 08-57-51.png

Screenshot from 2021-02-02 09-10-47.png

Am I understanding this incorrectly? Should I use a different approach instead, like saving the bytes to a file and pass them through a source, like in your example?

Best regards,
Andrei Mancu
Reply all
Reply to author
Forward
0 new messages