Class ScaleImage<S>
- Type Parameters:
- S- shared-state for task.
- Direct Known Subclasses:
- ScaleImageCommonSize,- ScaleImageIndependently
Base class for tasks whose primary aim is to scale (resize) an image.
 
 
An RGB image is treated as a single-stack, otherwise each channel is scaled and outputted separately.
Second-level output keys for scaled and/or scaledFlattened additionally determine which stacks get outputted or not.
Any z-dimension present is unaffected by the scaling in scaled.
 
The following outputs are produced:
| Output Name | Default? | Description | 
|---|---|---|
| "scaled" | yes | A scaled copy of the input image. | 
| "scaledFlattened" | no | A scaled copy of the maximum-intensity-projection of the input image. | 
| inherited from Task | 
- Author:
- Owen Feehan
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanIff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.protected ScaleCalculatorCalculates what scale-factor to apply on the image.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidafterAllJobsAreExecuted(S sharedState, InputOutputContext context) Called once after all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>).If specified, default rules for determine which outputs are enabled or not.voiddoJobOnInput(InputBound<StackSequenceInput, S> input) Performs the task on a particular input.The interpolator to use for scaling images.Calculates what scale-factor to apply on the image.booleanIs 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.booleanisBinary()Iff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.protected abstract StackscaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, S sharedState) Produce a scaled version of aStack, mapping each channel to a scaled version of itself.voidsetBinary(boolean binary) Iff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.voidsetInterpolator(Interpolator interpolator) The interpolator to use for scaling images.voidsetScaleCalculator(ScaleCalculator scaleCalculator) Calculates what scale-factor to apply on the image.Methods inherited from class org.anchoranalysis.experiment.bean.task.TaskbeforeAnyJobIsExecuted, executeJob, isInputCompatibleWithMethods inherited from class org.anchoranalysis.bean.AnchorBeancheckMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
- 
Field Details- 
scaleCalculatorCalculates what scale-factor to apply on the image.
- 
binaryprotected boolean binaryIff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.
 
- 
- 
Constructor Details- 
ScaleImagepublic ScaleImage()
 
- 
- 
Method Details- 
inputTypesExpectedDescription copied from class:TaskHighest 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:
- inputTypesExpectedin class- Task<StackSequenceInput,- S> 
- Returns:
- the input-types that a task expects.
 
- 
doJobOnInputDescription copied from class:TaskPerforms the task on a particular input.- Specified by:
- doJobOnInputin class- Task<StackSequenceInput,- S> 
- Parameters:
- input- the input for the job.
- Throws:
- JobExecutionException- if an error occurs executing a particular job, that is not otherwise suppressed.
 
- 
afterAllJobsAreExecutedpublic void afterAllJobsAreExecuted(S sharedState, InputOutputContext context) throws ExperimentExecutionException Description copied from class:TaskCalled once after all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>).- Specified by:
- afterAllJobsAreExecutedin class- Task<StackSequenceInput,- S> 
- Parameters:
- sharedState- the shared-state
- context- IO-context for experiment (not for an individual job)
- Throws:
- ExperimentExecutionException- if a fatal error occurs executing this step of the experiment.
 
- 
hasVeryQuickPerInputExecutionpublic boolean hasVeryQuickPerInputExecution()Description copied from class:TaskIs the execution-time of the task per-input expected to be very quick to execute?- Specified by:
- hasVeryQuickPerInputExecutionin class- Task<StackSequenceInput,- S> 
- Returns:
- true iff the execution is expected to be very quick, false otherwise.
 
- 
defaultOutputsDescription copied from class:TaskIf specified, default rules for determine which outputs are enabled or not.- Overrides:
- defaultOutputsin class- Task<StackSequenceInput,- S> 
- Returns:
- the default rules if they exist.
 
- 
scaleStackprotected abstract Stack scaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, S sharedState) throws OperationFailedException Produce a scaled version of aStack, mapping each channel to a scaled version of itself.- Parameters:
- stack- the stack before scaling.
- suggestedSize- the suggested-size that has been passed into the task.
- voxelsResizer- how to resize the voxels in a channel.
- sharedState- the shared-state of the task.
- Returns:
- the scaled version of the stack.
- Throws:
- OperationFailedException- if the scaling operation fails.
 
- 
getScaleCalculatorCalculates what scale-factor to apply on the image.
- 
setScaleCalculatorCalculates what scale-factor to apply on the image.
- 
isBinarypublic boolean isBinary()Iff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.
- 
setBinarypublic void setBinary(boolean binary) Iff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.
- 
getInterpolatorThe interpolator to use for scaling images.
- 
setInterpolatorThe interpolator to use for scaling images.
 
-