Skip to content

Commit 9ea049e

Browse files
authored
Support reading wkw datasets with new mag key instead of wkwResolutions (#1349)
* Support reading wkw datasets with new mag key instead of wkwResolutions * changelog
1 parent f858ac2 commit 9ea049e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1515
### Breaking Changes
1616

1717
### Added
18+
- Added support for reading wkw datasets with the new "mag" key in datasource-properties.json, which replaces "wkwResolutions" for datasets written out by the webknossos server. [#1349](https://github.com/scalableminds/webknossos-libs/pull/1349)
1819

1920
### Changed
2021

webknossos/webknossos/dataset/properties.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,11 @@ def __layer_properties_pre_structure(
368368
type_value: type[LayerProperties | SegmentationLayerProperties],
369369
) -> LayerProperties | SegmentationLayerProperties:
370370
if d["dataFormat"] == "wkw":
371-
d["mags"] = [
372-
mag_view_properties_pre_structure(m) for m in d["wkwResolutions"]
373-
]
374-
del d["wkwResolutions"]
371+
if "wkwResolutions" in d:
372+
d["mags"] = [
373+
mag_view_properties_pre_structure(m) for m in d["wkwResolutions"]
374+
]
375+
del d["wkwResolutions"]
375376
# bounding_box and additional_axes are internally handled as nd_bounding_box
376377
if "additionalAxes" in d:
377378
d["boundingBox"]["additionalAxes"] = copy.deepcopy(d["additionalAxes"])

0 commit comments

Comments
 (0)