Skip to content

Commit

Permalink
maint: simplify boundingbox.corners
Browse files Browse the repository at this point in the history
credit: @xgui3783
  • Loading branch information
AhmetNSimsek committed Oct 11, 2024
1 parent be1f13f commit f2ba788
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions siibra/locations/boundingbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ..commons import logger
from ..exceptions import SpaceWarpingFailedError, ZeroVolumeBoundingBox

from itertools import product
import hashlib
import numpy as np
from typing import TYPE_CHECKING, Union
Expand Down Expand Up @@ -271,20 +272,9 @@ def corners(self):
TODO: deal with sigma. Currently, returns the mean of min and max point.
"""
x0, y0, z0 = self.minpoint
x1, y1, z1 = self.maxpoint
all_corners = [
(x0, y0, z0),
(x1, y0, z0),
(x0, y1, z0),
(x1, y1, z0),
(x0, y0, z1),
(x1, y0, z1),
(x0, y1, z1),
(x1, y1, z1)
]
xs, ys, zs = zip(self.minpoint, self.maxpoint)
return pointset.PointSet(
all_corners,
coordinates=[[x, y, z] for x, y, z in product(xs, ys, zs)],
space=self.space,
sigma_mm=np.mean([self.minpoint.sigma, self.maxpoint.sigma])
)
Expand Down

0 comments on commit f2ba788

Please sign in to comment.