Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled view #309

Merged
merged 4 commits into from
Feb 24, 2022
Merged

Tiled view #309

merged 4 commits into from
Feb 24, 2022

Conversation

tpietzsch
Copy link
Member

This is another attempt at (part of) #179 (#306).

It adds Views.tile(...) method to split a RAI into tiles, with the result represented as RAI<RAI>.

Used along these lines:

RandomAccessibleInterval<T> img;
Iterable<RandomAccessibleInterval<T>> tiles = Views.iterable( Views.tiles( img, 32, 32 ) );
tiles.forEach( tile -> op( tile ) );

This is implemented as

  • a new class Grid (which is similar to CellGrid, but a bit more general) that splits a interval into regular grid cells, which can be accessed as RandomAccessibleInterval<Interval>,
  • Views.intervals(RA<T>, RAI<Interval>) which takes such a RAI<Interval and splits a RA<T> accordingly.

These parts are hopefully independently useful. For example Views.intervals(RA<T>, RAI<Interval>) can also be used to implement tiling with overlap, etc...

This is similar to CellGrid but all coordinates are long[] and an
additional offset can be specified, so that cells at the min border are
truncated.
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.

1 participant