Skip to content

Commit cb36920

Browse files
committed
Refactor computeROI to aggregateROI
1 parent c4686dc commit cb36920

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .store import LazyImagesGeoPandas, computeROI
1+
from .store import LazyImagesGeoPandas, aggregateROI
22
from .loader import ImageLoader
33
from .image_slices import ImageSlice
44
from .metadata import Metadata, VoxelMetadata, MetadataPhysicalSize

mapmanagercore/lazy_geo_pd_images/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def getShapePixels(self, shapes: gp.GeoDataFrame, channel: Union[int, List[int]]
175175
return self._images.getShapePixels(shapes, channel=channel, zSpread=zSpread, time=time, z=z)
176176

177177

178-
def computeROI(dependencies: Union[List[str], dict[str, list[str]]] = {}, aggregate: list[str] = [], **attributes: Unpack[ImageColumnAttributes]):
178+
def aggregateROI(dependencies: Union[List[str], dict[str, list[str]]] = {}, aggregate: list[str] = [], **attributes: Unpack[ImageColumnAttributes]):
179179
"""A decorator that adds image based computed column to the schema.
180180
181181
Args:

mapmanagercore/schemas/spine.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
from shapely.geometry import Point
21
import numpy as np
32
from mapmanagercore.benchmark import timer
43
from mapmanagercore.utils import union
54
from ..layers.line import calcSubLine, extend, getSpineSide, getSpineAngle
65
import shapely
76
from ..lazy_geo_pandas import schema, compute, LazyGeoFrame
87
import geopandas as gp
9-
from shapely.geometry import LineString, MultiPolygon, Polygon
10-
from ..lazy_geo_pd_images import computeROI
11-
8+
from shapely.geometry import LineString, MultiPolygon, Polygon, Point
9+
from ..lazy_geo_pd_images import aggregateROI
1210

1311
@schema(
1412
index=["spineID", "t"],
@@ -250,12 +248,12 @@ def roiBg(frame: LazyGeoFrame) -> gp.GeoSeries:
250248

251249
# Image based ROI computed stats
252250

253-
@computeROI(title="Roi", dependencies=["roi", "z"], aggregate=['sum', 'max'], group="ROI")
251+
@aggregateROI(title="Roi", dependencies=["roi", "z"], aggregate=['sum', 'max'], group="ROI")
254252
@timer
255253
def roiStats(frame: LazyGeoFrame):
256254
return frame[["roi", "z"]]
257255

258-
@computeROI(title="Background Roi", dependencies=["roiBg", "z"], aggregate=['sum', 'max'], group="ROI Background")
256+
@aggregateROI(title="Background Roi", dependencies=["roiBg", "z"], aggregate=['sum', 'max'], group="ROI Background")
259257
@timer
260258
def roiStatsBg(frame: LazyGeoFrame):
261259
return frame[["roiBg", "z"]]

0 commit comments

Comments
 (0)