From 5ae8bc0a8a7473e3c1be0b6d43684b83491add92 Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Tue, 7 May 2024 16:52:34 +0100 Subject: [PATCH] Fix bug in manual segmentation Fix bug that labels the edge of manually segmented regions as different labels to the main body. --- particlespy/particle_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/particlespy/particle_analysis.py b/particlespy/particle_analysis.py index d820752..2010289 100644 --- a/particlespy/particle_analysis.py +++ b/particlespy/particle_analysis.py @@ -55,7 +55,7 @@ def particle_analysis(acquisition,parameters,particles=None,mask=np.zeros((1))): image = acquisition if str(mask) == 'UI': - labeled = label(np.load(os.path.dirname(inspect.getfile(process))+'/parameters/manual_mask.npy')[:,:,0]) + labeled = label(np.load(os.path.dirname(inspect.getfile(process))+'/parameters/manual_mask.npy')[:,:,0]>0) print(len(labeled)) #plt.imshow(labeled) #morphology.remove_small_objects(labeled,30,in_place=True)