Skip to content

Commit c9a00dc

Browse files
authored
Add axis order zarr (#904)
* Add script for debugging the creation of properties json file. * Add axisOrder to zarr properties. * Adapt zarr related test in wkcuber. * Update Changelog.md.
1 parent 60e78be commit c9a00dc

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
2323

2424
### Fixed
2525
- Fixed poetry build backend for new versions of Poetry. [#899](https://github.com/scalableminds/webknossos-libs/pull/899)
26+
- Added axis_order fields for Zarr data format. [#902](https://github.com/scalableminds/webknossos-libs/issues/902)
2627

2728

2829
## [0.12.3](https://github.com/scalableminds/webknossos-libs/releases/tag/v0.12.3) - 2023-02-22

webknossos/testdata/tiff/datasource-properties.zarr-fixture.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,35 @@
1111
"elementClass": "uint8",
1212
"mags": [
1313
{
14-
"mag": [1, 1, 1]
14+
"mag": [
15+
1,
16+
1,
17+
1
18+
],
19+
"axisOrder": {
20+
"x": 1,
21+
"y": 2,
22+
"z": 3,
23+
"c": 0
24+
}
1525
}
1626
],
1727
"numChannels": 1,
1828
"boundingBox": {
19-
"topLeft": [0, 0, 0],
29+
"topLeft": [
30+
0,
31+
0,
32+
0
33+
],
2034
"width": 265,
2135
"height": 265,
2236
"depth": 257
2337
}
2438
}
2539
],
26-
"scale": [11.24, 11.24, 25.0]
27-
}
40+
"scale": [
41+
11.24,
42+
11.24,
43+
25.0
44+
]
45+
}

webknossos/webknossos/dataset/layer.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ def add_mag(
415415
if mag_array_info.data_format == DataFormat.WKW
416416
else None
417417
),
418+
axis_order=(
419+
{"x": 1, "y": 2, "z": 3, "c": 0}
420+
if mag_array_info.data_format == DataFormat.Zarr
421+
else None
422+
),
418423
)
419424
]
420425

@@ -447,6 +452,11 @@ def add_mag_for_existing_files(
447452
if mag_array_info.data_format == DataFormat.WKW
448453
else None
449454
),
455+
axis_order=(
456+
{"x": 1, "y": 2, "z": 3, "c": 0}
457+
if mag_array_info.data_format == DataFormat.Zarr
458+
else None
459+
),
450460
)
451461
)
452462
self.dataset._export_as_json()

webknossos/webknossos/dataset/properties.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class LayerViewConfiguration:
121121
class MagViewProperties:
122122
mag: Mag
123123
cube_length: Optional[int] = None
124+
axis_order: Optional[Dict[str, int]] = None
124125

125126
@property
126127
def resolution(self) -> Mag:

0 commit comments

Comments
 (0)