Class LoopBuilder<T>


  • public class LoopBuilder<T>
    extends java.lang.Object
    LoopBuilder provides an easy way to write fast loops on RandomAccessibleIntervals. For example, this is a loop that calculates the sum of two images:

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

    The RandomAccessibleIntervals imageA, imageB and sum must have equal dimensions, but the bounds of there Intervals can differ.