Package qupath.lib.objects
Class PathROIObject
java.lang.Object
qupath.lib.objects.PathObject
qupath.lib.objects.PathROIObject
- All Implemented Interfaces:
Externalizable
,Serializable
- Direct Known Subclasses:
PathAnnotationObject
,PathDetectionObject
,TMACoreObject
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 Summary
Modifier and TypeMethodDescriptiondouble
Request the classification probability, or Double.NaN if no probability is available.Get the classification of the object.getROI()
Get the region of interest (ROI) for the object.boolean
Deprecated.since v0.4.0boolean
isLocked()
Query the locked status for the object, indicating whether it should be editable or not.void
void
setLocked
(boolean locked) Set locked flag, indicating that the object ROI should not be modified.void
setPathClass
(PathClass pathClass, double classProbability) Set the classification of the object, specifying a classification probability.void
Set the ROI for this object.void
Methods inherited from class qupath.lib.objects.PathObject
addChildObject, addChildObjects, addPathObject, addPathObjects, clearChildObjects, clearMetadataMap, clearPathObjects, createEmptyMeasurementList, getChildObjects, getChildObjects, getChildObjectsAsArray, getClassifications, getColor, getColorRGB, getDescendantObjects, getDisplayedName, getID, getLevel, getMeasurementList, getMeasurements, getMetadata, getName, getParent, getUnmodifiableMetadataMap, hasChildObjects, hasChildren, hasMeasurements, hasROI, isAnnotation, isCell, isDetection, isRootObject, isTile, isTMACore, nChildObjects, nDescendants, objectCountPostfix, refreshID, removeChildObject, removeChildObjects, removePathObject, removePathObjects, resetPathClass, retrieveMetadataKeys, retrieveMetadataValue, setClassifications, setColor, setColor, setColorRGB, setID, setName, setPathClass, storeMetadataValue, toString
-
Method Details
-
setROI
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 onisEditable()
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 classPathObject
- Parameters:
locked
-
-
isLocked
public boolean isLocked()Query the locked status for the object, indicating whether it should be editable or not.- Overrides:
isLocked
in classPathObject
- Returns:
-
isEditable
Deprecated.since v0.4.0Return true ifisLocked()
is false, otherwise returns false.This method existed before
isLocked()
to try to automatically determine whether an object should be locked or not. Now theisLocked()
flag should be used instead.- Specified by:
isEditable
in classPathObject
- Returns:
-
setPathClass
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 classPathObject
- 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 classPathObject
- Returns:
-
getPathClass
Description copied from class:PathObject
Get the classification of the object.- Specified by:
getPathClass
in classPathObject
- Returns:
-
getROI
Description copied from class:PathObject
Get the region of interest (ROI) for the object.- Specified by:
getROI
in classPathObject
- Returns:
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classPathObject
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classPathObject
- Throws:
IOException
ClassNotFoundException
-