Class Lazy

java.lang.Object
sc.fiji.snt.filter.Lazy

public class Lazy extends Object
Static helpers for creating lazy filtered images

This Class is a direct port of code written by the Saalfeld lab at Janelia Research Campus, original source at https://github.com/saalfeldlab/hot-knife

Author:
Cameron Arshadi
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends net.imglib2.type.NativeType<T>>
    net.imglib2.cache.img.CachedCellImg<T,?>
    createImg(net.imglib2.Interval targetInterval, int[] blockSize, T type, net.imglib2.cache.img.CellLoader<T> loader)
     
    static <T extends net.imglib2.type.NativeType<T>>
    net.imglib2.cache.img.CachedCellImg<T,?>
    createImg(net.imglib2.Interval targetInterval, int[] blockSize, T type, net.imglib2.cache.img.CellLoader<T> loader, Path cacheDir)
    As createImg(Interval, int[], NativeType, CellLoader), but the disk cache is created directly under cacheDir rather than SNT's shared SNTUtils.getCacheDir().
    static <T extends net.imglib2.type.NativeType<T>>
    net.imglib2.cache.img.CachedCellImg<T,?>
    process(net.imglib2.Interval targetInterval, int[] blockSize, T type, Consumer<net.imglib2.RandomAccessibleInterval<T>> op)
    Create a DiskCachedCellImg with a cell generator Consumer.
    static <I, O extends net.imglib2.type.NativeType<O>, P extends net.imagej.ops.Op>
    net.imglib2.cache.img.CachedCellImg<O,?>
    process(net.imglib2.RandomAccessibleInterval<I> source, net.imglib2.Interval sourceInterval, int[] blockSize, O type, net.imagej.ops.OpService opService, Class<P> opClass, Object... opArgs)
    Create a DiskCachedCellImg with a cell generator UnaryComputerOp provided by an OpService.
    static <I, O extends net.imglib2.type.NativeType<O>>
    net.imglib2.cache.img.CachedCellImg<O,?>
    process(net.imglib2.RandomAccessibleInterval<I> source, net.imglib2.Interval sourceInterval, int[] blockSize, O type, net.imagej.ops.special.computer.UnaryComputerOp<net.imglib2.RandomAccessibleInterval<I>,net.imglib2.RandomAccessibleInterval<O>> op)
    Create a DiskCachedCellImg with a cell generator UnaryComputerOp.
    static <I, O extends net.imglib2.type.NativeType<O>>
    net.imglib2.cache.img.CachedCellImg<O,?>
    process(net.imglib2.RandomAccessibleInterval<I> source, net.imglib2.Interval sourceInterval, int[] blockSize, O type, net.imagej.ops.special.computer.UnaryComputerOp<net.imglib2.RandomAccessibleInterval<I>,net.imglib2.RandomAccessibleInterval<O>> op, Path cacheDir)
    As process(RandomAccessibleInterval, Interval, int[], NativeType, UnaryComputerOp), but the disk cache is created under the caller-supplied cacheDir -- see createImg(Interval, int[], NativeType, CellLoader, Path) for when to use this.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createImg

      public static <T extends net.imglib2.type.NativeType<T>> net.imglib2.cache.img.CachedCellImg<T,?> createImg(net.imglib2.Interval targetInterval, int[] blockSize, T type, net.imglib2.cache.img.CellLoader<T> loader)
    • createImg

      public static <T extends net.imglib2.type.NativeType<T>> net.imglib2.cache.img.CachedCellImg<T,?> createImg(net.imglib2.Interval targetInterval, int[] blockSize, T type, net.imglib2.cache.img.CellLoader<T> loader, Path cacheDir)
      As createImg(Interval, int[], NativeType, CellLoader), but the disk cache is created directly under cacheDir rather than SNT's shared SNTUtils.getCacheDir(). Use this overload when the caller needs to track and explicitly remove this specific cache later (e.g. it backs a long-lived image that may be replaced several times within a session, so its disk usage would otherwise accumulate until the JVM exits).
    • process

      public static <T extends net.imglib2.type.NativeType<T>> net.imglib2.cache.img.CachedCellImg<T,?> process(net.imglib2.Interval targetInterval, int[] blockSize, T type, Consumer<net.imglib2.RandomAccessibleInterval<T>> op)
      Create a DiskCachedCellImg with a cell generator Consumer.
      Parameters:
      targetInterval -
      blockSize -
      type -
      op -
      Returns:
    • process

      public static <I, O extends net.imglib2.type.NativeType<O>> net.imglib2.cache.img.CachedCellImg<O,?> process(net.imglib2.RandomAccessibleInterval<I> source, net.imglib2.Interval sourceInterval, int[] blockSize, O type, net.imagej.ops.special.computer.UnaryComputerOp<net.imglib2.RandomAccessibleInterval<I>,net.imglib2.RandomAccessibleInterval<O>> op)
      Create a DiskCachedCellImg with a cell generator UnaryComputerOp.
      Parameters:
      source -
      sourceInterval -
      blockSize -
      type -
      op -
      Returns:
    • process

      public static <I, O extends net.imglib2.type.NativeType<O>> net.imglib2.cache.img.CachedCellImg<O,?> process(net.imglib2.RandomAccessibleInterval<I> source, net.imglib2.Interval sourceInterval, int[] blockSize, O type, net.imagej.ops.special.computer.UnaryComputerOp<net.imglib2.RandomAccessibleInterval<I>,net.imglib2.RandomAccessibleInterval<O>> op, Path cacheDir)
      As process(RandomAccessibleInterval, Interval, int[], NativeType, UnaryComputerOp), but the disk cache is created under the caller-supplied cacheDir -- see createImg(Interval, int[], NativeType, CellLoader, Path) for when to use this.
    • process

      public static <I, O extends net.imglib2.type.NativeType<O>, P extends net.imagej.ops.Op> net.imglib2.cache.img.CachedCellImg<O,?> process(net.imglib2.RandomAccessibleInterval<I> source, net.imglib2.Interval sourceInterval, int[] blockSize, O type, net.imagej.ops.OpService opService, Class<P> opClass, Object... opArgs)
      Create a DiskCachedCellImg with a cell generator UnaryComputerOp provided by an OpService.
      Parameters:
      source -
      sourceInterval -
      blockSize -
      type -
      opService -
      opClass -
      opArgs -
      Returns: