google / google/neuroglancer

Image-specific layer settings are ignored when using automatic layer type detection

Open
#1,085 0 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, I recently stumbled upon the following.

When loading an OME-Zarr source without specifying a layer type, Neuroglancer correctly detects it as an image and applies OMERO channel metadata. However, image-specific settings in the layer specification, such as `opacity` are ignored.

Adding "type": "image" makes those settings work, but then the OMERO channel metadata is no longer applied. It seems there is currently no way to retain both automatic OME-Zarr/OMERO channel configuration and image-specific layer settings.

Example links:
- https://neuroglancer-demo.appspot.com/#!{"layers":[{"source":"https://livingobjects.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr","name":"OME-NGFF","opacity":0.6}]}
- opacity: 0.6
- type: not set
- result: opacity setting discarded
- https://neuroglancer-demo.appspot.com/#!{"layers":[{"source":"https://livingobjects.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr","name":"OME-NGFF","opacity":0.6,"type":"image"}]}
- opacity: 0.6
- type: image
- result: omero metadata ignored

**Diagnosis with the help of an LLM**: `AutoUserLayer` first restores only generic layer state. During conversion to `ImageUserLayer`, `changeLayerType` serializes the auto layer with `toJSON()`, which does not include unrecognized image properties. The image layer therefore receives default values.

Contributor guide

Open the contributing guide

Research direction

Start by tracing AutoUserLayer conversion through changeLayerType and its toJSON() serialization, focusing on how ImageUserLayer receives state. Reproduce the two linked layer configurations and verify that automatic OMERO metadata and image-specific settings such as opacity are both retained.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.