Package qupath.process.gui.commands.ml
Class PixelClassifierTraining
java.lang.Object
qupath.process.gui.commands.ml.PixelClassifierTraining
Helper class for training a pixel classifier.
- Author:
- Pete Bankhead
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Wrapper for training data. -
Constructor Summary
ConstructorDescriptionPixelClassifierTraining
(ImageDataOp featureCalculator) Create a new pixel classifier helper, to support generating training data. -
Method Summary
Modifier and TypeMethodDescriptioncreateTrainingData
(Collection<ImageData<BufferedImage>> imageData) Create training data, using a label map automatically generated from the available classifications.createTrainingData
(ImageData<BufferedImage> imageData) Create training data, using a label map automatically generated from the available classifications.createTrainingDataForLabelMap
(Collection<ImageData<BufferedImage>> imageData, Map<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.Get anImageDataOp
used for feature calculation.Get the resolution at which the training should occur.void
setBoundaryStrategy
(BoundaryStrategy strategy) Set the strategy for handling the boundaries of area annotations.void
setFeatureOp
(ImageDataOp featureOp) Set theImageDataOp
used to calculate features.void
Set the resolution at which the training should occur.
-
Constructor Details
-
PixelClassifierTraining
Create a new pixel classifier helper, to support generating training data.- Parameters:
featureCalculator
-
-
-
Method Details
-
getFeatureOp
Get anImageDataOp
used for feature calculation.- Returns:
-
getResolution
Get the resolution at which the training should occur.- Returns:
-
setResolution
Set the resolution at which the training should occur.- Parameters:
cal
-
-
setFeatureOp
Set theImageDataOp
used 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(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<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<ImageData<BufferedImage>> imageData, Map<PathClass, Integer> labels) throws IOExceptionGet a classifier training map, using a predefined label map (which determines which classifications to use).- Parameters:
imageData
- collection ofImageData
used 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.ClassifierTrainingData
object representing training data - Throws:
IOException
-