Package qupath.process.gui.commands.ml
Class PixelClassifierTraining
java.lang.Object
qupath.process.gui.commands.ml.PixelClassifierTraining
Helper class for training a pixel classifier.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWrapper for training data. -
Constructor Summary
ConstructorsConstructorDescriptionPixelClassifierTraining(qupath.opencv.ops.ImageDataOp featureCalculator) Create a new pixel classifier helper, to support generating training data. -
Method Summary
Modifier and TypeMethodDescriptioncreateTrainingData(Collection<qupath.lib.images.ImageData<BufferedImage>> imageData) Create training data, using a label map automatically generated from the available classifications.createTrainingData(qupath.lib.images.ImageData<BufferedImage> imageData) Create training data, using a label map automatically generated from the available classifications.createTrainingDataForLabelMap(Collection<qupath.lib.images.ImageData<BufferedImage>> imageData, Map<qupath.lib.objects.classes.PathClass, Integer> labels) Get a classifier training map, using a predefined label map (which determines which classifications to use).Get the strategy for handling the boundaries of area annotations.qupath.opencv.ops.ImageDataOpGet anImageDataOpused for feature calculation.qupath.lib.images.servers.PixelCalibrationGet the resolution at which the training should occur.voidsetBoundaryStrategy(BoundaryStrategy strategy) Set the strategy for handling the boundaries of area annotations.voidsetFeatureOp(qupath.opencv.ops.ImageDataOp featureOp) Set theImageDataOpused to calculate features.voidsetResolution(qupath.lib.images.servers.PixelCalibration cal) Set the resolution at which the training should occur.
-
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 anImageDataOpused 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 theImageDataOpused to calculate features.- Parameters:
featureOp-
-
setBoundaryStrategy
Set the strategy for handling the boundaries of area annotations.- Parameters:
strategy-
-
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 IOExceptionGet a classifier training map, using a predefined label map (which determines which classifications to use).- Parameters:
imageData- collection ofImageDataused for traininglabels- 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.ClassifierTrainingDataobject representing training data - Throws:
IOException
-