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(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 anImageDataOpused for feature calculation.Get the resolution at which the training should occur.voidsetBoundaryStrategy(BoundaryStrategy strategy) Set the strategy for handling the boundaries of area annotations.voidsetFeatureOp(ImageDataOp featureOp) Set theImageDataOpused to calculate features.voidSet 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 anImageDataOpused 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 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(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 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
-