Skip to content

BUG: Fix #734 and extend GTest for GetAxisAlignedBoundingBoxRegion - #732

Merged
dzenanz merged 2 commits into
InsightSoftwareConsortium:masterfrom
N-Dekker:BUG-2D-ImageMaskSpatialObject-GetAxisAlignedBoundingBoxRegion
Apr 16, 2019
Merged

dzenanz merged 2 commits into
InsightSoftwareConsortium:masterfrom
N-Dekker:BUG-2D-ImageMaskSpatialObject-GetAxisAlignedBoundingBoxRegion

Conversation

@N-Dekker

@N-Dekker N-Dekker commented Apr 14, 2019 •

Copy link
Copy Markdown
Contributor

@dzenanz
dzenanz requested review from aylward and hjmjohnson April 15, 2019 15:44
@N-Dekker N-Dekker changed the title WIP: ENH: Extend test ImageMaskSpatialObject::GetAxisAlignedBoundingBoxRegion WIP: BUG: Fix #734 and extend GTest for GetAxisAlignedBoundingBoxRegion Apr 15, 2019

@aylward aylward left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@N-Dekker N-Dekker changed the title WIP: BUG: Fix #734 and extend GTest for GetAxisAlignedBoundingBoxRegion BUG: Fix #734 and extend GTest for GetAxisAlignedBoundingBoxRegion Apr 15, 2019
Fixed both bugs in `ImageMaskSpatialObject::GetAxisAlignedBoundingBoxRegion()`
that are reported by issue #734 ("Incorrect results
GetAxisAlignedBoundingBoxRegion() for 2D"):

1. When the image is entirely black (all zero's). In this case, a bounding box
region size of zero is expected, but instead, the returned region appeared to
have a very large size!

2. When the (N-dimensional) index of the requested region of the image has
non-zero coordinates. In this case, the size of the returned bounding box region
was also incorrect, because the function did not correctly take the image region
index into account.
Extend the GoogleTest from the legacy `ImageMaskSpatialObject` member function
`GetAxisAlignedBoundingBoxRegion`, now doing each test for both 2D and 3D, with
both a minimal and a slightly less trivial image region.
@N-Dekker

Copy link
Copy Markdown
Contributor Author

Thanks for your approval, @aylward and @dzenanz !

For your information, my last force-push only just reordered to two commits, to avoid a possible test failure on the master branch. (The GTest enhancement is now the last commit, instead of the first.) I think this pull request is ready now.

@dzenanz
dzenanz merged commit 2e23f71 into InsightSoftwareConsortium:master Apr 16, 2019
@N-Dekker
N-Dekker deleted the BUG-2D-ImageMaskSpatialObject-GetAxisAlignedBoundingBoxRegion branch May 5, 2019 10:26
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request May 6, 2026
…-ImageMaskSpatialObject-GetAxisAlignedBoundingBoxRegion

BUG: Fix InsightSoftwareConsortium#734 and extend GTest for GetAxisAlignedBoundingBoxRegion
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request May 12, 2026
…-ImageMaskSpatialObject-GetAxisAlignedBoundingBoxRegion

BUG: Fix InsightSoftwareConsortium#734 and extend GTest for GetAxisAlignedBoundingBoxRegion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect results GetAxisAlignedBoundingBoxRegion() for 2D

3 participants