Open dietzc opened 9 years ago
This one I don't understand after your recent explanation @tpietzsch. See comment.
@Test
public void testExtendedConvertedImg() {
RandomAccessibleInterval<BitType> input = Converters.convert(
(RandomAccessibleInterval<ByteType>) ArrayImgs.bytes(100, 100),
new Converter<ByteType, BitType>() {
@Override
public void convert(ByteType input, BitType output) {
output.setReal(input.get());
}
}, new BitType());
IntervalView<BitType> extendBorder = Views.interval(
Views.extendBorder(input), input);
/**
* I don't understand the API here. if this doesn't work in the 3 lines
* below, why does it work in the neighborhood case?
*/
RandomAccess<BitType> randomAccess = extendBorder.randomAccess();
randomAccess.setPosition(new long[] { -10, -10 });
randomAccess.get().get();
Shape rectangle = new RectangleShape(5, false);
for (Neighborhood<BitType> n : rectangle.neighborhoods(extendBorder)) {
for (BitType type : n) {
type.get();
}
}
}
Is this still relevant? Sounds more like a problem of unsynchronized expectations and outcomes than a bug?
See below. If this is a bug, the desired behaviour would be, that the converter isn't called on out of bounds values in this situation (as our out-of-bounds strategy defines the value in this case).