google / neuroglancer

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

Annotation coloring by random seed #524

Open fcollman opened 8 months ago

fcollman commented 8 months ago

If i have an annotation layer which has some kind of integer property/class, is there a way I can leverage the existing neuroglancer random coloring infrastructure to render those annotations with respect to a random seed hash?

As an example.. say i have a bunch of synapses where I believe I have given them different class labels and attached those as annotation properties and I want to color the synapses of the same type the same color, without having to explicitly provide a map from integers to colors, or also define an RGB color property on each class?

particularly when classes become larger and more abstact, for example cell type clusters, this would be handy to know how to do.

I'm imaging it is possible with the right level of shader logic, but i don't know where to lookup what shader functions might already be available to help with setting up the state like this.