Class PathROIObject

java.lang.Object
qupath.lib.objects.PathObject
qupath.lib.objects.PathROIObject
All Implemented Interfaces:
Externalizable, Serializable
Direct Known Subclasses:
PathAnnotationObject, PathDetectionObject, TMACoreObject

public abstract class PathROIObject extends PathObject
Abstract class used for PathObjects that have ROIs associated with them.

In practice, this is almost all PathObjects (with the notable exception of PathRootObjects).

Author:
Pete Bankhead
See Also:
  • Method Details

    • setROI

      public void setROI(ROI roi)
      Set the ROI for this object. If this is called, one should remember to update any associated hierarchy to notify it of the change.
      Parameters:
      roi -
    • setLocked

      public void setLocked(boolean locked)
      Set locked flag, indicating that the object ROI should not be modified. It directly impacts on isEditable()

      Note that this is only a hint that other code should pay attention to - it is not enforced locally.

      TODO: Consider shifting this method into PathObject rather than PathROIObject (even if it doesn't really do anything there).

      Overrides:
      setLocked in class PathObject
      Parameters:
      locked -
    • isLocked

      public boolean isLocked()
      Query the locked status for the object, indicating whether it should be editable or not.
      Overrides:
      isLocked in class PathObject
      Returns:
    • isEditable

      @Deprecated public boolean isEditable()
      Deprecated.
      since v0.4.0
      Return true if isLocked() is false, otherwise returns false.

      This method existed before isLocked() to try to automatically determine whether an object should be locked or not. Now the isLocked() flag should be used instead.

      Specified by:
      isEditable in class PathObject
      Returns:
    • setPathClass

      public void setPathClass(PathClass pathClass, double classProbability)
      Description copied from class: PathObject
      Set the classification of the object, specifying a classification probability.

      The probability is expected to be between 0 and 1, or Double.NaN if no probability should be set.

      Specified by:
      setPathClass in class PathObject
      Parameters:
      pathClass -
      classProbability -
    • getClassProbability

      public double getClassProbability()
      Description copied from class: PathObject
      Request the classification probability, or Double.NaN if no probability is available.
      Specified by:
      getClassProbability in class PathObject
      Returns:
    • getPathClass

      public PathClass getPathClass()
      Description copied from class: PathObject
      Get the classification of the object.
      Specified by:
      getPathClass in class PathObject
      Returns:
    • getROI

      public ROI getROI()
      Description copied from class: PathObject
      Get the region of interest (ROI) for the object.
      Specified by:
      getROI in class PathObject
      Returns:
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Overrides:
      writeExternal in class PathObject
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Overrides:
      readExternal in class PathObject
      Throws:
      IOException
      ClassNotFoundException