Class ObjectCollectionProviderFilterBase
Object
AnchorBean<ObjectCollectionProvider>
InitializableBean<ObjectCollectionProvider, ImageInitialization>
ImageBean<ObjectCollectionProvider>
ObjectCollectionProvider
ObjectCollectionProviderUnary
WithOptionalDimensionsBase
ObjectCollectionProviderFilterBase
- All Implemented Interfaces:
Provider<ObjectCollection>
- Direct Known Subclasses:
Filter,FilterByGroup
Base class for object collection providers that apply a filter to the objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObjectCollectioncreateFromObjects(ObjectCollection objects) protected abstract ObjectCollectioncreateFromObjects(ObjectCollection objects, Optional<List<ObjectMask>> objectsRejected, Optional<Dimensions> dimensions) Creates anObjectCollectionfrom the given objects, potentially applying a filter and considering dimensions.protected ObjectCollectionfilter(ObjectCollection objects, Optional<Dimensions> dimensions, Optional<List<ObjectMask>> objectsRejected) Filters the given object collection using the specified filter.ObjectFilterThe filter to apply to the object collection.voidsetFilter(ObjectFilter filter) The filter to apply to the object collection.Methods inherited from class org.anchoranalysis.plugin.image.bean.object.provider.WithOptionalDimensionsBase
createDims, getDimensions, setDimensionsMethods inherited from class org.anchoranalysis.image.bean.provider.ObjectCollectionProviderUnary
get, getObjects, setObjectsMethods 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
-
ObjectCollectionProviderFilterBase
public ObjectCollectionProviderFilterBase()
-
-
Method Details
-
createFromObjects
public ObjectCollection createFromObjects(ObjectCollection objects) throws ProvisionFailedException - Specified by:
createFromObjectsin classObjectCollectionProviderUnary- Throws:
ProvisionFailedException
-
filter
protected ObjectCollection filter(ObjectCollection objects, Optional<Dimensions> dimensions, Optional<List<ObjectMask>> objectsRejected) throws ProvisionFailedException Filters the given object collection using the specified filter.- Parameters:
objects- theObjectCollectionto filterdimensions- optionalDimensionsof the objectsobjectsRejected- optional list to store rejectedObjectMasks- Returns:
- the filtered
ObjectCollection - Throws:
ProvisionFailedException- if filtering fails
-
createFromObjects
protected abstract ObjectCollection createFromObjects(ObjectCollection objects, Optional<List<ObjectMask>> objectsRejected, Optional<Dimensions> dimensions) throws ProvisionFailedException Creates anObjectCollectionfrom the given objects, potentially applying a filter and considering dimensions.- Parameters:
objects- the inputObjectCollectionobjectsRejected- optional list to store rejectedObjectMasksdimensions- optionalDimensionsof the objects- Returns:
- the created
ObjectCollection - Throws:
ProvisionFailedException- if creation fails
-
getFilter
public ObjectFilter getFilter()The filter to apply to the object collection. -
setFilter
public void setFilter(ObjectFilter filter) The filter to apply to the object collection.
-