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

If sample does not have roi, then returns only image

parent 98f7c7ac
No related branches found
No related tags found
1 merge request!353DFV and multiple fixes
...@@ -40,12 +40,17 @@ class File(BioFile): ...@@ -40,12 +40,17 @@ 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)
roi = self.__f.roi()
# calculates the 90 degrees anti-clockwise rotated RoI points if not self.has_roi():
w, h = image.shape return image
roi = [(x,h-y) for (y,x) in roi]
mask = poly_to_mask(image.shape, roi) else:
roi = self.__f.roi()
# 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(mask=mask, roi=roi))
......
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