Package qupath.opencv.ml
Class PatchClassifierParams
java.lang.Object
qupath.opencv.ml.PatchClassifierParams
Parameters required to build a classifier that operates on an image patch.
This is typically used to create a PixelClassifier.
It can also be used to create an ObjectClassifier that takes image patches as input
(rather that features extracted from object ROIs or measurement lists).
- Since:
- v0.4.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a builder to generate new patch classifier params.builder(PatchClassifierParams params) Create a builder to generate new patch classifier params, initialized with the values from an existing parameter object.static qupath.lib.classifiers.pixel.PixelClassifierBuild a pixel classifier using these parametersqupath.lib.regions.PaddinggetHalo()Get the 'halo' around the output.List<qupath.lib.images.servers.ColorTransforms.ColorTransform> Get the channels to extract from the image as input to the model.qupath.lib.images.servers.PixelCalibrationGet the requested input resolution for the image.qupath.lib.images.servers.ImageServerMetadata.ChannelTypeGet the requested output channel type.Get the classifications for the output.intGet the height of a patch, in pixels.intGet the width of a patch, in pixels.Get any postprocessing steps that should be applied after prediction.Get the image op used for prediction only.Get any preprocessing steps that should be applied.
-
Method Details
-
getInputChannels
Get the channels to extract from the image as input to the model.- Returns:
- the input channels.
-
getPatchWidth
public int getPatchWidth()Get the width of a patch, in pixels.- Returns:
- the width of a patch in pixels
-
getPatchHeight
public int getPatchHeight()Get the height of a patch, in pixels.- Returns:
- the height of a patch in pixels
-
getHalo
public qupath.lib.regions.Padding getHalo()Get the 'halo' around the output. This can be used to determine appropriate padding to avoid tile boundary artifacts. Can be null or empty.- Returns:
- the padding
-
getInputResolution
public qupath.lib.images.servers.PixelCalibration getInputResolution()Get the requested input resolution for the image.- Returns:
- the requested pixel calibration of the input
-
getOutputChannelType
public qupath.lib.images.servers.ImageServerMetadata.ChannelType getOutputChannelType()Get the requested output channel type.- Returns:
- the requested output type
-
getOutputClasses
Get the classifications for the output. Keys to the map are generally channel numbers of the output (zero-based), or could be labels in a single-channel labeled image.- Returns:
- a map from ints to class names.
-
getPreprocessing
Get any preprocessing steps that should be applied.- Returns:
- the preprocessing operations.
-
getPredictionOp
Get the image op used for prediction only. This is applied after any preprocessing steps, but before any postprocessing steps.- Returns:
- the prediction operation.
-
getPostprocessing
Get any postprocessing steps that should be applied after prediction.- Returns:
- the postprocessing operations.
-
buildPixelClassifier
public static qupath.lib.classifiers.pixel.PixelClassifier buildPixelClassifier(PatchClassifierParams params) Build a pixel classifier using these parameters- Parameters:
params- the classifier parameters.- Returns:
- a pixel classifier using the input parameters.
-
builder
Create a builder to generate new patch classifier params.- Returns:
- a new builder.
-
builder
Create a builder to generate new patch classifier params, initialized with the values from an existing parameter object.- Parameters:
params- the existing parameters, used to initialize the builder- Returns:
- a builder using the input parameters.
-