Package qupath.opencv.ml
Class PatchClassifierParams.Builder
java.lang.Object
qupath.opencv.ml.PatchClassifierParams.Builder
- Enclosing class:
PatchClassifierParams
Builder class to create
PatchClassifierParams
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the patch classifier parameters.halo
(int padding) Define a halo that is symmetric in x and y.Define a halo using a padding object.inputChannels
(int... channels) Define the input channels using (zero-based) channel numbers.inputChannels
(String... channels) Define the input channels using channel names.inputChannels
(Collection<? extends ColorTransforms.ColorTransform> channels) Define the input channels from a collection of color transforms.Define the input resolution using a pixel calibration object.inputResolution
(PixelCalibration cal, double downsample) Define the input resolution using a pixel calibration and a scaling factor.outputChannelType
(ImageServerMetadata.ChannelType channelType) Define the channel type for the output.outputClasses
(Map<Integer, PathClass> outputClasses) Define the classifications for the output as a map.outputClasses
(PathClass... outputClasses) Define the classifications for the output as an array.outputClassNames
(String... outputClasses) Define the classifications for the output as an array of classification names.outputClassNames
(Map<Integer, String> outputClasses) Define the classifications for the output as a map with string values.patchSize
(int patchSize) Define the requested square patch size.patchSize
(int patchWidth, int patchHeight) Define the requested patch size.postprocessing
(Collection<? extends ImageOp> postprocessingOps) Define the postprocessing steps from a collection.postprocessing
(ImageOp... postprocessingOps) Define the postprocessing steps from an array.prediction
(DnnModel model, Padding padding, String... outputNames) Define the DNN to be used for prediction, to be applied after preprocessing and before postprocessing.prediction
(ImageOp predictionOp) Define the prediction image op, to be applied after preprocessing and before postprocessing.preprocessing
(Collection<? extends ImageOp> preprocessingOps) Define the preprocessing steps from a collection.preprocessing
(ImageOp... preprocessingOps) Define the preprocessing steps from an array.
-
Method Details
-
inputChannels
Define the input channels using channel names.- Parameters:
channels
-- Returns:
- See Also:
-
inputChannels
Define the input channels using (zero-based) channel numbers.- Parameters:
channels
-- Returns:
- See Also:
-
inputChannels
public PatchClassifierParams.Builder inputChannels(Collection<? extends ColorTransforms.ColorTransform> channels) Define the input channels from a collection of color transforms. An ordered collection (e.g. list) should be used, since the iteration order is important.- Parameters:
channels
-- Returns:
-
inputResolution
Define the input resolution using a pixel calibration and a scaling factor.- Parameters:
cal
- input calibration; if null, a default calibration will be useddownsample
- scaling factor (1.0 to use the calibration directly)- Returns:
-
inputResolution
Define the input resolution using a pixel calibration object.- Parameters:
cal
-- Returns:
-
halo
Define a halo that is symmetric in x and y.- Parameters:
padding
- padding value, to be added both before and after rows and columns.- Returns:
- See Also:
-
halo
Define a halo using a padding object.- Parameters:
halo
-- Returns:
- See Also:
-
patchSize
Define the requested square patch size.- Parameters:
patchSize
- width and height of the patch- Returns:
-
patchSize
Define the requested patch size.- Parameters:
patchWidth
- requested patch widthpatchHeight
- requested patch height- Returns:
-
preprocessing
Define the preprocessing steps from an array. Note that any existing preprocessing steps in the builder will be replaced by those provided here.- Parameters:
preprocessingOps
-- Returns:
-
preprocessing
Define the preprocessing steps from a collection. Note that any existing preprocessing steps in the builder will be replaced by those provided here.- Parameters:
preprocessingOps
-- Returns:
-
prediction
Define the prediction image op, to be applied after preprocessing and before postprocessing.- Parameters:
predictionOp
-- Returns:
- See Also:
-
prediction
public PatchClassifierParams.Builder prediction(DnnModel model, Padding padding, String... outputNames) Define the DNN to be used for prediction, to be applied after preprocessing and before postprocessing.- Parameters:
model
-padding
-outputNames
-- Returns:
- See Also:
-
postprocessing
Define the postprocessing steps from an array. Note that any existing postprocessing steps in the builder will be replaced by those provided here.- Parameters:
postprocessingOps
-- Returns:
-
postprocessing
public PatchClassifierParams.Builder postprocessing(Collection<? extends ImageOp> postprocessingOps) Define the postprocessing steps from a collection. Note that any existing postprocessing steps in the builder will be replaced by those provided here.- Parameters:
postprocessingOps
-- Returns:
-
outputChannelType
Define the channel type for the output.- Parameters:
channelType
-- Returns:
-
outputClasses
Define the classifications for the output as a map.- Parameters:
outputClasses
-- Returns:
- See Also:
-
outputClasses
Define the classifications for the output as an array.- Parameters:
outputClasses
-- Returns:
- See Also:
-
outputClassNames
Define the classifications for the output as an array of classification names.- Parameters:
outputClasses
-- Returns:
- See Also:
-
outputClassNames
Define the classifications for the output as a map with string values.- Parameters:
outputClasses
-- Returns:
- See Also:
-
build
Build the patch classifier parameters.- Returns:
-