From 7151c41c0a4c02e9b43a863838364b5b0f708d12 Mon Sep 17 00:00:00 2001 From: Andrew Janowczyk Date: Mon, 22 Mar 2021 21:02:52 +0100 Subject: [PATCH] Bumping dependencies in requirements.txt to latest versions, and modifying MorphologyModule.py to compensate for lack of backward compatibility in scikit-image remove_small_holes --- MorphologyModule.py | 6 +++--- requirements.txt | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MorphologyModule.py b/MorphologyModule.py index cb1e02c..5221094 100644 --- a/MorphologyModule.py +++ b/MorphologyModule.py @@ -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) @@ -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)) diff --git a/requirements.txt b/requirements.txt index 24c63c5..e4e47f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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