Class PixelClassifierTraining

java.lang.Object
qupath.process.gui.commands.ml.PixelClassifierTraining

public class PixelClassifierTraining extends Object
Helper class for training a pixel classifier.
  • Constructor Details

    • PixelClassifierTraining

      public PixelClassifierTraining(qupath.opencv.ops.ImageDataOp featureCalculator)
      Create a new pixel classifier helper, to support generating training data.
      Parameters:
      featureCalculator -
  • Method Details

    • getFeatureOp

      public qupath.opencv.ops.ImageDataOp getFeatureOp()
      Get an ImageDataOp used for feature calculation.
      Returns:
    • getResolution

      public qupath.lib.images.servers.PixelCalibration getResolution()
      Get the resolution at which the training should occur.
      Returns:
    • setResolution

      public void setResolution(qupath.lib.images.servers.PixelCalibration cal)
      Set the resolution at which the training should occur.
      Parameters:
      cal -
    • setFeatureOp

      public void setFeatureOp(qupath.opencv.ops.ImageDataOp featureOp)
      Set the ImageDataOp used to calculate features.
      Parameters:
      featureOp -
    • setBoundaryStrategy

      public void setBoundaryStrategy(BoundaryStrategy strategy)
      Set the strategy for handling the boundaries of area annotations.
      Parameters:
      strategy -
    • getBoundaryStrategy

      public BoundaryStrategy getBoundaryStrategy()
      Get the strategy for handling the boundaries of area annotations.
      Returns:
    • createTrainingData

      public PixelClassifierTraining.ClassifierTrainingData createTrainingData(qupath.lib.images.ImageData<BufferedImage> imageData) throws IOException
      Create training data, using a label map automatically generated from the available classifications.
      Parameters:
      imageData -
      Returns:
      Throws:
      IOException
    • createTrainingData

      public PixelClassifierTraining.ClassifierTrainingData createTrainingData(Collection<qupath.lib.images.ImageData<BufferedImage>> imageData) throws IOException
      Create training data, using a label map automatically generated from the available classifications.
      Parameters:
      imageData -
      Returns:
      Throws:
      IOException
    • createTrainingDataForLabelMap

      public PixelClassifierTraining.ClassifierTrainingData createTrainingDataForLabelMap(Collection<qupath.lib.images.ImageData<BufferedImage>> imageData, Map<qupath.lib.objects.classes.PathClass,Integer> labels) throws IOException
      Get a classifier training map, using a predefined label map (which determines which classifications to use).
      Parameters:
      imageData - collection of ImageData used for training
      labels - map linking classifications to labels in the output; may be null, in which case a label map will be generated from the data
      Returns:
      a PixelClassifierTraining.ClassifierTrainingData object representing training data
      Throws:
      IOException