-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialize_mobie.py
50 lines (38 loc) · 1.32 KB
/
initialize_mobie.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
import argparse
import mobie
# TODO initialize the dataset from the knossos file
def initialize_mobie():
pass
# TODO replace with the actual code to generate the mask
def add_mask():
mask_path = '../pape/lgn/data.n5'
mask_key = 'mask/s6'
mask_name = 'sbem-adult-1-lgn-mask'
# the mask is downscaled by factors:
mask_scale_factor = [0.04, 0.01, 0.01]
raw_resolution = [8, 32, 32]
resolution = [factor * res for factor, res in zip(mask_scale_factor, raw_resolution)]
print()
print("Resolution", resolution)
print()
scale_factors = 3 * [[2, 2, 2]]
chunks = [64, 64, 64]
mobie.add_mask(mask_path, mask_key,
root='./data', dataset_name='0.0.0', mask_name=mask_name,
resolution=resolution, scale_factors=scale_factors, chunks=chunks,
target='local', max_jobs=12)
# TODO
def add_traces():
pass
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--initialize', type=int, default=0)
parser.add_argument('--add_mask', type=int, default=0)
parser.add_argument('--add_traces', type=int, default=0)
args = parser.parse_args()
if bool(args.initialize):
initialize_mobie()
if bool(args.add_mask):
add_mask()
if bool(args.add_traces):
add_traces()