Interface Pipeline


public interface Pipeline
Pipelines are used to apply a sequence of Processors to Images prior to those images being inserted into a Datastore. You can create a new Pipeline by using the DataManager.createPipeline() or DataManager.copyApplicationPipeline() methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the list of exceptions that the pipeline has encountered, allowing insertImage() to be called again.
    Get the output Datastore for this Pipeline.
    Return a list containing any exceptions that have occurred during processing of images.
    default boolean
    Deprecated.
    Use isSynchronous() instead.
    Return the list of Processors used by this Pipeline.
    void
    Halt image processing, so that the Pipeline will not produce any more images.
    void
    Insert an Image into the Pipeline.
    void
    Pass a SummaryMetadata through the Pipeline to be modified by the Processors in it.
    boolean
    Returns true if the pipeline has been halted (that is, its halt() method has been executed to completion), false otherwise.
    boolean
    Return whether the Pipeline is operating in synchronous or asynchronous modes.
  • Method Details

    • insertSummaryMetadata

      void insertSummaryMetadata(SummaryMetadata source) throws IOException, PipelineErrorException
      Pass a SummaryMetadata through the Pipeline to be modified by the Processors in it. The resulting, updated SummaryMetadata will be set into the Datastore. This method may only be called if the Datastore does not already have SummaryMetadata set for it, and only prior to any images being inserted into the Pipeline by the insertImage() method. This method is synchronous even for asynchronous Pipelines.
      Parameters:
      source - Source SummaryMetadata to be input into the Pipeline.
      Throws:
      DatastoreFrozenException - if the Datastore is frozen at the time this method is called.
      DatastoreRewriteException - if the Datastore has already had SummaryMetadata set for it at the time this method is called.
      PipelineErrorException - if processing of images has already started at the time this method is called.
      IOException
    • insertImage

      void insertImage(Image image) throws IOException, PipelineErrorException
      Insert an Image into the Pipeline. The Image will be processed by the first Processor in the Pipeline, any Images output by that Processor will be processed by the second Processor, etc. until the Image sequence reaches the end of the Pipeline, at which point those result Images will be stored in any attached Datastores (see addDatastore, below).

      If the Pipeline is in synchronous mode, then this call will block until any generated images are in the Datastore. If it is in asynchronous mode, then the call will return as soon as the first processor in the pipeline is ready to start processing (i.e. as soon as it is not busy processing a different image).

      If the Pipeline has been halted, then the image will be silently discarded, and no processing of it will occur.

      If any of the Processors in the Pipeline throws an exception during processing, then the Pipeline will be put into an error state, and attempts to call insertImage() will throw a PipelineErrorException. You can retrieve the exception(s) that occurred by calling getExceptions(). If you wish to continue inserting images into the Pipeline (despite the fact that it may be in an inconsistent state, resulting in incorrect processed images), then you must call clearExceptions() first.

      Parameters:
      image - Image to be processed by the Pipeline.
      Throws:
      DatastoreFrozenException - if the Datastore is frozen at the time this method is called, or if this pipeline has no Processors in it and the Datastore is frozen. If the Datastore is frozen at some point after this method is called, then the exception will not be thrown.
      DatastoreRewriteException - if this pipeline has no Processors in it and the inserted Image has coordinates that match an Image that is already in the Datastore.
      PipelineErrorException - if the pipeline is in an error state; see the getExceptions() and clearExceptions() methods.
      IOException
    • getDatastore

      Datastore getDatastore()
      Get the output Datastore for this Pipeline. This Datastore is the ultimate recipient of Images that have been processed by the Pipeline.
      Returns:
      output Datastore for this Pipeline
    • isSynchronous

      boolean isSynchronous()
      Return whether the Pipeline is operating in synchronous or asynchronous modes. See DataManager.createPipeline() for more information.
      Returns:
      True if the Pipeline is synchronous, False otherwise.
    • getIsSynchronous

      @Deprecated default boolean getIsSynchronous()
      Deprecated.
      Use isSynchronous() instead.
      Deprecated.
    • halt

      void halt()
      Halt image processing, so that the Pipeline will not produce any more images. Once halted, a Pipeline cannot be resumed; create a new one instead. This method will block until all processors along the chain are known to be done doing any processing (that is, their processImage() calls have completed), regardless of whether or not the pipeline as a whole is synchronous. Consequently, once this method returns, it should be safe to freeze the Datastore and save it to disk.
    • isHalted

      boolean isHalted()
      Returns true if the pipeline has been halted (that is, its halt() method has been executed to completion), false otherwise. If this method returns true, then the pipeline cannot generate any more images.
    • getExceptions

      List<Exception> getExceptions()
      Return a list containing any exceptions that have occurred during processing of images. If this list has any elements in it, then calls to insertImage() will provoke a PipelineErrorException.
      Returns:
      list containing any exceptions that have occurred during processing of images
    • clearExceptions

      void clearExceptions()
      Clear the list of exceptions that the pipeline has encountered, allowing insertImage() to be called again. Note that if exceptions have occurred, then the pipeline may be in an inconsistent state, causing processed image data to be incorrect.
    • getProcessors

      List<Processor> getProcessors()
      Return the list of Processors used by this Pipeline.