Retrieve skeleton only when required

37 views
Skip to first unread message

Hashir Ahmad

unread,
Jan 30, 2021, 7:35:55 AM1/30/21
to Neuroglancer
Hi,

Thank you for your previous answer. I am creating a segmentation layer for the skeleton and a local volume for the dummy data provided in example_skeletons.py. I am able to see a single skeleton object. However, I want to see all the ids listed in the side panel and then select an id to view the skeleton. 

I am retrieving the skeletons (vertices and edges) from an API. Here is the implementation:get_skeleton.PNG
All the skeletons are loaded at once and a Skeleton object is returned. I want to load only the skeleton whose id is selected in the side panel. Seeing the example_skeleton.py, the vertices are obtained from the object ids. In my case, I already have the vertices and edges data. 

Another thing I am trying to understand is the use of 'segments' argument in the neuroglancer.SegmentationLayer object:
state.PNG

I thank you once again for answering my previous questions. Much appreciated!

Best regards,
Hashir

Jeremy Maitin-Shepard

unread,
Jan 30, 2021, 5:03:41 PM1/30/21
to Hashir Ahmad, Neuroglancer
The segments property of SegmentationLayer just specifies the set of selected segment ids --- as shown in the "Seg" tab of the layer side panel.

Currently an explicit list of segments, with associated labels and other properties, is only supported through the precomputed datasource, not through the Python datasource.  It could be supported easily enough, though.

However, there is also a simple hack you could use as a workaround: specify

segment_query = ', '.join(str(x) for x in segment_list)

as an additional property of the SegmentationLayer.  I'm not sure exactly how many segments that will accommodate before you run into performance problems, but probably a decent number...

--
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/f510814e-ca8c-47a1-a3fb-f62f7c1891bdn%40googlegroups.com.

Hashir Ahmad

unread,
Feb 1, 2021, 7:35:12 AM2/1/21
to Neuroglancer
Thank you for your answer.

The segment_query is doing what I wanted. I modified the get_skeleton as well and now it works! Have a great day.
Reply all
Reply to author
Forward
0 new messages