Skip to content
Snippets Groups Projects
Commit 2274b531 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Don't need to do poly_to_mask() anymore

parent 8ef7a589
No related branches found
No related tags found
1 merge request!353DFV and multiple fixes
...@@ -41,7 +41,7 @@ class File(BioFile): ...@@ -41,7 +41,7 @@ class File(BioFile):
image = super(File, self).load(*args, **kwargs) image = super(File, self).load(*args, **kwargs)
image = numpy.rot90(image, 3) image = numpy.rot90(image, 3)
if not self.has_roi(): if not self.__f.has_roi():
return image return image
else: else:
...@@ -50,9 +50,8 @@ class File(BioFile): ...@@ -50,9 +50,8 @@ class File(BioFile):
# calculates the 90 degrees anti-clockwise rotated RoI points # calculates the 90 degrees anti-clockwise rotated RoI points
w, h = image.shape w, h = image.shape
roi = [(x,h-y) for (y,x) in roi] 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): class Database(BioDatabase):
......
...@@ -32,8 +32,7 @@ class File(BioFile): ...@@ -32,8 +32,7 @@ class File(BioFile):
image = super(File, self).load(*args, **kwargs) image = super(File, self).load(*args, **kwargs)
roi = self.__f.roi() roi = self.__f.roi()
mask = poly_to_mask(image.shape, roi) return AnnotatedArray(image, metadata=dict(roi=roi))
return AnnotatedArray(image, metadata=dict(mask=mask, roi=roi))
class Database(BioDatabase): class Database(BioDatabase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment