Class ObjectFilterRelation
Object
AnchorBean<ObjectFilter>
InitializableBean<ObjectFilter, ImageInitialization>
ImageBean<ObjectFilter>
ObjectFilter
ObjectFilterPredicate
ObjectFilterRelation
- Direct Known Subclasses:
RelationWithMatches,ThresholdedFeature,ThresholdedVolume
An independent object-filter that uses a relation in its predicate.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidend()Performs any necessary cleanup after filtering is complete.RelationBeanThe relation to be used in the filter predicate.protected booleanA predicate condition for an object to be kept in the collection.protected abstract booleanPerforms the matching operation using the resolved relation.protected booleanprecondition(ObjectCollection objectsToFilter) A precondition, which if evaluates to false, cancels the filter i.e.voidsetRelation(RelationBean relation) The relation to be used in the filter predicate.protected voidPerforms any necessary initialization before filtering begins.Methods inherited from class org.anchoranalysis.plugin.image.bean.object.filter.ObjectFilterPredicate
filterMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ObjectFilterRelation
public ObjectFilterRelation()
-
-
Method Details
-
precondition
protected boolean precondition(ObjectCollection objectsToFilter) Description copied from class:ObjectFilterPredicateA precondition, which if evaluates to false, cancels the filter i.e. nothing is removed.- Specified by:
preconditionin classObjectFilterPredicate- Parameters:
objectsToFilter- theObjectCollectionto be filtered- Returns:
- true if the filter should be applied, false otherwise
-
start
protected void start(Optional<Dimensions> dimensions, ObjectCollection objectsToFilter) throws OperationFailedException Description copied from class:ObjectFilterPredicatePerforms any necessary initialization before filtering begins.- Overrides:
startin classObjectFilterPredicate- Parameters:
dimensions- optionalDimensionsof the objectsobjectsToFilter- theObjectCollectionto be filtered- Throws:
OperationFailedException- if the initialization fails
-
match
protected boolean match(ObjectMask object, Optional<Dimensions> dimensions) throws OperationFailedException Description copied from class:ObjectFilterPredicateA predicate condition for an object to be kept in the collection.- Specified by:
matchin classObjectFilterPredicate- Parameters:
object- theObjectMaskto be evaluateddimensions- optionalDimensionsof the object- Returns:
- true if the object should be kept, false otherwise
- Throws:
OperationFailedException- if the matching operation fails
-
match
protected abstract boolean match(ObjectMask object, Optional<Dimensions> dim, DoubleBiPredicate relation) throws OperationFailedException Performs the matching operation using the resolved relation.- Parameters:
object- theObjectMaskto be evaluateddim- optionalDimensionsof the objectrelation- the resolvedDoubleBiPredicaterelation- Returns:
- true if the object matches the criteria, false otherwise
- Throws:
OperationFailedException- if the matching operation fails
-
end
protected void end() throws OperationFailedExceptionDescription copied from class:ObjectFilterPredicatePerforms any necessary cleanup after filtering is complete.- Specified by:
endin classObjectFilterPredicate- Throws:
OperationFailedException- if the cleanup operation fails
-
getRelation
public RelationBean getRelation()The relation to be used in the filter predicate.
-