-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwk.py
68 lines (52 loc) · 2.5 KB
/
wk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# %%
import webknossos as wk
import sys
# %%
from webknossos.dataset.properties import (
DatasetViewConfiguration,
LayerViewConfiguration,
)
# %%
#dataset = wk.Dataset.from_images(input_path="cutouts/dcvsyn1_source",
# output_path="cutouts/dcvsyn1wk",
# voxel_size=(4,4,40),
# name="img")
def main() -> None:
args = sys.argv[1:]
syn = args[0]
wk_filepath = "/home/tmn7/wkw-test/wkw2/binaryData/harvard-htem/"
dataset = wk.Dataset.from_images(input_path="cutouts/" + syn + "/img",
output_path=wk_filepath + syn,
voxel_size=(4,4,40),
name=syn)
#dataset = wk.Dataset("cutouts/dcvsyn1",
# voxel_size=(4,4,40))
dataset.layers['vol.tiff'].name = "img"
dataset_pre = wk.Dataset.from_images(input_path="cutouts/" + syn + "/presyn",
output_path=wk_filepath + syn,
voxel_size=(4,4,40),
name=syn)
dataset_pre.layers['presyn.tiff'].default_view_configuration = LayerViewConfiguration(color=(184, 66, 66), alpha=15)
dataset_pre.layers['presyn.tiff'].name = "presyn"
dataset_post = wk.Dataset.from_images(input_path="cutouts/" + syn + "/postsyn",
output_path=wk_filepath + syn,
voxel_size=(4,4,40),
name=syn)
dataset_post.layers['postsyn.tiff'].default_view_configuration = LayerViewConfiguration(color=(57, 81, 137), alpha=20)
dataset_post.layers['postsyn.tiff'].name = "postsyn"
# %%
#img_layer = dataset.add_layer_from_images(images="cutouts/dcvsyn1_source",
# layer_name="img", dtype='uint8', channel=0)
# %%
#pre_layer = dataset.add_layer_from_images(images="cutouts/dcvsyn1_presyn",
# layer_name="presyn", dtype='uint8', channel=1)
#post_layer = dataset.add_layer_from_images(images="cutouts/dcvsyn1_postsyn",
# layer_name="postsyn", dtype='uint8', channel=0)
# %%
#pre_layer.default_view_configuration = LayerViewConfiguration(
# color=(184, 66, 66), alpha=20)
#post_layer.default_view_configuration = LayerViewConfiguration(
# color=(57, 81, 137), alpha=20)
# %%
if __name__ == "__main__":
main()