Skip to content

Commit

Permalink
Bumping dependencies in requirements.txt to latest versions, and modi…
Browse files Browse the repository at this point in the history
…fying MorphologyModule.py to compensate for lack of backward compatibility in scikit-image remove_small_holes
  • Loading branch information
choosehappy committed Mar 22, 2021
1 parent 7c130fe commit 7151c41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions MorphologyModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def removeFatlikeTissue(s, params):
kernel_size = int(params.get("kernel_size", 3))
max_keep_size = int(params.get("max_keep_size", 1000))

img_reduced = morphology.remove_small_holes(s["img_mask_use"], min_size=fat_cell_size)
img_reduced = morphology.remove_small_holes(s["img_mask_use"], area_threshold=fat_cell_size)
img_small = img_reduced & np.invert(s["img_mask_use"])
img_small = ~morphology.remove_small_holes(~img_small, min_size=9)
img_small = ~morphology.remove_small_holes(~img_small, area_threshold=9)

mask_dilate = morphology.dilation(img_small, selem=np.ones((kernel_size, kernel_size)))
mask_dilate_removed = remove_large_objects(mask_dilate, max_keep_size)
Expand All @@ -82,7 +82,7 @@ def removeFatlikeTissue(s, params):
def fillSmallHoles(s, params):
logging.info(f"{s['filename']} - \tfillSmallHoles")
min_size = int(params.get("min_size", 64))
img_reduced = morphology.remove_small_holes(s["img_mask_use"], min_size=min_size)
img_reduced = morphology.remove_small_holes(s["img_mask_use"], area_threshold=min_size)
img_small = img_reduced & np.invert(s["img_mask_use"])

io.imsave(s["outdir"] + os.sep + s["filename"] + "_small_fill.png", img_as_ubyte(img_small))
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openslide-python==1.1.1
scikit-image==0.15.0
scikit-learn==0.21.3
numpy==1.17.4
scipy==1.3.2
matplotlib==3.1.2
openslide-python==1.1.2
scikit-image==0.18.1
scikit-learn==0.24.1
numpy==1.20.1
scipy==1.6.1
matplotlib==3.3.4

0 comments on commit 7151c41

Please sign in to comment.