Skip to content

Conversation

@N-Dekker
Copy link
Contributor

@N-Dekker N-Dekker commented Apr 21, 2019

Fixed issue #785 (ImageMaskSpatialObject IsInside should not depend on
distant pixels) by removing the BoundingBox check from
ImageMask::IsInsideInObjectSpace

Added various GTest unit tests for ImageMaskSpatialObject::IsInside

@N-Dekker
Copy link
Contributor Author

N-Dekker added 2 commits May 5, 2019 13:05
Added tests for a single zero-valued pixel, and a single non-zero-valued pixel.
Tests if `ImageMaskSpatialObject::IsInside(point)` is independent of the value
of distant pixels.
@N-Dekker N-Dekker changed the title WIP: ENH: Added tests for ImageMaskSpatialObject::IsInside BUG: Fix issue #785 removing BoundingBox check from ImageMask IsInside May 5, 2019
Fixed issue #785 (ImageMaskSpatialObject IsInside should not depend on
distant pixels) by removing the BoundingBox check from
`ImageMask::IsInsideInObjectSpace`.

It appears that the computed bounding box is too small to recognize
all points whose interpolated pixel value is non-zero as being inside.

The run-time duration might become either slightly longer or slightly
shorter, depending on the image. In practice, the performance effect
of this commit appears very small (in either way).
@hjmjohnson hjmjohnson requested a review from aylward May 6, 2019 12:33
Copy link
Member

@aylward aylward left a comment

Choose a reason for hiding this comment

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

Interesting - never though about skipping the bounding box check for mask images and going straight to pixel-level checking. Seems fine to me for this kind of object. Go for it!

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.

3 participants