google/neuroglancer

precomputed annotation spec supports non-float values but front-end does not

Opened this issue · 1 comments

the precomputed skeleton spec allows for non floating point vertex attributes including "int8", "uint8", "int16", "uint16", "int32", "uint32" but neuroglancer will error on any source that has anything but floats for vertex attributes. (due to this check ).

I think if possible it should support displaying skeletons with this extra types, ideally make it possible to alter rendering based on them, but at a minimum just skip over them so the data can be stored there but display is not affected.

A more general point, it seems like the rendering system for skeletons should show properties with names in the UI like it does for annotation properties, rather than relying upon the shader writer to know vCustomX maps to the Xth vertex property with no context as to what the property is or is called.

In case it helps, I think you can reference the vertex property by the name assigned to it rather than vCustomX. For example, I named mine "lsp" and can reference it in the shader by that. But I agree that having it in the UI like the others would be help.

Another question I have about precomputed skeleton rendering is how do I change the alpha? For example, this seems to work fine:

void main() {
  float norm = 10000.0f;
  float alphaNorm = 10000.0f;
  emitRGB(vec3(1.0f-lsp/norm, lsp/norm, 0.0f));
}

but this does not:

void main() {
  float norm = 10000.0f;
  float alphaNorm = 10000.0f;
  emitRGBA(vec4(1.0f-lsp/norm, lsp/norm, 0.0f, lsp/alphaNorm));
}

The alpha doesn't seem to work properly and the colors are affected by the underlying color assigned to the ID. Also when using alpha, even if lines is selected, the points show up instead sometimes.

Is there a way to get alpha to work with skeletons?

image image