Class ObjectCollectionProviderFilterBase

Object
AnchorBean<ObjectCollectionProvider>
InitializableBean<ObjectCollectionProvider, ImageInitialization>
ImageBean<ObjectCollectionProvider>
ObjectCollectionProvider
ObjectCollectionProviderUnary
WithOptionalDimensionsBase
ObjectCollectionProviderFilterBase
All Implemented Interfaces:
Provider<ObjectCollection>
Direct Known Subclasses:
Filter, FilterByGroup

public abstract class ObjectCollectionProviderFilterBase extends WithOptionalDimensionsBase
Base class for object collection providers that apply a filter to the objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    ObjectCollection
    createFromObjects(ObjectCollection objects)
     
    protected abstract ObjectCollection
    createFromObjects(ObjectCollection objects, Optional<List<ObjectMask>> objectsRejected, Optional<Dimensions> dimensions)
    Creates an ObjectCollection from the given objects, potentially applying a filter and considering dimensions.
    protected ObjectCollection
    filter(ObjectCollection objects, Optional<Dimensions> dimensions, Optional<List<ObjectMask>> objectsRejected)
    Filters the given object collection using the specified filter.
    ObjectFilter
    The filter to apply to the object collection.
    void
    setFilter(ObjectFilter filter)
    The filter to apply to the object collection.

    Methods inherited from class org.anchoranalysis.plugin.image.bean.object.provider.WithOptionalDimensionsBase

    createDims, getDimensions, setDimensions

    Methods inherited from class org.anchoranalysis.image.bean.provider.ObjectCollectionProviderUnary

    get, getObjects, setObjects

    Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean

    getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ObjectCollectionProviderFilterBase

      public ObjectCollectionProviderFilterBase()
  • Method Details

    • createFromObjects

      public ObjectCollection createFromObjects(ObjectCollection objects) throws ProvisionFailedException
      Specified by:
      createFromObjects in class ObjectCollectionProviderUnary
      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 - the ObjectCollection to filter
      dimensions - optional Dimensions of the objects
      objectsRejected - optional list to store rejected ObjectMasks
      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 an ObjectCollection from the given objects, potentially applying a filter and considering dimensions.
      Parameters:
      objects - the input ObjectCollection
      objectsRejected - optional list to store rejected ObjectMasks
      dimensions - optional Dimensions of 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.