Class RasterTask<S,U>
- Type Parameters:
S- shared-state type for entire taskU- 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 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 UcreateSharedStateJob(org.anchoranalysis.io.output.outputter.InputOutputContext context)Creates a shared-state for the duration of a particular input-job.voiddoJobOnInput(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,S> input)abstract voiddoStack(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 voidendSeries(S sharedStateTask, U sharedStateJob, org.anchoranalysis.io.output.outputter.InputOutputContext context)Ends processing of a series.org.anchoranalysis.experiment.task.InputTypesExpectedinputTypesExpected()abstract voidstartSeries(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
-
Constructor Details
-
RasterTask
public RasterTask()
-
-
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:
doJobOnInputin classorg.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.JobExecutionExceptionCreates 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.JobExecutionExceptionStarts 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 tasksharedStateJob- 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.JobExecutionExceptionProcesses 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 seriesnumberSeries- 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.JobExecutionExceptionEnds 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 tasksharedStateJob- 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:
inputTypesExpectedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.channel.input.NamedChannelsInput,S>
-