Class Reclassifier

java.lang.Object
qupath.lib.objects.classes.Reclassifier

public class Reclassifier extends Object
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 Details

    • Reclassifier

      public Reclassifier(PathObject pathObject, PathClass pathClass, boolean retainIntensityClass)
      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 to apply()
      pathClass - the classification that may be applied to pathObject
      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.
      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

      public PathObject getPathObject()
      Get the stored PathObject for which the PathClass may be set.
      Returns: