Package qupath.lib.classifiers.object
Interface ObjectClassifier<T>
- Type Parameters:
T-
- All Known Implementing Classes:
AbstractObjectClassifier,DnnObjectClassifier,OpenCVMLClassifier,OpenCVModelObjectClassifier
public interface ObjectClassifier<T>
Interface defining object classifiers, which assign PathClasses to PathObjects.
- Author:
- Pete Bankhead
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault location to use when storing object classifiers in a project. -
Method Summary
Modifier and TypeMethodDescriptionintclassifyObjects(ImageData<T> imageData, boolean resetExistingClass) Classify all compatible objects from anImageData.intclassifyObjects(ImageData<T> imageData, Collection<? extends PathObject> pathObjects, boolean resetExistingClass) Classify the objects in the specified collection.getCompatibleObjects(ImageData<T> imageData) Get the objects from anImageDatathat are compatible with this classifier.getMissingFeatures(ImageData<T> imageData, Collection<? extends PathObject> pathObjects) Check for missing features, returning the names and number of input objects missing the specified features.Get the classifications set by this classifier.
-
Field Details
-
PROJECT_LOCATION
Default location to use when storing object classifiers in a project.
-
-
Method Details
-
getPathClasses
Collection<PathClass> getPathClasses()Get the classifications set by this classifier.- Returns:
-
classifyObjects
Classify all compatible objects from anImageData.Note: this method does not typically fire any hierarchy change/object classification events. It is up to the caller to fire these events if required.
- Parameters:
imageData- data containing the object hierarchyresetExistingClass-- Returns:
- the number of objects whose classification was changed.
- See Also:
-
classifyObjects
int classifyObjects(ImageData<T> imageData, Collection<? extends PathObject> pathObjects, boolean resetExistingClass) Classify the objects in the specified collection. This provides a means to specify exactly which objects should be classified, avoiding reliance ongetCompatibleObjects(ImageData).Note: this method does not typically fire any hierarchy change/object classification events. It is up to the caller to fire these events if required.
- Parameters:
imageData- data that may or may not be required for classification depending upon how features are extractedpathObjects- the objects to classifyresetExistingClass-- Returns:
- the number of objects whose classification was changed.
- See Also:
-
getCompatibleObjects
Get the objects from anImageDatathat are compatible with this classifier.- Parameters:
imageData-- Returns:
- a collection of compatible objects, or empty list if no compatible objects are found
-
getMissingFeatures
Map<String,Integer> getMissingFeatures(ImageData<T> imageData, Collection<? extends PathObject> pathObjects) Check for missing features, returning the names and number of input objects missing the specified features. This is useful as a warning that the input for the classifier may not be valid. Default implementation returns an empty map; however, implementations should attempt to provide a meaningful output if possible. Features that are not missing should not be included in the output.- Parameters:
imageData- image containing the objects to testpathObjects- objects to test for missing features; if not available,getCompatibleObjects(ImageData)will be called.- Returns:
- a map of feature names and the number of objects missing the corresponding features.
-