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.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDefault location to use when storing object classifiers in a project.
- 
Method SummaryModifier 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_LOCATIONDefault location to use when storing object classifiers in a project.- See Also:
 
 
- 
- 
Method Details- 
getPathClassesCollection<PathClass> getPathClasses()Get the classifications set by this classifier.- Returns:
 
- 
classifyObjectsClassify 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 hierarchy
- resetExistingClass-
- Returns:
- the number of objects whose classification was changed.
- See Also:
 
- 
classifyObjectsint 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 extracted
- pathObjects- the objects to classify
- resetExistingClass-
- Returns:
- the number of objects whose classification was changed.
- See Also:
 
- 
getCompatibleObjectsGet 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
 
- 
getMissingFeaturesMap<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 test
- pathObjects- 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.
 
 
-