Class RasterTask<S,​U>

Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.experiment.bean.task.Task<T,​S>>
org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S>
org.anchoranalysis.plugin.image.task.bean.RasterTask<S,​U>
Type Parameters:
S - shared-state type for entire task
U - shared-state type for current series i.e. for all stacks in one particular job
Direct Known Subclasses:
ConvertImageFormat

public abstract class RasterTask<S,​U>
extends org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S>
An experiment that takes (primarily) a series of raster images as an input.

An operation is executed independently on each stack in the series.

Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    RasterTask()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract U createSharedStateJob​(org.anchoranalysis.io.output.outputter.InputOutputContext context)
    Creates a shared-state for the duration of a particular input-job.
    void doJobOnInput​(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S> input)  
    abstract void doStack​(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S> input, U sharedStateJob, int seriesIndex, int numberSeries, org.anchoranalysis.io.output.outputter.InputOutputContext context)
    Processes one stack from a series.
    abstract void endSeries​(S sharedStateTask, U sharedStateJob, org.anchoranalysis.io.output.outputter.InputOutputContext context)
    Ends processing of a series.
    org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()  
    abstract void startSeries​(S sharedStateTask, U sharedStateJob, org.anchoranalysis.io.output.outputter.InputOutputContext context)
    Starts processing of a series.

    Methods inherited from class org.anchoranalysis.experiment.bean.task.Task

    afterAllJobsAreExecuted, beforeAnyJobIsExecuted, defaultOutputs, executeJob, hasVeryQuickPerInputExecution, isInputCompatibleWith

    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

  • Method Details

    • doJobOnInput

      public void doJobOnInput​(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S> input) throws org.anchoranalysis.experiment.JobExecutionException
      Specified by:
      doJobOnInput in class org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S>
      Throws:
      org.anchoranalysis.experiment.JobExecutionException
    • createSharedStateJob

      protected abstract U createSharedStateJob​(org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.JobExecutionException
      Creates a shared-state for the duration of a particular input-job.

      This will exist across all stacks from the same series.

      Parameters:
      context - the input-output context associated with a particular job
      Returns:
      a newly created shared-state
      Throws:
      org.anchoranalysis.experiment.JobExecutionException - if an error occurs during job execution
    • startSeries

      public abstract void startSeries​(S sharedStateTask, U sharedStateJob, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.JobExecutionException
      Starts processing of a series.

      This corresponds to the start of an input job, before any stacks in the series are processed.

      This should be called always once before all calls to doStack(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput, S>, U, int, int, org.anchoranalysis.io.output.outputter.InputOutputContext).

      Parameters:
      sharedStateTask - shared-state across all jobs in task
      sharedStateJob - shared-state across all stacks in a job (i.e. in all series)
      context - input-output context
      Throws:
      org.anchoranalysis.experiment.JobExecutionException - if an error occurs during job execution
    • doStack

      public abstract void doStack​(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S> input, U sharedStateJob, int seriesIndex, int numberSeries, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.JobExecutionException
      Processes one stack from a series.

      This can be called many times in a job, once for each stack in the series.

      It is assumed each job may have only one series.

      Parameters:
      input - the input-object corresponding to this stack (a set of named-channels)
      sharedStateJob - shared-state across all stacks in a job (i.e. in all series)
      seriesIndex - the index of the input that is being currently processed from the series
      numberSeries - the total number of images in the series (constant for a given task)
      context - IO context
      Throws:
      org.anchoranalysis.experiment.JobExecutionException - if an error occurs during job execution
    • endSeries

      public abstract void endSeries​(S sharedStateTask, U sharedStateJob, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.JobExecutionException
      Ends processing of a series.

      This corresponds to the end of an input job, after any stacks in the series are processed.

      This should be called always once after all calls to doStack(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput, S>, U, int, int, org.anchoranalysis.io.output.outputter.InputOutputContext).

      Parameters:
      sharedStateTask - shared-state across all jobs in task
      sharedStateJob - shared-state across all stacks in a job (i.e. in all series)
      context - input-output context
      Throws:
      org.anchoranalysis.experiment.JobExecutionException - if an error occurs during job execution
    • inputTypesExpected

      public org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()
      Specified by:
      inputTypesExpected in class org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,​S>