google / google/neuroglancer

3 channel image (RGB) example

Open
#308 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
389
Avg merge
3d 21h
Merged PRs (30d)
3

Description

Hi jbms,

Do you have a working example for 3 channel image on Neuroglancer? I am trying to troubleshoot if chunking on CloudVolume is failing or the shader control needs to be configured differently. Perhaps, three channel image need to be converted to a gray scale image and then chunked?

Thank you so much for your help.
-m

```
#uicontrol vec3 color color(default="blue")
#uicontrol float min slider(default=0, min=0, max=1, step=0.01)
#uicontrol float max slider(default=1, min=0, max=1, step=0.01)
#uicontrol float brightness slider(default=0, min=-1, max=1, step=0.1)
#uicontrol float contrast slider(default=0, min=-3, max=3, step=0.1)

float scale(float x) {
return (x - min) / (max - min);
}

void main() {
emitRGB(
color * vec3(
scale(
toNormalized(getDataValue()))
+ brightness) * exp(contrast)
);
}
```

Screen Shot 2021-05-17 at 7 21 06 PM
Screen Shot 2021-05-17 at 7 21 32 PM

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.