Skip to content

Commit 42f8227

Browse files
Support tiled tiffs in high level dataset API (#185)
* only log downsampling for each MB ob precessed data * log every gigabyte instead of every megabyte * implement PR feedback * WIP: implement high level dataset api * WIP: implement TiffMag * implement test for dataset api * refactor high level dataset api * add test data for WKDataset * improve high level dataset api and add more tests * use seed in tests to achieve deterministic behaviour * implement a test for writing out of bounds with a wk_slice * add possibility to define pattern for TiffDatasets * implement tiled tiff * improve quality of dataset tests * make naming schema of test files consistent * implement PR feedback * rename tiffs in testdata * Improve error message and reformat code * add type annotation * rename Slice to View * remove comments and reformat code * add scikit-image (which is needed for skimage) as dependency * update version of scikit-image * fix relative paths in tests * add possibility to get data of specific tile * reformat code * add test for png images * reformat code * make TiledTiffDataset a seperate class * add support for opening datasets which do not have num_channels in properties.json * add test for advanced pattern * use more efficient method to detect tile_ranges * rename file path of test case * support largestSegmentationId in properties * restructure properties * add dataType attribute to properties * implement PR feedback * fix writing data to an unopened dataset and support different orders of the dimensions with patterns * Adjust docstring of method Co-Authored-By: Philipp Otto <[email protected]> * Support tiled tiffs in high level dataset API (#178) * add possibility to define pattern for TiffDatasets * implement tiled tiff * add possibility to get data of specific tile * add test for png images * reformat code * make TiledTiffDataset a seperate class * add support for opening datasets which do not have num_channels in properties.json * add test for advanced pattern * use more efficient method to detect tile_ranges * rename file path of test case * support largestSegmentationId in properties * restructure properties * add dataType attribute to properties * implement PR feedback * fix writing data to an unopened dataset and support different orders of the dimensions with patterns * Adjust docstring of method Co-Authored-By: Philipp Otto <[email protected]> Co-authored-by: Philipp Otto <[email protected]> Co-authored-by: Philipp Otto <[email protected]>
1 parent ba50ab0 commit 42f8227

File tree

18 files changed

+1201
-464
lines changed

18 files changed

+1201
-464
lines changed
16 Bytes
Binary file not shown.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"id" : {
3+
"name" : "ROI2017_wkw",
4+
"team" : "Connectomics department"
5+
},
6+
"dataLayers" : [ {
7+
"name" : "color",
8+
"category" : "color",
9+
"boundingBox" : {
10+
"topLeft" : [ 0, 0, 0 ],
11+
"width" : 1024,
12+
"height" : 1024,
13+
"depth" : 1024
14+
},
15+
"wkwResolutions" : [ {
16+
"resolution" : [1, 1, 1],
17+
"cubeLength" : 1024
18+
}, {
19+
"resolution" : [16, 16, 16],
20+
"cubeLength" : 64
21+
}, {
22+
"resolution" : [2, 2, 2],
23+
"cubeLength" : 512
24+
}, {
25+
"resolution" : [32, 32, 32],
26+
"cubeLength" : 32
27+
}, {
28+
"resolution" : [4, 4, 4],
29+
"cubeLength" : 256
30+
}, {
31+
"resolution" : [8, 8, 8],
32+
"cubeLength" : 128
33+
} ],
34+
"elementClass" : "uint8",
35+
"dataFormat" : "wkw"
36+
}, {
37+
"name" : "segmentation",
38+
"boundingBox" : {
39+
"topLeft" : [ 0, 0, 0 ],
40+
"width" : 1024,
41+
"height" : 1024,
42+
"depth" : 1024
43+
},
44+
"wkwResolutions" : [ {
45+
"resolution" : [1, 1, 1],
46+
"cubeLength" : 1024
47+
}, {
48+
"resolution" : [16, 16, 16],
49+
"cubeLength" : 64
50+
}, {
51+
"resolution" : [2, 2, 2],
52+
"cubeLength" : 512
53+
}, {
54+
"resolution" : [32, 32, 32],
55+
"cubeLength" : 32
56+
}, {
57+
"resolution" : [4, 4, 4],
58+
"cubeLength" : 256
59+
}, {
60+
"resolution" : [8, 8, 8],
61+
"cubeLength" : 128
62+
} ],
63+
"elementClass" : "uint32",
64+
"mappings" : [ "larger5um1", "axons", "astrocyte-ge-7", "astrocyte", "mitochondria", "astrocyte-full" ],
65+
"largestSegmentId" : 1000000000,
66+
"category" : "segmentation",
67+
"dataFormat" : "wkw"
68+
} ],
69+
"scale" : [ 11.239999771118164, 11.239999771118164, 28 ]
70+
}
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"id" : {
3+
"name" : "ROI2017_wkw",
4+
"team" : "Connectomics department"
5+
},
6+
"dataLayers" : [ {
7+
"name" : "color",
8+
"category" : "color",
9+
"boundingBox" : {
10+
"topLeft" : [ 0, 0, 0 ],
11+
"width" : 1024,
12+
"height" : 1024,
13+
"depth" : 1024
14+
},
15+
"wkwResolutions" : [ {
16+
"resolution" : 1,
17+
"cubeLength" : 1024
18+
}, {
19+
"resolution" : 2,
20+
"cubeLength" : 512
21+
}],
22+
"elementClass" : "uint8",
23+
"dataFormat" : "wkw"
24+
}],
25+
"scale" : [ 11.239999771118164, 11.239999771118164, 28 ]
26+
}

testdata/simple_tiff_dataset/datasource-properties.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
"scale": [
77
1
88
],
9+
"pattern": "{zzzzz}.tif",
910
"dataLayers": [
1011
{
1112
"name": "color",
1213
"category": "color",
14+
"dataFormat": "tiff",
1315
"elementClass": "uint8",
1416
"num_channels": 1,
1517
"boundingBox": {
@@ -32,9 +34,5 @@
3234
}
3335
]
3436
}
35-
],
36-
"grid_shape": [
37-
0,
38-
0
3937
]
4038
}

testdata/simple_wk_dataset/datasource-properties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
1,
3131
1
3232
],
33-
"cube_length": 32
33+
"cubeLength": 32
3434
}
3535
]
3636
}
3737
]
38-
}
38+
}

0 commit comments

Comments
 (0)