From f3e6d90a4d09fa5810f3df11e5d3459b286641ee Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Wed, 11 Aug 2021 18:39:31 +0200 Subject: [PATCH] segmenter:retrieve initial size data from metadata.json --- scripts/planktoscope/segmenter/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/planktoscope/segmenter/__init__.py b/scripts/planktoscope/segmenter/__init__.py index cabd452..c3b2700 100644 --- a/scripts/planktoscope/segmenter/__init__.py +++ b/scripts/planktoscope/segmenter/__init__.py @@ -456,10 +456,10 @@ class SegmenterProcess(multiprocessing.Process): dim_slice = tuple(dim_slice) return dim_slice - # TODO retrieve here all those from the global metadata - minESD = 40 # microns + minMesh = self.__global_metadata.get("acq_minimum_mesh", 20) # microns + minESD = minMesh * 2 minArea = math.pi * (minESD / 2) * (minESD / 2) - pixel_size = 1.01 # to be retrieved from metadata + pixel_size = self.__global_metadata.get("process_pixels", 1.0) # minsizepix = minArea / pixel_size / pixel_size minsizepix = (minESD / pixel_size) ** 2