From fecec0d4743da98092ee9bf4fdde30586038eca7 Mon Sep 17 00:00:00 2001 From: Markus Ankenbrand Date: Tue, 14 Nov 2023 18:56:00 +0100 Subject: [PATCH 1/3] Add min_distance parameter to peak_local_max call otherwise multiple local maxima are returned even within the distance if their values are identical. This lead to lots of over-segmentation. In particular, multiple perfectly contigous nuclei were split in half. Related #2006 --- starfish/core/morphology/Filter/min_distance_label.py | 1 + 1 file changed, 1 insertion(+) diff --git a/starfish/core/morphology/Filter/min_distance_label.py b/starfish/core/morphology/Filter/min_distance_label.py index 29f52e695..95ec9fb23 100644 --- a/starfish/core/morphology/Filter/min_distance_label.py +++ b/starfish/core/morphology/Filter/min_distance_label.py @@ -63,6 +63,7 @@ def run( exclude_border=self._exclude_border, footprint=footprint, labels=np.asarray(mask), + min_distance=self._minimum_distance_xy, ) local_maximum_mask = np.zeros_like(distance, dtype=bool) local_maximum_mask[tuple(local_maximum.T)] = True From b61b62e090066cdef666436b5c8de65871941e62 Mon Sep 17 00:00:00 2001 From: Markus Ankenbrand Date: Thu, 23 Nov 2023 12:41:51 +0100 Subject: [PATCH 2/3] Fix iss test adjust assumption on number of detected cells --- starfish/test/full_pipelines/api/test_iss_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/starfish/test/full_pipelines/api/test_iss_api.py b/starfish/test/full_pipelines/api/test_iss_api.py index 52cdeef75..601652246 100644 --- a/starfish/test/full_pipelines/api/test_iss_api.py +++ b/starfish/test/full_pipelines/api/test_iss_api.py @@ -105,8 +105,8 @@ def test_iss_pipeline_cropped_data(tmpdir): masks = iss.masks - # segmentation identifies only one cell - assert len(iss.watershed_markers) == 6 + # segmentation identifies four cells + assert len(iss.watershed_markers) == 4 # assign targets lab = AssignTargets.Label() @@ -143,4 +143,4 @@ def test_iss_pipeline_cropped_data(tmpdir): # test that nans were properly removed from the expression matrix assert 'nan' not in expression_matrix.genes.data # test the number of spots that did not decode per cell - assert np.array_equal(expression_matrix.number_of_undecoded_spots.data, [13, 1, 0, 36]) + assert np.array_equal(expression_matrix.number_of_undecoded_spots.data, [13, 1, 36]) From 947472f79ca5206bc9075c7bb45bb28425b3f105 Mon Sep 17 00:00:00 2001 From: Markus Ankenbrand Date: Thu, 23 Nov 2023 14:02:15 +0100 Subject: [PATCH 3/3] Fix docker build the docker build was failing, because botocore needs urllib3 to be in a certain version range. Pinning urllib3 to that range fixes the issue. --- REQUIREMENTS.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/REQUIREMENTS.txt b/REQUIREMENTS.txt index e645accc3..25bbdf926 100644 --- a/REQUIREMENTS.txt +++ b/REQUIREMENTS.txt @@ -22,8 +22,9 @@ scipy showit >= 1.1.4 slicedimage==4.1.1 sympy ~= 1.5.0 +urllib3 <1.27, >=1.25.4 tqdm trackpy validators xarray >= 0.14.1 -ipywidgets \ No newline at end of file +ipywidgets