Skip to content

Commit f6a9f06

Browse files
committed
refactor: move file saving utils to FileHandler
1 parent 3fcb2a3 commit f6a9f06

File tree

10 files changed

+453
-120
lines changed

10 files changed

+453
-120
lines changed

cellseg_models_pytorch/datasets/dataset_writers/_base_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _get_tiles(
8686
"""Read one image and corresponding masks and do tiling on them."""
8787
# im, masks = self._get_arrays()
8888
im = FileHandler.read_img(img_path)
89-
masks = FileHandler.read_mask(mask_path, return_all=True)
89+
masks = FileHandler.read_mat(mask_path, return_all=True)
9090

9191
if pre_proc is not None:
9292
masks = pre_proc(masks)

cellseg_models_pytorch/datasets/folder_dataset_train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def read_img_mask(
136136
"""
137137
out = OrderedDict()
138138
out["image"] = FileHandler.read_img(self.fnames_imgs[ix])
139-
masks = FileHandler.read_mask(self.fnames_masks[ix], return_all=True)
139+
masks = FileHandler.read_mat(self.fnames_masks[ix], return_all=True)
140140

141141
try:
142142
out["inst"] = masks["inst_map"]

cellseg_models_pytorch/postproc/tests/test_postproc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_postproc_dran(inst_map):
115115

116116
def test_postproc_stardist(mask_patch_dir):
117117
mask_path = sorted(mask_patch_dir.glob("*"))[0]
118-
inst_map = FileHandler.read_mask(mask_path)
118+
inst_map = FileHandler.read_mat(mask_path)
119119
stardist = gen_stardist_maps(inst_map, 32)
120120
dist = gen_dist_maps(inst_map)
121121
rebuild = post_proc_stardist(dist, stardist)

0 commit comments

Comments
 (0)