AllenNeuralDynamics / AllenNeuralDynamics/aind-ng-link
Add support for grayscale emitter
- Langage dominant
- Python
- Étoiles
- 2
- Forks
- 3
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Currently, we can only use the RGB emitter with a specified color, e.g.
```
layer = {
"source": source,
"tab": "rendering",
"blend": "additive",
"shader": {
"color": "red",
"emitter": "RGB",
"vec": "vec3",
},
"shaderControls": { # Optional
"normalized": {"range": [vmin, vmax]}
},
}
```
If you try to use the grayscale emitter like so, it causes an exception
```
layer = {
"source": source,
"tab": "rendering",
"blend": "additive",
"shader": {
"emitter": "grayscale",
},
"shaderControls": { # Optional
"normalized": {"range": [vmin, vmax]}
},
}
```
```
Traceback (most recent call last):
File "/home/svc_aind_upload/cameron.arshadi/repos/aind-data-transfer/scripts/create_neuroglancer_links.py", line 180, in
main()
File "/home/svc_aind_upload/cameron.arshadi/repos/aind-data-transfer/scripts/create_neuroglancer_links.py", line 176, in main
write_json_from_zarr(args.input, args.output, args.vmin, args.vmax)
File "/home/svc_aind_upload/cameron.arshadi/repos/aind-data-transfer/scripts/create_neuroglancer_links.py", line 163, in write_json_from_zarr
neuroglancer_link = NgState(
File "/home/svc_aind_upload/anaconda3/envs/adt-ca/lib/python3.10/site-packages/ng_link/ng_state.py", line 61, in __init__
self.initialize_attributes(self.input_config)
File "/home/svc_aind_upload/anaconda3/envs/adt-ca/lib/python3.10/site-packages/ng_link/ng_state.py", line 275, in initialize_attributes
self.layers = input_config["layers"]
File "/home/svc_aind_upload/anaconda3/envs/adt-ca/lib/python3.10/site-packages/ng_link/ng_state.py", line 213, in layers
NgLayer(
File "/home/svc_aind_upload/anaconda3/envs/adt-ca/lib/python3.10/site-packages/ng_link/ng_layer.py", line 101, in __init__
self.update_state(image_config)
File "/home/svc_aind_upload/anaconda3/envs/adt-ca/lib/python3.10/site-packages/ng_link/ng_layer.py", line 260, in update_state
self.shader = self.__create_shader(value)
File "/home/svc_aind_upload/anaconda3/envs/adt-ca/lib/python3.10/site-packages/ng_link/ng_layer.py", line 296, in __create_shader
color = shader_config["color"]
KeyError: 'color'
```
It would be useful to add an option to use the grayscale emitter, especially for single channel datasets as the RGB emitter does not look as good in neuroglancer
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.