FZJ-INM1-BDA / siibra-python

Software interfaces for interacting with brain atlases - Python client
Apache License 2.0
48 stars 10 forks source link

Fix boundingbox transformation #591

Open dickscheid opened 5 months ago

dickscheid commented 5 months ago

siibra had a serious bug when transforming bounding boxes: Both .warp and .transform would create the new bounding box by just transforming the min- and max point. But since the bounding box is axis aligned, this is not correct - other corner points could form the new min- or maxpoint in the new coordinate system after warping. Therefore, all corner points (8 in general) need to be transformed, and a new min- and maxpoint have to be determined in the target space to create the transformed bounding box.

AhmetNSimsek commented 4 months ago

The image feature e2e tests are failing because some warped corners of a bounding box can return None which causes the warping to create a bbox with (nan, nan, nan) points and such a bbox has no intersection with any well-defined bbox. I'll see how I can circumvent the issue.