Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix issue #1950, ImageMaskSpatialObject access outside image buffer
Fixed issue #1950, "ImageMaskSpatialObject tries to access pixels outside the image buffer (segfault)". In the original code, `TransformPhysicalPointToContinuousIndex` did estimate whether the specified point was inside the image buffer, but then `GetInterpolator()->EvaluateAtContinuousIndex(index)` did in some cases still try to access a pixel outside the image buffer. This fix avoids using an interpolator. It only accesses a pixel when its index is inside the buffered region. The use of an interpolator appears less relevant for an image mask than for other spatial objects, as for each mask pixel value, it is usually only interesting to know whether it is zero or non-zero. Added ImageMaskSpatialObject.CornerPointIsNotInsideMaskOfZeroValues unit test.
- Loading branch information