There is really no reason that RandomAccessibleInterval should not be Iterable.
We already can make any RAI iterable using Views.iterable().
With default implementations of IterableInterval in RandomAccessibleInterval, there is no overhead for implementers of RandomAccessibleInterval (unless they want to support more efficient, specialized cursors).
Consequences:
Views.iterable() is @Deprecated because one can call cursor() on RAI directly.
Views.flatIterable() now returns RandomAccessibleInterval "officially".
I fixed one new bug that was introduced by this:
void doSomething(IterableInterval<T> ii)
{
...
}
void doSomething(RandomAccessibleInterval<T> rai)
{
doSomething(Views.flatIterable(ii)); // This becomes a circular recursion now
}
Probably there will be a few more bugs of this form. But I think the added convenience of returning RAI from Views.flatIterable() is worth it.
There is really no reason that
RandomAccessibleInterval
should not beIterable
. We already can make any RAI iterable usingViews.iterable()
. Withdefault
implementations ofIterableInterval
inRandomAccessibleInterval
, there is no overhead for implementers ofRandomAccessibleInterval
(unless they want to support more efficient, specialized cursors).Consequences:
Views.iterable()
is@Deprecated
because one can callcursor()
on RAI directly.Views.flatIterable()
now returnsRandomAccessibleInterval
"officially".I fixed one new bug that was introduced by this:
Probably there will be a few more bugs of this form. But I think the added convenience of returning RAI from
Views.flatIterable()
is worth it.