Interface FeatureExtractor<T>
- Type Parameters:
T
- generic parameter related to theImageData
(not always required).
public interface FeatureExtractor<T>
Interface for extracting features from PathObjects for the purpose of object classification.
- Author:
- Pete Bankhead
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
extractFeatures
(ImageData<T> imageData, Collection<? extends PathObject> pathObjects, FloatBuffer buffer) Extract features from a collection of objects, adding the corresponding values to aFloatBuffer
.getMissingFeatures
(ImageData<T> imageData, PathObject pathObject) Check for missing features, returning the names.int
-
Method Details
-
getFeatureNames
- Returns:
- the names of the features that can be extracted
-
nFeatures
int nFeatures()- Returns:
- the number of features that can be extracted
-
extractFeatures
void extractFeatures(ImageData<T> imageData, Collection<? extends PathObject> pathObjects, FloatBuffer buffer) Extract features from a collection of objects, adding the corresponding values to aFloatBuffer
. Each feature is a single numeric value. At the end,pathObjects.size() * nFeatures()
features should be added to the buffer. Each object is processed in turn, with all features for that object added before the next object is processed.- Parameters:
imageData
- image data, used by some implementations to determine feature values (e.g. if these depend upon pixels).pathObjects
- objects for which features should be calculatedbuffer
- buffer into which feature values should be added
-
getMissingFeatures
Check for missing features, returning the names. This is useful as a warning that the input for the feature extractor may not be valid. Default implementation returns an empty list; however, implementations should attempt to provide a meaningful output if possible.- Parameters:
imageData
- image containing the objects to testpathObject
- object to test for missing feature- Returns:
- a collection of feature names that correspond to missing features
-