S
- shared-state type for entire taskU
- shared-state type for current series i.e. for all stacks in one particular jobpublic abstract class RasterTask<S,U> extends Task<NamedChannelsInput,S>
An operation is executed independently on each stack in the series.
Constructor and Description |
---|
RasterTask() |
Modifier and Type | Method and 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)
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.
|
InputTypesExpected |
inputTypesExpected()
Highest class(es) that will function as a valid input.
|
abstract void |
startSeries(S sharedStateTask,
U sharedStateJob,
InputOutputContext context)
Starts processing of a series.
|
afterAllJobsAreExecuted, beforeAnyJobIsExecuted, defaultOutputs, executeJob, hasVeryQuickPerInputExecution, isInputCompatibleWith
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public void doJobOnInput(InputBound<NamedChannelsInput,S> input) throws JobExecutionException
Task
doJobOnInput
in class Task<NamedChannelsInput,S>
input
- the input for the job.JobExecutionException
- if an error occurs executing a particular job, that is not
otherwise suppressed.protected abstract U createSharedStateJob(InputOutputContext context) throws JobExecutionException
This will exist across all stacks from the same series.
context
- the input-output cotnext associated with a particular jobJobExecutionException
public abstract void startSeries(S sharedStateTask, U sharedStateJob, InputOutputContext context) throws JobExecutionException
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)
.
sharedStateTask
- shared-state across all jobs in tasksharedStateJob
- shared-state across all stacks in a job (i.e. in all series.)context
- input-output contextJobExecutionException
public abstract void doStack(InputBound<NamedChannelsInput,S> input, U sharedStateJob, int seriesIndex, int numberSeries, InputOutputContext context) throws JobExecutionException
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.
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 contextJobExecutionException
public abstract void endSeries(S sharedStateTask, U sharedStateJob, InputOutputContext context) throws JobExecutionException
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)
.
sharedStateTask
- shared-state across all jobs in tasksharedStateJob
- shared-state across all stacks in a job (i.e. in all series.)context
- input-output contextJobExecutionException
public InputTypesExpected inputTypesExpected()
Task
This is usually the class of T (or sometimes the absolute base class InputFromManager).
inputTypesExpected
in class Task<NamedChannelsInput,S>
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.