Class PixelProcessor.Builder<S,T,U>

java.lang.Object
qupath.lib.experimental.pixels.PixelProcessor.Builder<S,T,U>
Type Parameters:
S - the image type
T - the mask type
U - the output type
Enclosing class:
PixelProcessor<S,T,U>

public static class PixelProcessor.Builder<S,T,U> extends Object
Builder class for a PixelProcessor
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • imageSupplier

      public PixelProcessor.Builder<S,T,U> imageSupplier(ImageSupplier<S> imageSupplier)
      Set the image supplier. This is required if the processor is to have access to pixels.
      Parameters:
      imageSupplier -
      Returns:
    • maskSupplier

      public PixelProcessor.Builder<S,T,U> maskSupplier(MaskSupplier<S,T> maskSupplier)
      Set the mask supplier. This is optional, but without it masks will be null.
      Parameters:
      maskSupplier -
      Returns:
    • outputHandler

      public PixelProcessor.Builder<S,T,U> outputHandler(OutputHandler<S,T,U> outputHandler)
      Set the output handler. This is optional, for cases where the processor does not make updates to the parent object itself.
      Parameters:
      outputHandler -
      Returns:
    • processor

      public PixelProcessor.Builder<S,T,U> processor(Processor<S,T,U> processor)
      Set the processor. This is required to do any interesting work.
      Parameters:
      processor -
      Returns:
    • padding

      public PixelProcessor.Builder<S,T,U> padding(Padding padding)
      Set the padding to use when extracting regions. Note that this is defined in pixels at the full image resolution, not the downsampled resolution.
      Parameters:
      padding -
      Returns:
    • padding

      public PixelProcessor.Builder<S,T,U> padding(int size)
      Set the padding to use when extracting regions, using a symmetric padding. Note that this is defined in pixels at the full image resolution, not the downsampled resolution.
      Parameters:
      size -
      Returns:
    • downsample

      public PixelProcessor.Builder<S,T,U> downsample(double downsample)
      Set the downsample factor to use with requesting image regions.
      Parameters:
      downsample -
      Returns:
    • pixelSize

      public PixelProcessor.Builder<S,T,U> pixelSize(double pixelSize)
      Set the requested pixel size to use with requesting image regions. This will be converted to a downsample factor based on the image calibration.
      Parameters:
      pixelSize -
      Returns:
    • tiler

      public PixelProcessor.Builder<S,T,U> tiler(Tiler tiler)
      Set a tiler to use. This is required for large regions, so that the image can be processed in tiles.
      Parameters:
      tiler -
      Returns:
    • tile

      public PixelProcessor.Builder<S,T,U> tile(int tileWidth, int tileHeight)
      Set a default tiler to use, with a specified tile size.
      Parameters:
      tileWidth -
      tileHeight -
      Returns:
    • merger

      public PixelProcessor.Builder<S,T,U> merger(ObjectMerger merger)
      Set a merger to use. This is currently only relevant when using a tiler.
      Parameters:
      merger -
      Returns:
      See Also:
    • mergeSharedBoundaries

      public PixelProcessor.Builder<S,T,U> mergeSharedBoundaries(double threshold)
      Convenience method to set a merger that merges objects based on their shared boundary.
      Parameters:
      threshold - the shared boundary threshold; see ObjectMerger.createSharedTileBoundaryMerger(double) for more information.
      Returns:
      See Also:
    • build

      public PixelProcessor<S,T,U> build()
      Build a PixelProcessor from the current state of the builder. This will throw an exception if any of the required components are missing.
      Returns: