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
An operation is executed independently on each stack in the series.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract U
createSharedStateJob
(InputOutputContext context) Creates a shared-state for the duration of a particular input-job.void
doJobOnInput
(InputBound<NamedChannelsInput, S> input) Performs the task on a particular 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.Highest class(es) that will function as a valid input.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
-
Constructor Details
-
RasterTask
public RasterTask()
-
-
Method Details
-
doJobOnInput
Description copied from class:Task
Performs the task on a particular input.- Specified by:
doJobOnInput
in classTask<NamedChannelsInput,
S> - Parameters:
input
- the input for the job.- Throws:
JobExecutionException
- if an error occurs executing a particular job, that is not otherwise suppressed.
-
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 tasksharedStateJob
- 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 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:
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 tasksharedStateJob
- 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
Description copied from class:Task
Highest class(es) that will function as a valid input.This is usually the class of T (or sometimes the absolute base class InputFromManager).
- Specified by:
inputTypesExpected
in classTask<NamedChannelsInput,
S> - Returns:
- the input-types that a task expects.
-