Commit 2274b531 authored by André Anjos's avatar André Anjos 💬

Don't need to do poly_to_mask() anymore

parent 8ef7a589
......@@ -41,7 +41,7 @@ class File(BioFile):
image = super(File, self).load(*args, **kwargs)
image = numpy.rot90(image, 3)
if not self.has_roi():
if not self.__f.has_roi():
return image
else:
......@@ -50,9 +50,8 @@ class File(BioFile):
# calculates the 90 degrees anti-clockwise rotated RoI points
w, h = image.shape
roi = [(x,h-y) for (y,x) in roi]
mask = poly_to_mask(image.shape, roi)
return AnnotatedArray(image, metadata=dict(mask=mask, roi=roi))
return AnnotatedArray(image, metadata=dict(roi=roi))
class Database(BioDatabase):
......
......@@ -32,8 +32,7 @@ class File(BioFile):
image = super(File, self).load(*args, **kwargs)
roi = self.__f.roi()
mask = poly_to_mask(image.shape, roi)
return AnnotatedArray(image, metadata=dict(mask=mask, roi=roi))
return AnnotatedArray(image, metadata=dict(roi=roi))
class Database(BioDatabase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment