Skip to content

Commit c7bb57f

Browse files
authored
WSIData as a subclass of SpatialData (#1)
* Update test data * wsidata now inherit from spatialdata * update test cases * update model class * Cleanup publish assets * Adopt API changed in test * Update docs * Add reader datatree
1 parent 303e8de commit c7bb57f

File tree

50 files changed

+1466
-642
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

+1466
-642
lines changed

docs/source/api/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ WSIData
2020
.. currentmodule:: wsidata
2121
.. autosummary::
2222
:toctree: _autogen
23-
:template: autosummary
23+
:template: wsidata
2424
:nosignatures:
2525

2626
WSIData
@@ -36,7 +36,7 @@ Accessors
3636
:nosignatures:
3737

3838
register_wsidata_accessor
39-
GetAccessor
39+
FetchAccessor
4040
IterAccessor
4141
DatasetAccessor
4242

docs/source/intro/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*.svs*
1+
*.svs*
2+
*.zarr

docs/source/intro/01-read&write.ipynb

+209-57
Large diffs are not rendered by default.

docs/source/intro/02-accessors.ipynb

+158-31
Large diffs are not rendered by default.

pyproject.toml

+18
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ dev = [
4141
[tool.hatch.version]
4242
path = "wsidata/__init__.py"
4343

44+
[tool.hatch.build.targets.sdist]
45+
exclude = [
46+
"docs",
47+
"data",
48+
"assets",
49+
"tests",
50+
"scripts",
51+
".readthedocs.yaml",
52+
".github",
53+
".gitignore",
54+
]
55+
include = [
56+
"README.md",
57+
"LICENSE",
58+
"pyproject.toml",
59+
"wsidata",
60+
]
61+
4462
[tool.ruff]
4563
lint.ignore = ["F401"]
4664
line-length = 88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"zarr_format": 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"multiscales": [
3+
{
4+
"axes": [
5+
{
6+
"name": "c",
7+
"type": "channel"
8+
},
9+
{
10+
"name": "y",
11+
"type": "space"
12+
},
13+
{
14+
"name": "x",
15+
"type": "space"
16+
}
17+
],
18+
"coordinateTransformations": [
19+
{
20+
"input": {
21+
"axes": [
22+
{
23+
"name": "c",
24+
"type": "channel"
25+
},
26+
{
27+
"name": "y",
28+
"type": "space",
29+
"unit": "unit"
30+
},
31+
{
32+
"name": "x",
33+
"type": "space",
34+
"unit": "unit"
35+
}
36+
],
37+
"name": "cyx"
38+
},
39+
"output": {
40+
"axes": [
41+
{
42+
"name": "c",
43+
"type": "channel"
44+
},
45+
{
46+
"name": "y",
47+
"type": "space",
48+
"unit": "unit"
49+
},
50+
{
51+
"name": "x",
52+
"type": "space",
53+
"unit": "unit"
54+
}
55+
],
56+
"name": "global"
57+
},
58+
"scale": [
59+
1.0,
60+
1.9839142091152815,
61+
1.983288770053476
62+
],
63+
"type": "scale"
64+
}
65+
],
66+
"datasets": [
67+
{
68+
"coordinateTransformations": [
69+
{
70+
"scale": [
71+
1.0,
72+
1.0,
73+
1.0
74+
],
75+
"type": "scale"
76+
}
77+
],
78+
"path": "0"
79+
}
80+
],
81+
"metadata": {
82+
"omero": {
83+
"channels": [
84+
{
85+
"label": 0
86+
},
87+
{
88+
"label": 1
89+
},
90+
{
91+
"label": 2
92+
}
93+
]
94+
}
95+
},
96+
"name": "/images/wsi_thumbnail",
97+
"version": "0.4"
98+
}
99+
],
100+
"omero": {
101+
"channels": [
102+
{
103+
"label": 0
104+
},
105+
{
106+
"label": 1
107+
},
108+
{
109+
"label": 2
110+
}
111+
]
112+
},
113+
"spatialdata_attrs": {
114+
"version": "0.1"
115+
}
116+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"zarr_format": 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"chunks": [
3+
3,
4+
1496,
5+
1119
6+
],
7+
"compressor": {
8+
"blocksize": 0,
9+
"clevel": 5,
10+
"cname": "lz4",
11+
"id": "blosc",
12+
"shuffle": 1
13+
},
14+
"dimension_separator": "/",
15+
"dtype": "|u1",
16+
"fill_value": 0,
17+
"filters": null,
18+
"order": "C",
19+
"shape": [
20+
3,
21+
1496,
22+
1119
23+
],
24+
"zarr_format": 2
25+
}
Binary file not shown.
Binary file not shown.

tests/data/CMU-1-Small-Region.zarr/tables/resnet50_tiles/X/.zarray

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"chunks": [
3-
35,
3+
31,
44
1000
55
],
66
"compressor": {
@@ -16,7 +16,7 @@
1616
"filters": null,
1717
"order": "C",
1818
"shape": [
19-
35,
19+
31,
2020
1000
2121
],
2222
"zarr_format": 2
Binary file not shown.

tests/data/CMU-1-Small-Region.zarr/tables/resnet50_tiles/obs/_index/.zarray

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"chunks": [
3-
35
3+
31
44
],
55
"compressor": {
66
"blocksize": 0,
@@ -19,7 +19,7 @@
1919
],
2020
"order": "C",
2121
"shape": [
22-
35
22+
31
2323
],
2424
"zarr_format": 2
2525
}
Binary file not shown.

tests/data/CMU-1-Small-Region.zarr/tables/resnet50_tiles/obs/library_id/codes/.zarray

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"chunks": [
3-
35
3+
31
44
],
55
"compressor": {
66
"blocksize": 0,
@@ -15,7 +15,7 @@
1515
"filters": null,
1616
"order": "C",
1717
"shape": [
18-
35
18+
31
1919
],
2020
"zarr_format": 2
2121
}
Binary file not shown.

tests/data/CMU-1-Small-Region.zarr/tables/resnet50_tiles/obs/tile_id/.zarray

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"chunks": [
3-
35
3+
31
44
],
55
"compressor": {
66
"blocksize": 0,
@@ -15,7 +15,7 @@
1515
"filters": null,
1616
"order": "C",
1717
"shape": [
18-
35
18+
31
1919
],
2020
"zarr_format": 2
2121
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"chunks": [],
3+
"compressor": null,
4+
"dimension_separator": "/",
5+
"dtype": "<i8",
6+
"fill_value": 0,
7+
"filters": null,
8+
"order": "C",
9+
"shape": [],
10+
"zarr_format": 2
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"encoding-type": "numeric-scalar",
3+
"encoding-version": "0.2.0"
4+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"chunks": [],
3+
"compressor": null,
4+
"dimension_separator": "/",
5+
"dtype": "<i8",
6+
"fill_value": 0,
7+
"filters": null,
8+
"order": "C",
9+
"shape": [],
10+
"zarr_format": 2
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"encoding-type": "numeric-scalar",
3+
"encoding-version": "0.2.0"
4+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"chunks": [],
3+
"compressor": null,
4+
"dimension_separator": "/",
5+
"dtype": "<i8",
6+
"fill_value": 0,
7+
"filters": null,
8+
"order": "C",
9+
"shape": [],
10+
"zarr_format": 2
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"encoding-type": "numeric-scalar",
3+
"encoding-version": "0.2.0"
4+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"chunks": [],
3+
"compressor": null,
4+
"dimension_separator": "/",
5+
"dtype": "<i8",
6+
"fill_value": 0,
7+
"filters": null,
8+
"order": "C",
9+
"shape": [],
10+
"zarr_format": 2
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"encoding-type": "numeric-scalar",
3+
"encoding-version": "0.2.0"
4+
}
Binary file not shown.

0 commit comments

Comments
 (0)