imglib / imglib2-roi

Regions of interest (ROIs) and labelings for ImgLib2
Other
8 stars 8 forks source link

Split IterableRegion #70

Closed tpietzsch closed 3 months ago

tpietzsch commented 4 months ago

Currently, IterableRegion implements both RandomAccessibleInterval<BooleanType> and IterableInterval<Void>.

The idea is that if you have a RandomAccess, it will be true inside the region, and false outside. When you iterate you only want to visit the inside pixels (where the RA would be true). Therefore IterableInterval<Void>, not BooleanType.

It seemed at one point neat (albeit confusing) to implement this by inheriting Accessibles of different Type. With https://github.com/imglib/imglib2/pull/312 this will no longer be possible. IterableRegion.getType() cannot return both Void and BooleanType.

Therefore, the "inside IterableInterval" should become a separate thing. maybe by adding a method IterableInterval<Void> inside().