Skip to content

Commit 7d6edef

Browse files
normanrzmarkbader
andauthored
Correctly parse relative mag paths and add version field (#1288)
* wip * fixes * update cassettes * json * add test for relative paths * moar relative paths * upgrade pylibczirw * changelog * fix issue in setup_mag * Apply suggestions from code review Co-authored-by: Mark Bader <[email protected]> * allow metadata-only editing of read-only layers * Update webknossos/Changelog.md * fix test_symlink_layer_rename --------- Co-authored-by: Mark Bader <[email protected]>
1 parent 145e1c3 commit 7d6edef

File tree

50 files changed

+11202
-4015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+11202
-4015
lines changed

webknossos/Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1515
### Breaking Changes
1616

1717
### Added
18+
- Added a `version` field to the `datasource-properties.json` file, which is always set to `1`, for now. [#1288](https://github.com/scalableminds/webknossos-libs/pull/1288)
1819

1920
### Changed
21+
- The `Layer.path` property now always returns `Dataset.path / layer.name`, even if all mags are stored remotely. [#1288](https://github.com/scalableminds/webknossos-libs/pull/1288)
22+
- `Layer.is_remote_to_dataset` is deprecated in favor of `Layer.is_foreign` and `MagView.is_remote_to_dataset` is deprecated in favor of `MagView.is_foreign`. [#1288](https://github.com/scalableminds/webknossos-libs/pull/1288)
23+
- Relative `path` fields in the mag definition of a `datasource-properties.json` file are now interpreted relative to the `Dataset.path`. [#1288](https://github.com/scalableminds/webknossos-libs/pull/1288)
2024

2125
### Fixed
2226

webknossos/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ Changelog = "https://github.com/scalableminds/webknossos-libs/blob/master/webkno
6868
tifffile = ["tifffile >=2024.8.24"]
6969
imagecodecs = ["imagecodecs >=2021.11.20"]
7070
bioformats = ["JPype1 ~=1.5.0"]
71-
czi = ["pylibCZIrw ==4.1.3"]
71+
czi = ["pylibCZIrw ==5.0.0"]
7272
examples = [
7373
"fastremap ~=1.15.0",
7474
"pandas ~=2.2.0",
7575
"pooch ~=1.5.2",
7676
"s3fs >=2023.9.0",
7777
"tabulate >=0.9.0",
7878
"scikit-learn ~=1.5.1",
79-
"scikit-image ~=0.24.0"
79+
"scikit-image ~=0.25.0"
8080
]
8181
all = [
8282
"webknossos[tifffile]",
Lines changed: 16 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": 1,
23
"id": {
34
"name": "ROI2017_wkw",
45
"team": "Connectomics department"
@@ -8,62 +9,34 @@
89
"name": "color",
910
"category": "color",
1011
"boundingBox": {
11-
"topLeft": [
12-
0,
13-
0,
14-
0
15-
],
12+
"topLeft": [0, 0, 0],
1613
"width": 1024,
1714
"height": 1024,
1815
"depth": 1024
1916
},
2017
"wkwResolutions": [
2118
{
22-
"resolution": [
23-
1,
24-
1,
25-
1
26-
],
19+
"resolution": [1, 1, 1],
2720
"cubeLength": 1024
2821
},
2922
{
30-
"resolution": [
31-
16,
32-
16,
33-
16
34-
],
23+
"resolution": [16, 16, 16],
3524
"cubeLength": 64
3625
},
3726
{
38-
"resolution": [
39-
2,
40-
2,
41-
2
42-
],
27+
"resolution": [2, 2, 2],
4328
"cubeLength": 512
4429
},
4530
{
46-
"resolution": [
47-
32,
48-
32,
49-
32
50-
],
31+
"resolution": [32, 32, 32],
5132
"cubeLength": 32
5233
},
5334
{
54-
"resolution": [
55-
4,
56-
4,
57-
4
58-
],
35+
"resolution": [4, 4, 4],
5936
"cubeLength": 256
6037
},
6138
{
62-
"resolution": [
63-
8,
64-
8,
65-
8
66-
],
39+
"resolution": [8, 8, 8],
6740
"cubeLength": 128
6841
}
6942
],
@@ -73,62 +46,34 @@
7346
{
7447
"name": "segmentation",
7548
"boundingBox": {
76-
"topLeft": [
77-
0,
78-
0,
79-
0
80-
],
49+
"topLeft": [0, 0, 0],
8150
"width": 1024,
8251
"height": 1024,
8352
"depth": 1024
8453
},
8554
"wkwResolutions": [
8655
{
87-
"resolution": [
88-
1,
89-
1,
90-
1
91-
],
56+
"resolution": [1, 1, 1],
9257
"cubeLength": 1024
9358
},
9459
{
95-
"resolution": [
96-
16,
97-
16,
98-
16
99-
],
60+
"resolution": [16, 16, 16],
10061
"cubeLength": 64
10162
},
10263
{
103-
"resolution": [
104-
2,
105-
2,
106-
2
107-
],
64+
"resolution": [2, 2, 2],
10865
"cubeLength": 512
10966
},
11067
{
111-
"resolution": [
112-
32,
113-
32,
114-
32
115-
],
68+
"resolution": [32, 32, 32],
11669
"cubeLength": 32
11770
},
11871
{
119-
"resolution": [
120-
4,
121-
4,
122-
4
123-
],
72+
"resolution": [4, 4, 4],
12473
"cubeLength": 256
12574
},
12675
{
127-
"resolution": [
128-
8,
129-
8,
130-
8
131-
],
76+
"resolution": [8, 8, 8],
13277
"cubeLength": 128
13378
}
13479
],
@@ -148,10 +93,6 @@
14893
],
14994
"scale": {
15095
"unit": "nanometer",
151-
"factor": [
152-
11.239999771118164,
153-
11.239999771118164,
154-
28
155-
]
96+
"factor": [11.239999771118164, 11.239999771118164, 28.0]
15697
}
15798
}

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

Lines changed: 0 additions & 43 deletions
This file was deleted.

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
11
{
2+
"version": 1,
23
"id": {
34
"name": "test_dataset",
45
"team": "<unknown>"
56
},
67
"scale": {
78
"unit": "nanometer",
8-
"factor": [
9-
11.24,
10-
11.24,
11-
25.0
12-
]
9+
"factor": [11.24, 11.24, 25.0]
1310
},
1411
"dataLayers": [
1512
{
1613
"name": "tiff",
1714
"category": "segmentation",
1815
"boundingBox": {
19-
"topLeft": [
20-
0,
21-
0,
22-
0
23-
],
16+
"topLeft": [0, 0, 0],
2417
"width": 265,
2518
"height": 265,
2619
"depth": 257
2720
},
2821
"elementClass": "uint8",
29-
"dataFormat": "zarr",
22+
"dataFormat": "zarr3",
3023
"mags": [
3124
{
32-
"mag": [
33-
1,
34-
1,
35-
1
36-
],
25+
"mag": [1, 1, 1],
3726
"axisOrder": {
3827
"c": 0,
3928
"x": 1,

webknossos/tests/cassettes/test_annotation/test_annotation_upload_download_roundtrip.yml

Lines changed: 1154 additions & 88 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)