Class PatchClassifierParams.Builder

java.lang.Object
qupath.opencv.ml.PatchClassifierParams.Builder
Enclosing class:
PatchClassifierParams

public static class PatchClassifierParams.Builder extends Object
Builder class to create PatchClassifierParams.
  • Method Details

    • inputChannels

      public PatchClassifierParams.Builder inputChannels(String... channels)
      Define the input channels using channel names.
      Parameters:
      channels - the names of the channels to be used as input
      Returns:
      a reference to this builder
      See Also:
    • inputChannels

      public PatchClassifierParams.Builder inputChannels(int... channels)
      Define the input channels using (zero-based) channel numbers.
      Parameters:
      channels - the indices of the channels to be used as input
      Returns:
      a reference to this builder
      See Also:
    • inputChannels

      public PatchClassifierParams.Builder inputChannels(Collection<? extends ColorTransforms.ColorTransform> channels)
      Define the input channels from a collection of color transforms. An ordered collection (e.g. list) should be used, since the iteration order is important.
      Parameters:
      channels - the channels to be used as input
      Returns:
      a reference to this builder
    • inputResolution

      public PatchClassifierParams.Builder inputResolution(PixelCalibration cal, double downsample)
      Define the input resolution using a pixel calibration and a scaling factor.
      Parameters:
      cal - input calibration; if null, a default calibration will be used
      downsample - scaling factor (1.0 to use the calibration directly)
      Returns:
      a reference to this builder
    • inputResolution

      public PatchClassifierParams.Builder inputResolution(PixelCalibration cal)
      Define the input resolution using a pixel calibration object.
      Parameters:
      cal - the pixel calibration
      Returns:
      a reference to this builder
    • halo

      public PatchClassifierParams.Builder halo(int padding)
      Define a halo that is symmetric in x and y.
      Parameters:
      padding - padding value, to be added both before and after rows and columns.
      Returns:
      a reference to this builder
      See Also:
    • halo

      Define a halo using a padding object.
      Parameters:
      halo - padding value, to be added both before and after rows and columns
      Returns:
      a reference to this builder
      See Also:
    • patchSize

      public PatchClassifierParams.Builder patchSize(int patchSize)
      Define the requested square patch size.
      Parameters:
      patchSize - width and height of the patch
      Returns:
      a reference to this builder
    • patchSize

      public PatchClassifierParams.Builder patchSize(int patchWidth, int patchHeight)
      Define the requested patch size.
      Parameters:
      patchWidth - requested patch width
      patchHeight - requested patch height
      Returns:
      a reference to this builder
    • preprocessing

      public PatchClassifierParams.Builder preprocessing(ImageOp... preprocessingOps)
      Define the preprocessing steps from an array. Note that any existing preprocessing steps in the builder will be replaced by those provided here.
      Parameters:
      preprocessingOps - the preprocessing operations
      Returns:
      a reference to this builder
    • preprocessing

      public PatchClassifierParams.Builder preprocessing(Collection<? extends ImageOp> preprocessingOps)
      Define the preprocessing steps from a collection. Note that any existing preprocessing steps in the builder will be replaced by those provided here.
      Parameters:
      preprocessingOps - the preprocessing operations
      Returns:
      a reference to this builder
    • prediction

      public PatchClassifierParams.Builder prediction(ImageOp predictionOp)
      Define the prediction image op, to be applied after preprocessing and before postprocessing.
      Parameters:
      predictionOp - the prediction operations
      Returns:
      a reference to this builder
      See Also:
    • prediction

      public PatchClassifierParams.Builder prediction(DnnModel model, Padding padding, String... outputNames)
      Define the DNN to be used for prediction, to be applied after preprocessing and before postprocessing.
      Parameters:
      model - the model
      padding - the padding
      outputNames - the output names
      Returns:
      a reference to this builder
      See Also:
    • postprocessing

      public PatchClassifierParams.Builder postprocessing(ImageOp... postprocessingOps)
      Define the postprocessing steps from an array. Note that any existing postprocessing steps in the builder will be replaced by those provided here.
      Parameters:
      postprocessingOps - the postprocessing operations
      Returns:
      a reference to this builder
    • postprocessing

      public PatchClassifierParams.Builder postprocessing(Collection<? extends ImageOp> postprocessingOps)
      Define the postprocessing steps from a collection. Note that any existing postprocessing steps in the builder will be replaced by those provided here.
      Parameters:
      postprocessingOps - the postprocessing operations
      Returns:
      a reference to this builder
    • outputChannelType

      public PatchClassifierParams.Builder outputChannelType(ImageServerMetadata.ChannelType channelType)
      Define the channel type for the output.
      Parameters:
      channelType - the channel type (feature, probability, etc)
      Returns:
      a reference to this builder
    • outputClasses

      public PatchClassifierParams.Builder outputClasses(Map<Integer,PathClass> outputClasses)
      Define the classifications for the output as a map.
      Parameters:
      outputClasses - the classifications to be given to output objects
      Returns:
      a reference to this builder
      See Also:
    • outputClasses

      public PatchClassifierParams.Builder outputClasses(PathClass... outputClasses)
      Define the classifications for the output as an array.
      Parameters:
      outputClasses - the classifications to be given to output objects
      Returns:
      a reference to this builder
      See Also:
    • outputClassNames

      public PatchClassifierParams.Builder outputClassNames(String... outputClasses)
      Define the classifications for the output as an array of classification names.
      Parameters:
      outputClasses - The output classes
      Returns:
      a reference to this builder
      See Also:
    • outputClassNames

      public PatchClassifierParams.Builder outputClassNames(Map<Integer,String> outputClasses)
      Define the classifications for the output as a map with string values.
      Parameters:
      outputClasses - a map from integer output to output class names
      Returns:
      a reference to this builder
      See Also:
    • build

      public PatchClassifierParams build()
      Build the patch classifier parameters.
      Returns:
      a built classifier params object.