Class FilterHelper

Object
FilterHelper

public class FilterHelper extends Object
Helper class for applying filters to Channels and BinaryVoxels using ImageJ operations.
  • Method Details

    • applyRankFilter

      public static Channel applyRankFilter(Channel channel, int radius, int filterType) throws OperationFailedException
      Applies a 2D rank-filter to each slice independently of a Channel.
      Parameters:
      channel - the channel to apply the filter to
      radius - the radius of the filter
      filterType - the type of rank filter to apply
      Returns:
      the filtered channel
      Throws:
      OperationFailedException - if channel contains an unsupported data-type
    • processEachSlice

      public static void processEachSlice(Channel channel, Consumer<ij.process.ImageProcessor> consumer) throws ImageJConversionException
      Applies a Consumer to each slice independently of a Channel.

      The slice is exposed as a ImageProcessor.

      Parameters:
      channel - the channel whose slices will be processed
      consumer - successively applied to the ImageProcessor derived from each slice
      Throws:
      ImageJConversionException - if the voxels are neither unsigned byte nor unsigned short (the only two supported types)
    • processEachSlice

      public static void processEachSlice(BinaryVoxels<UnsignedByteBuffer> voxels, Consumer<ij.process.ImageProcessor> consumer)
      Applies a Consumer to each slice independently of a BinaryVoxels with UnsignedByteBuffer.

      The slice is exposed as a ImageProcessor.

      Parameters:
      voxels - the voxels whose slices will be processed
      consumer - successively applied to the ImageProcessor derived from each slice