Class ConvertNamedChannels<T extends NamedChannelsInput,S,U extends InputFromManager>
Object
AnchorBean<Task<T,SharedStateRememberConverted<U,S>>>
Task<T,SharedStateRememberConverted<U,S>>
ConvertNamedChannels<T,S,U>
- Type Parameters:
T
- the named-channels-input we expect to receiveS
- shared-state of the taskU
- the named-channels-input the delegate task contains
- All Implemented Interfaces:
ReplaceTask<U,
S>
public class ConvertNamedChannels<T extends NamedChannelsInput,S,U extends InputFromManager>
extends Task<T,SharedStateRememberConverted<U,S>>
implements ReplaceTask<U,S>
Converts
NamedChannelsInput
to a variety of others to match a delegate task.
The other types, to which a NamedChannelsInput
will be converted are:
Note that the presence of ReplaceTask
gives special behavior to this task in the
JobProcessor
.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAllJobsAreExecuted
(SharedStateRememberConverted<U, S> sharedState, InputOutputContext context) Called once after all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.beforeAnyJobIsExecuted
(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<T> inputs, ParametersExperiment parameters) Called once before all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.If specified, default rules for determine which outputs are enabled or not.void
doJobOnInput
(InputBound<T, SharedStateRememberConverted<U, S>> inputBound) Performs the task on a particular input.Supplies to theimageMetadataReader
to use, if no other reader is specified.How to read theImageMetadata
from the file-system.getTask()
The underlying task that will be called, perhaps with a different input-type.boolean
Is the execution-time of the task per-input expected to be very quick to execute?Highest class(es) that will function as a valid input.void
replaceTask
(Task<U, S> taskToReplace) Replace the currently-assignedTask
with another.void
setDefaultStackReaderForMetadata
(StackReader defaultStackReaderForMetadata) Supplies to theimageMetadataReader
to use, if no other reader is specified.void
setImageMetadataReader
(ImageMetadataReader imageMetadataReader) How to read theImageMetadata
from the file-system.void
The underlying task that will be called, perhaps with a different input-type.Methods inherited from class org.anchoranalysis.experiment.bean.task.Task
executeJob, isInputCompatibleWith
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ConvertNamedChannels
public ConvertNamedChannels()
-
-
Method Details
-
beforeAnyJobIsExecuted
public SharedStateRememberConverted<U,S> beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<T> inputs, ParametersExperiment parameters) throws ExperimentExecutionException Description copied from class:Task
Called once before all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.- Specified by:
beforeAnyJobIsExecuted
in classTask<T extends NamedChannelsInput,
SharedStateRememberConverted<U extends InputFromManager, S>> - Parameters:
outputter
- the output-manager for the experiment (not for an individual job)concurrencyPlan
- available numbers of processors that can callTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
inputs
- a list of inputs, each will result in at least one call toTask.executeJob(ParametersUnbound)
.parameters
- the experiment-parameters.- Returns:
- the shared-state that is passed to each call to
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
and toTask.afterAllJobsAreExecuted(S, org.anchoranalysis.io.output.outputter.InputOutputContext)
. - Throws:
ExperimentExecutionException
- if a fatal error occurs executing this step of the experiment.
-
doJobOnInput
public void doJobOnInput(InputBound<T, SharedStateRememberConverted<U, throws JobExecutionExceptionS>> inputBound) Description copied from class:Task
Performs the task on a particular input.- Specified by:
doJobOnInput
in classTask<T extends NamedChannelsInput,
SharedStateRememberConverted<U extends InputFromManager, S>> - Parameters:
inputBound
- the input for the job.- Throws:
JobExecutionException
- if an error occurs executing a particular job, that is not otherwise suppressed.
-
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<T extends NamedChannelsInput,
SharedStateRememberConverted<U extends InputFromManager, S>> - Returns:
- the input-types that a task expects.
-
hasVeryQuickPerInputExecution
public boolean hasVeryQuickPerInputExecution()Description copied from class:Task
Is the execution-time of the task per-input expected to be very quick to execute?- Specified by:
hasVeryQuickPerInputExecution
in classTask<T extends NamedChannelsInput,
SharedStateRememberConverted<U extends InputFromManager, S>> - Returns:
- true iff the execution is expected to be very quick, false otherwise.
-
replaceTask
Description copied from interface:ReplaceTask
Replace the currently-assignedTask
with another.- Specified by:
replaceTask
in interfaceReplaceTask<T extends NamedChannelsInput,
S> - Parameters:
taskToReplace
- the task to replace.- Throws:
OperationFailedException
- if the task cannot be successfully replaced.
-
defaultOutputs
Description copied from class:Task
If specified, default rules for determine which outputs are enabled or not.- Overrides:
defaultOutputs
in classTask<T extends NamedChannelsInput,
SharedStateRememberConverted<U extends InputFromManager, S>> - Returns:
- the default rules if they exist.
-
getTask
The underlying task that will be called, perhaps with a different input-type. -
setTask
The underlying task that will be called, perhaps with a different input-type. -
getImageMetadataReader
How to read theImageMetadata
from the file-system. -
setImageMetadataReader
How to read theImageMetadata
from the file-system. -
getDefaultStackReaderForMetadata
Supplies to theimageMetadataReader
to use, if no other reader is specified. -
setDefaultStackReaderForMetadata
Supplies to theimageMetadataReader
to use, if no other reader is specified.
-