3 channel image (RGB) example
See original GitHub issueHi 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)
);
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:17
Top Results From Across the Web
How fast in Python change 3 channel rgb color image to 1 ...
Every image has width of 32 pixels, height of 32 pixels, and 3 channels for RGB colors. I want to change them to...
Read more >How do I split a color image into its 3 RGB channels?
Use imread(), then; Invert the images using img=255-img; if image is grayscale, make red, green, and blue equal to the image, otherwise get...
Read more >How to Convert Three Channels of Colored Image into ...
RGB stands for Red, Green and Blue. An RGB image contains 3 channels each for RGB colour. It is represented by three 2-D...
Read more >Understanding the concept of Channels in an Image - Medium
Unlike grayscale images, RGB images are three channeled. Each pixel is made up of three channels, with each channel representing a colour.
Read more >Channel (digital image) - Wikipedia
Color digital images are made of pixels, and pixels are made of combinations of primary colors represented by a series of code. A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It turns out the problem is that the chunk size you are using,
[613, 2753, 1]
is too large, as it results in Neuroglancer attempting to create a 3-d texture of size[613, 2753, 3]
.The developer console shows:
texture_access.ts:317 WebGL: INVALID_VALUE: texImage3D: width, height or depth out of range
On my machine, webglreport.com (under webGL2 tab) shows a maximum 3d texture size of 2048, meaning all dimensions must be <= 2048.
Currently Neuroglancer always stores each chunk as a single texture. In principle Neuroglancer could do rechunking client side to avoid exceeding the maximum chunk size, but that is not implemented.
If you rewrite your volume to use a smaller chunk size it should work. I would recommend e.g. [512, 512, 1].
My email is jbms@google.com