From 133e0ec10157f8c0d1056f07b19419d2ef0b9372 Mon Sep 17 00:00:00 2001 From: Matt Hancock Date: Wed, 1 Aug 2018 20:56:25 -0500 Subject: [PATCH] Fix exclusion contour strategy in boolean mask --- pylidc/Annotation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pylidc/Annotation.py b/pylidc/Annotation.py index 53aca33..dda0b87 100644 --- a/pylidc/Annotation.py +++ b/pylidc/Annotation.py @@ -1061,6 +1061,11 @@ def boolean_mask(self, pad=None, bbox=None, include_contour_points=False): not_contains_pts = not_contains_pts.reshape(mask.shape[:2]) mask[:,:,zi] = np.logical_and(mask[:,:,zi], not_contains_pts) + # Remove the contour points themselves. + i, j = (C - bb[:2,0]).T + k = np.ones(C.shape[0], dtype=np.int)*zi + mask[i,j,k] = False + return mask def _as_set(self):