Class RasterTask<S,U>

Object
AnchorBean<Task<NamedChannelsInput, S>>
Task<NamedChannelsInput, S>
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 Task<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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract U
    createSharedStateJob(InputOutputContext context)
    Creates a shared-state for the duration of a particular input-job.
    void
    doJobOnInput(InputBound<NamedChannelsInput, S> input)
     
    abstract void
    doStack(InputBound<NamedChannelsInput, S> input, U sharedStateJob, int seriesIndex, int numberSeries, InputOutputContext context)
    Processes one stack from a series.
    abstract void
    endSeries(S sharedStateTask, U sharedStateJob, InputOutputContext context)
    Ends processing of a series.
    InputTypesExpected
     
    abstract void
    startSeries(S sharedStateTask, U sharedStateJob, 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

    • RasterTask

      public RasterTask()
  • Method Details

    • doJobOnInput

      public void doJobOnInput(InputBound<NamedChannelsInput, S> input) throws JobExecutionException
      Specified by:
      doJobOnInput in class Task<NamedChannelsInput, S>
      Throws:
      JobExecutionException
    • createSharedStateJob

      protected abstract U createSharedStateJob(InputOutputContext context) throws 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:
      JobExecutionException - if an error occurs during job execution
    • startSeries

      public abstract void startSeries(S sharedStateTask, U sharedStateJob, InputOutputContext context) throws 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:
      JobExecutionException - if an error occurs during job execution
    • doStack

      public abstract void doStack(InputBound<NamedChannelsInput, S> input, U sharedStateJob, int seriesIndex, int numberSeries, InputOutputContext context) throws 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:
      JobExecutionException - if an error occurs during job execution
    • endSeries

      public abstract void endSeries(S sharedStateTask, U sharedStateJob, InputOutputContext context) throws 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:
      JobExecutionException - if an error occurs during job execution
    • inputTypesExpected

      public InputTypesExpected inputTypesExpected()
      Specified by:
      inputTypesExpected in class Task<NamedChannelsInput, S>