-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_tables.py
More file actions
48 lines (42 loc) · 1.24 KB
/
fix_tables.py
File metadata and controls
48 lines (42 loc) · 1.24 KB
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
import os
from glob import glob
from mobie.htm.data_import import _add_tables
def fix_cell_tables():
ds_folder = "./data/20200406_164555_328"
seg_paths = glob(os.path.join(ds_folder, "images", "ome-zarr", "cell_segmentation*"))
seg_paths.sort()
seg_names = [
os.path.split(path)[1].rstrip(".ome.zarr") for path in seg_paths
]
res = (1.0, 1.0)
_add_tables(
file_format="ome.zarr",
paths=seg_paths,
segmentation_names=seg_names,
resolution=res,
ds_folder=ds_folder,
tmp_folder="./tmp_fix_tables",
target="local",
max_jobs=24
)
def fix_nucleus_tables():
ds_folder = "./data/20200406_164555_328"
seg_paths = glob(os.path.join(ds_folder, "images", "ome-zarr", "nucleus_segmentation*"))
seg_paths.sort()
seg_names = [
os.path.split(path)[1].rstrip(".ome.zarr") for path in seg_paths
]
res = (1.0, 1.0)
_add_tables(
file_format="ome.zarr",
paths=seg_paths,
segmentation_names=seg_names,
resolution=res,
ds_folder=ds_folder,
tmp_folder="./tmp_fix_tables_nuclei",
target="local",
max_jobs=24
)
if __name__ == "__main__":
fix_cell_tables()
fix_nucleus_tables()