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

Add IterableLoopBuilder #310

Merged
merged 1 commit into from
Feb 24, 2022
Merged

Add IterableLoopBuilder #310

merged 1 commit into from
Feb 24, 2022

Conversation

maarzt
Copy link
Contributor

@maarzt maarzt commented Nov 4, 2021

It is similar to LoopBuilder but works with IterableInterval and RandomAccessible.

This should allow to simplify a lot of code in imglib2-algorithm as done in imglib/imglib2-algorithm#83.

IterableInterval<DoubleType> sum = ...
RandomAccessible<DoubleType> imageA = ...
RandomAccessible<DoubleType> imageB = ...
IterableLoopBuilder.setImages(sum, imageA, imageB).forEachPixel(
    (s, a, b) -> {
         s.setReal(a.getRealDouble() + b.getRealDouble());
    }
);

It is similar to LoopBuilder but works with IterableInterval and
RandomAccessible.

IterableLoopBuilder should allow to simplify a lot of existing code.
maarzt added a commit to imglib/imglib2-algorithm that referenced this pull request Nov 10, 2021
@tpietzsch tpietzsch merged commit 540eae5 into master Feb 24, 2022
@tpietzsch tpietzsch deleted the iterable-loop-builder branch February 24, 2022 09:55
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.

2 participants