Search in sources :

Example 1 with LazyVirtualStack

use of ini.trakem2.imaging.LazyVirtualStack in project TrakEM2 by trakem2.

the class Loader method createLazyFlyThrough.

/**
 * Each slice is generated on demand, one slice per Region instance.
 */
public <I> ImagePlus createLazyFlyThrough(final List<? extends Region<I>> regions, final double magnification, final int type, final Displayable active) {
    final Region<I> first = regions.get(0);
    final int w = (int) (first.r.width * magnification), h = (int) (first.r.height * magnification);
    final LazyVirtualStack stack = new LazyVirtualStack(w, h, regions.size());
    for (final Region<I> r : regions) {
        stack.addSlice(new Callable<ImageProcessor>() {

            @Override
            public ImageProcessor call() {
                return getFlatImage(r.layer, r.r, magnification, 0xffffffff, type, Displayable.class, null, true, Color.black, active).getProcessor();
            }
        });
    }
    return new ImagePlus("Fly-Through", stack);
}
Also used : ImageProcessor(ij.process.ImageProcessor) LazyVirtualStack(ini.trakem2.imaging.LazyVirtualStack) ImagePlus(ij.ImagePlus)

Aggregations

ImagePlus (ij.ImagePlus)1 ImageProcessor (ij.process.ImageProcessor)1 LazyVirtualStack (ini.trakem2.imaging.LazyVirtualStack)1