google / google/neuroglancer

State does not persist when xarray dimension name is a not valid Neuroglancer dimension name

Open
#900 2 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

I have Zarr data generated via [xarray.Dataarray.to_zarr](https://docs.xarray.dev/en/stable/generated/xarray.DataArray.to_zarr.html). This includes the units in brackets: `"xpix [µm]"`.

While Neuroglancer can view this data initially, it seems unable to serialize this state properly in the URL. Refreshing, sharing the URL from the address bar, or copying the JSON state fails to reproduce the state.

After testing I determined that Neuroglancer considers both the brackets and the `µ` as illegal characters.

```json
{
"shape": [
5370,
9,
180,
180
],
"data_type": "int16",
"chunk_grid": {
"name": "regular",
"configuration": {
"chunk_shape": [
32,
9,
45,
45
]
}
},
"chunk_key_encoding": {
"name": "default",
"configuration": {
"separator": "/"
}
},
"fill_value": 0,
"codecs": [
{
"name": "bytes",
"configuration": {
"endian": "little"
}
},
{
"name": "zstd",
"configuration": {
"level": 0,
"checksum": false
}
}
],
"attributes": {},
"dimension_names": [
"volumes [s]",
"planes [µm]",
"xpix [µm]",
"ypix [µm]"
],
"zarr_format": 3,
"node_type": "array",
"storage_transformers": []
}
```

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.