From b3f99ee1231424f1bd6d0bd41337f6accb15e0a5 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 15 Oct 2017 11:42:12 -0700 Subject: [PATCH] abs when thresholding raster for manhattanization --- masque/shapes/shape.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masque/shapes/shape.py b/masque/shapes/shape.py index 02124d6..b795ba2 100644 --- a/masque/shapes/shape.py +++ b/masque/shapes/shape.py @@ -249,7 +249,7 @@ class Shape(metaclass=ABCMeta): numpy.where(keep_y)[0][0]) rastered = float_raster.raster((polygon.vertices + polygon.offset).T, gx, gy) - binary_rastered = (rastered >= 0.5) + binary_rastered = (numpy.abs(rastered) >= 0.5) supersampled = binary_rastered.repeat(2, axis=0).repeat(2, axis=1) contours = skimage.measure.find_contours(supersampled, 0.5)