google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.09k stars 295 forks source link

Choose color for the rendered skeleton based on axon/dendrite/myelin labels? #661

Open dgallichan opened 8 hours ago

dgallichan commented 8 hours ago

I'm new to exploring the H01 data (https://h01-release.storage.googleapis.com/gallery.html ) via Neuroglancer - and have been amazed by the ability to browse real human cortex at this detail.

One thing that would really help me with my exploration for my own research is to be able to see which parts of which cells are myelinated - and something that I think would help me explore this is if I could colorize the rendered skeleton of a cell based on the labels from the 'c3 segmentation' that appear to include information about dendrite vs axon - and whether it is myelinated. It looks to me like this should be possible with a custom 'skeleton shader', but when I click on the '?' link for help on this, there are no examples that help me work out how to achieve this.

Is someone able to provide a skeleton shader that would do this for the H01 dataset for example?

Many thanks

Dan

jbms commented 7 hours ago

Currently a skeleton shader can only access node-level properties that were explicitly included with the skeleton. If the compartments were included as properties it would be easy to do what you want, but I don't believe we have exported the c3 segmentation skeletons with any properties.

dgallichan commented 4 hours ago

Thanks for the prompt response on this. Is there any way that I can create what you are describing myself? And if not, is there any way to request that this would be added to the available dataset? I can imagine that being able to easily visualise where the axon is would actually be incredibly useful for large number of users, as currently it seems that it can take quite a lot of hunting to locate the axon on just one cell.

jbms commented 3 hours ago

Maybe this is close to what you are looking for? This overlays the subcompartment annotation layer on top of the skeletons.

https://h01-dot-neuroglancer-demo.appspot.com/#!%7B%22dimensions%22:%7B%22x%22:%5B8e-9%2C%22m%22%5D%2C%22y%22:%5B8e-9%2C%22m%22%5D%2C%22z%22:%5B3.3e-8%2C%22m%22%5D%7D%2C%22position%22:%5B252215.046875%2C188531.90625%2C2002.4998779296875%5D%2C%22crossSectionScale%22:66.56481577338745%2C%22projectionOrientation%22:%5B-0.7277162671089172%2C0.194806769490242%2C0.6257741451263428%2C0.2022031545639038%5D%2C%22projectionScale%22:39318.803032821714%2C%22layers%22:%5B%7B%22type%22:%22image%22%2C%22source%22:%22precomputed://gs://h01-release/data/20210601/4nm_raw%22%2C%22tab%22:%22source%22%2C%22name%22:%224nm%20EM%22%7D%2C%7B%22type%22:%22segmentation%22%2C%22source%22:%7B%22url%22:%22precomputed://gs://h01-release/data/20210601/c3%22%2C%22subsources%22:%7B%22default%22:true%2C%22bounds%22:true%2C%22properties%22:true%2C%22skeletons%22:true%7D%2C%22enableDefaultSubsources%22:false%7D%2C%22panels%22:%5B%7B%22flex%22:1.55%2C%22tab%22:%22source%22%7D%5D%2C%22segments%22:%5B%5D%2C%22segmentQuery%22:%22#neuron%20#spiny-stellate%22%2C%22colorSeed%22:4270253886%2C%22name%22:%22c3%20segmentation%22%7D%2C%7B%22type%22:%22annotation%22%2C%22source%22:%22precomputed://gs://h01-release/data/20210601/c3/subcompartments/annotations%22%2C%22tab%22:%22source%22%2C%22ignoreNullSegmentFilter%22:false%2C%22shader%22:%22void%20main%28%29%20%7B%5Cn%20%20switch%20%28prop_class_label%28%29%29%20%7B%5Cn%20%20case%200:%20%20//%20axon%5Cn%20%20%20%20setColor%28vec3%280%2C%200%2C%201%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20case%201:%20%20//%20dendrite%5Cn%20%20%20%20setColor%28vec3%281%2C%200%2C%200%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20case%202:%20%20//%20astrocyte%5Cn%20%20%20%20setColor%28vec3%280%2C%201%2C%200%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20case%203:%20%20//%20soma%5Cn%20%20%20%20setColor%28vec3%281%2C%201%2C%201%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20case%204:%20%20//%20cilium%5Cn%20%20%20%20setColor%28vec3%280.5%2C%200.5%2C%200%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20case%205:%20%20//%20AIS%5Cn%20%20%20%20setColor%28vec3%280.5%2C%200.5%2C%201%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20%20%20%5Cn%20%20case%201000:%20%20//%20myelinated%20axon%5Cn%20%20case%201001:%5Cn%20%20%20%20setColor%28vec3%281%2C%200.25%2C%200.75%29%29%3B%5Cn%20%20%20%20break%3B%5Cn%20%20case%201004:%20%20//%20fragments%5Cn%20%20case%201005:%5Cn%20%20default:%5Cn%20%20%20%20discard%3B%5Cn%20%20%7D%5Cn%7D%22%2C%22linkedSegmentationLayer%22:%7B%22skeleton_id%22:%22c3%20segmentation%22%7D%2C%22filterBySegmentation%22:%5B%22skeleton_id%22%5D%2C%22name%22:%22subcompartment%20annotations%22%7D%5D%2C%22showDefaultAnnotations%22:false%2C%22showSlices%22:false%2C%22prefetch%22:false%2C%22selectedLayer%22:%7B%22row%22:1%2C%22flex%22:0.65%2C%22layer%22:%22c3%20segmentation%22%7D%2C%22layout%22:%7B%22type%22:%22xy-3d%22%2C%22orthographicProjection%22:true%7D%2C%22helpPanel%22:%7B%22flex%22:0.92%7D%2C%22selection%22:%7B%22row%22:2%2C%22flex%22:0.45%2C%22size%22:309%2C%22visible%22:false%7D%2C%22layerListPanel%22:%7B%22flex%22:1.08%7D%7D