Skip to content

Commit

Permalink
Fix exclusion contour strategy in boolean mask
Browse files Browse the repository at this point in the history
  • Loading branch information
notmatthancock committed Aug 2, 2018
1 parent 0654e9f commit 133e0ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pylidc/Annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 133e0ec

Please sign in to comment.