Comments (8)
The extra single quote (to make it a local dimension) is added here:
I didn't anticipate that someone would include the special neuroglancer dimension indicators as part of the OME axis names, but I suppose it would make sense to not append a single quote if the dimension name already ends in '
or ^
.
from neuroglancer.
My goal was to be able to programmatically create a URL that "just worked" (i.e. users could open the URL and see the RGB image without having to do any work to flag the channel axis as a channel axis). If there is another way to do that without changing the neuroglancer code, I'm open to it. Adding the ^
to the channel axis name was what I came up with after googling my problem. Granted, I was in a "fast-and-dirty-prototype" state of mind when doing this, so I might have missed something.
from neuroglancer.
Why is a '
appended to the name of the channel axis. Shouldn't it be a ^
? Base on my reading of this
it seems like channel dimensions are supposed to end with ^
(though I admit there may be something I am not understanding).
As an operational demonstration of my difficulty, this shader code
#uicontrol invlerp normalized(range=[0, 255], channel=2)
void main() {
emitGrayscale(normalized());
}
doesn't work if the channel name ends with '
, but does work if I manually hack the channel name to end with ^
.
from neuroglancer.
If it ends with '
, then it is treated as a "local dimension", meaning the layer tab shows a selector for that dimension, and the shader will only have access to the single selected position. However, you can duplicate the layer (probably with a different shader), select a different position for that dimension in the duplicate, and then blend them together.
If it ends with ^
, then it is treated as a "channel dimension", which means the shader can access multiple/all positions along that dimension. Neuroglancer currently does not support channel dimensions that are chunked, i.e. where the chunk size along that dimension is not equal to the total extent of that dimension.
In your example where you are using the invlerp control to select just a single channel, you could accomplish the same thing by making it a local dimension rather than a channel dimension. The only case where a channel dimension is needed is if you need a single shader to access more than one channel.
from neuroglancer.
It is indeed a bit arbitrary whether Neuroglancer makes OME-zarr "channel" dimensions into local dimensions or channel dimensions by default. I decided to make them local dimensions by default because of the limitation on chunking. Changing the name as you have done is in fact the intended mechanism to make it into a channel dimension if that is desired.
from neuroglancer.
In trying to be as minimally illustrative as possible, I was too simple in my example. My end goal is to have a single shader access all three channels so that I can display an RGB image (and possibly also adjust their relative intensities). Something like
#uicontrol invlerp normalized_r(range=[0, 255.0], channel=0)
#uicontrol invlerp normalized_g(range=[0, 255.0], channel=1)
#uicontrol invlerp normalized_b(range=[0, 255.0], channel=2)
void main() {
float r = normalized_r();
float g = normalized_g();
float b = normalized_b();
emitRGB(vec3(r,g,b));
}
Again: this works if the channel dimension is named c^
, but not if it is named c'
, which is what the neuroglancer code seems to produce by default.
I admit that changing the one character in the name of the channel dimension is not that difficult, but I am trying to produce a tool that will "just work" for a non-technical user, and I'd rather not ask them to fix the column name unless I absolutely have to.
Is there a way to get shader RGB shader code to work with the current convention?
from neuroglancer.
You could also accomplish this by having a separate layer for each channel (using c'
) and enable additive blending mode.
By "produce a tool", can you clarify what you mean? Is your tool generating a Neuroglancer URL/state for the user, that includes this RGB shader? In that case your tool could just rename the dimension as part of the Neuroglancer state.
from neuroglancer.
Yes. By "produce a tool" I mean "write a script that creates a URL with all the configs necessary to visualize our data."
I did not realize I could rename the dimension in the JSON config. Thank you. I am now unblocked.
from neuroglancer.
Related Issues (20)
- Zstandard support? HOT 1
- Support for datasets in authenticated S3-compatible private buckets HOT 6
- N5 now supports Zstandard HOT 2
- "StarredSegments" object has no attribute "_visible" on release 2.37
- Consider using SolidJS HOT 1
- Use FinalizationRegistry to manage inter-worker object mappings without reference counting
- undock layer side panel HOT 1
- Set matrix transform for ImageLayer via Python HOT 2
- Hiding yellow border for images? HOT 3
- neuroglancer default framebuffer size artificially limits resolution HOT 7
- MAX_DRAW_BUFFERS limit error with shader in Safari
- Spatial dimensions, xy, is rendering in the 'zy' plane instead of the 'xy' plane when using the zarr format HOT 3
- Annotation coloring by random seed
- Loading of precomputed data stalls HOT 2
- Import annotation from csv feature, is it still available? HOT 5
- precomputed annotation format related ID lookup HOT 2
- WebXR support
- feature request: change default shader for multi-channel images
- Add docs on how coordinate transforms are defined HOT 1
- overly coarse mouseover for OME-Zarr segmentations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuroglancer.