Class PatchClassifierParams

java.lang.Object
qupath.opencv.ml.PatchClassifierParams

public class PatchClassifierParams extends Object
Parameters required to build a classifier that operates on an image patch.

This is typically used to create a PixelClassifier. It can also be used to create an ObjectClassifier that takes image patches as input (rather that features extracted from object ROIs or measurement lists).

Since:
v0.4.0
Author:
Pete Bankhead
  • Method Details

    • getInputChannels

      public List<ColorTransforms.ColorTransform> getInputChannels()
      Get the channels to extract from the image as input to the model.
      Returns:
    • getPatchWidth

      public int getPatchWidth()
      Get the width of a patch, in pixels.
      Returns:
    • getPatchHeight

      public int getPatchHeight()
      Get the height of a patch, in pixels.
      Returns:
    • getHalo

      public Padding getHalo()
      Get the 'halo' around the output. This can be used to determine appropriate padding to avoid tile boundary artifacts. Can be null or empty.
      Returns:
    • getInputResolution

      public PixelCalibration getInputResolution()
      Get the requested input resolution for the image.
      Returns:
    • getOutputChannelType

      public ImageServerMetadata.ChannelType getOutputChannelType()
      Get the requested output channel type.
      Returns:
    • getOutputClasses

      public Map<Integer,PathClass> getOutputClasses()
      Get the classifications for the output. Keys to the map are generally channel numbers of the output (zero-based), or could be labels in a single-channel labeled image.
      Returns:
    • getPreprocessing

      public List<ImageOp> getPreprocessing()
      Get any preprocessing steps that should be applied.
      Returns:
    • getPredictionOp

      public ImageOp getPredictionOp()
      Get the image op used for prediction only. This is applied after any preprocessing steps, but before any postprocessing steps.
      Returns:
    • getPostprocessing

      public List<ImageOp> getPostprocessing()
      Get any postprocessing steps that should be applied after prediction.
      Returns:
    • buildPixelClassifier

      public static PixelClassifier buildPixelClassifier(PatchClassifierParams params)
      Build a pixel classifier using these parameters
      Parameters:
      params -
      Returns:
    • builder

      public static PatchClassifierParams.Builder builder()
      Create a builder to generate new patch classifier params.
      Returns:
    • builder

      public static PatchClassifierParams.Builder builder(PatchClassifierParams params)
      Create a builder to generate new patch classifier params, initialized with the values from an existing parameter object.
      Parameters:
      params - the existing parameters, used to initialize the builder
      Returns: