diff options
-rw-r--r-- | src/argaze/AreaOfInterest/AOIFeatures.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/argaze/AreaOfInterest/AOIFeatures.py b/src/argaze/AreaOfInterest/AOIFeatures.py index debf1fa..dfbb165 100644 --- a/src/argaze/AreaOfInterest/AOIFeatures.py +++ b/src/argaze/AreaOfInterest/AOIFeatures.py @@ -51,24 +51,26 @@ class AreaOfInterest(numpy.ndarray): working_directory: folder path where to load files when a dictionary value is a relative filepath. """ - shape = aoi_data.pop('shape') + # Get first and unique shape + # TODO: allow multiple shapes to describe more complex AOI + shape, shape_data = aoi_data.popitem() - if shape == 'rectangle': + if shape == 'Rectangle': - x = aoi_data.pop('x') - y = aoi_data.pop('y') - width = aoi_data.pop('width') - height = aoi_data.pop('height') + x = shape_data.pop('x') + y = shape_data.pop('y') + width = shape_data.pop('width') + height = shape_data.pop('height') points = [[x, y], [x+width, y], [x+width, y+height], [x, y+height]] return AreaOfInterest(points) - elif shape == 'circle': + elif shape == 'Circle': - cx = aoi_data.pop('cx') - cy = aoi_data.pop('cy') - radius = aoi_data.pop('radius') + cx = shape_data.pop('cx') + cy = shape_data.pop('cy') + radius = shape_data.pop('radius') # TODO: Use pygeos N = 32 @@ -462,7 +464,7 @@ class AOIScene(): @property def dimension(self) -> int: - """Dimension of the AOIs in scene.""" + """Dimension of the AOI in scene.""" return self.__dimension |