Package qupath.lib.objects.classes
Class Reclassifier
java.lang.Object
qupath.lib.objects.classes.Reclassifier
Helper class when classifying PathObjects.
When applying a classifier to make objects, it's desirable to make updating the classification an atomic operation, applied to all objects in one go. Consequently, it the classifier is aborted early (e.g. the thread interrupted), then the objects are not partially reclassified.
-
Constructor Summary
ConstructorDescriptionReclassifier
(PathObject pathObject, PathClass pathClass, boolean retainIntensityClass) Helper class to store an object prior to reclassifying it.Reclassifier
(PathObject pathObject, PathClass pathClass, boolean retainIntensityClass, double probability) Helper class to store an object prior to reclassifying it, including a classification probability. -
Method Summary
Modifier and TypeMethodDescriptionboolean
apply()
Apply the stored classification.Get the stored PathObject for which the PathClass may be set.
-
Constructor Details
-
Reclassifier
Helper class to store an object prior to reclassifying it.- Parameters:
pathObject
-pathClass
-retainIntensityClass
- of we have a single-level or two-level PathClass, with the second element an intensity classification, optionally retain this and only update the base class.
-
Reclassifier
public Reclassifier(PathObject pathObject, PathClass pathClass, boolean retainIntensityClass, double probability) Helper class to store an object prior to reclassifying it, including a classification probability.- Parameters:
pathObject
- an object whose classification may be set by a subsequent call toapply()
pathClass
- the classification that may be applied to pathObjectretainIntensityClass
- of we have a single-level or two-level PathClass, with the second element an intensity classification, optionally retain this and only update the base class.probability
- optional classification probability value to store in the object (may be Double.NaN if this should be ignored).
-
-
Method Details
-
apply
public boolean apply()Apply the stored classification.- Returns:
- true if the classification for the object changed, false otherwise.
-
getPathObject
Get the stored PathObject for which the PathClass may be set.- Returns:
-