Class ScaleImage<S>
Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.experiment.bean.task.Task<T,S>>
org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>
org.anchoranalysis.plugin.image.task.bean.scale.ScaleImage<S>
- Type Parameters:
S- shared-state for task.
- Direct Known Subclasses:
ScaleImageCommonSize,ScaleImageIndependently
public abstract class ScaleImage<S>
extends org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>
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 Summary
Fields Modifier and Type Field Description protected booleanbinaryIff true the image to be scaled is treated as a binary-mask, and interpolation during scaling ensures only two binary-values are outputted.protected org.anchoranalysis.image.bean.spatial.ScaleCalculatorscaleCalculatorCalculates what scale-factor to apply on the image. -
Constructor Summary
Constructors Constructor Description ScaleImage() -
Method Summary
Modifier and Type Method Description voidafterAllJobsAreExecuted(S sharedState, org.anchoranalysis.io.output.outputter.InputOutputContext context)org.anchoranalysis.io.output.enabled.OutputEnabledMutabledefaultOutputs()voiddoJobOnInput(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S> input)org.anchoranalysis.image.bean.interpolator.InterpolatorgetInterpolator()The interpolator to use for scaling images.org.anchoranalysis.image.bean.spatial.ScaleCalculatorgetScaleCalculator()Calculates what scale-factor to apply on the image.booleanhasVeryQuickPerInputExecution()org.anchoranalysis.experiment.task.InputTypesExpectedinputTypesExpected()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 org.anchoranalysis.image.core.stack.StackscaleStack(org.anchoranalysis.image.core.stack.Stack stack, Optional<org.anchoranalysis.image.core.dimensions.size.suggestion.ImageSizeSuggestion> suggestedSize, org.anchoranalysis.image.voxel.resizer.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(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)The interpolator to use for scaling images.voidsetScaleCalculator(org.anchoranalysis.image.bean.spatial.ScaleCalculator scaleCalculator)Calculates what scale-factor to apply on the image.Methods inherited from class org.anchoranalysis.experiment.bean.task.Task
beforeAnyJobIsExecuted, executeJob, isInputCompatibleWith
-
Field Details
-
scaleCalculator
protected org.anchoranalysis.image.bean.spatial.ScaleCalculator scaleCalculatorCalculates what scale-factor to apply on the image. -
binary
protected 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
-
ScaleImage
public ScaleImage()
-
-
Method Details
-
inputTypesExpected
public org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()- Specified by:
inputTypesExpectedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>
-
doJobOnInput
public void doJobOnInput(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S> input) throws org.anchoranalysis.experiment.JobExecutionException- Specified by:
doJobOnInputin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>- Throws:
org.anchoranalysis.experiment.JobExecutionException
-
afterAllJobsAreExecuted
public void afterAllJobsAreExecuted(S sharedState, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.ExperimentExecutionException- Specified by:
afterAllJobsAreExecutedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>- Throws:
org.anchoranalysis.experiment.ExperimentExecutionException
-
hasVeryQuickPerInputExecution
public boolean hasVeryQuickPerInputExecution()- Specified by:
hasVeryQuickPerInputExecutionin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>
-
defaultOutputs
public org.anchoranalysis.io.output.enabled.OutputEnabledMutable defaultOutputs()- Overrides:
defaultOutputsin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,S>
-
scaleStack
protected abstract org.anchoranalysis.image.core.stack.Stack scaleStack(org.anchoranalysis.image.core.stack.Stack stack, Optional<org.anchoranalysis.image.core.dimensions.size.suggestion.ImageSizeSuggestion> suggestedSize, org.anchoranalysis.image.voxel.resizer.VoxelsResizer voxelsResizer, S sharedState) throws org.anchoranalysis.core.exception.OperationFailedExceptionProduce 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:
org.anchoranalysis.core.exception.OperationFailedException- if the scaling operation fails.
-
getScaleCalculator
public org.anchoranalysis.image.bean.spatial.ScaleCalculator getScaleCalculator()Calculates what scale-factor to apply on the image. -
setScaleCalculator
public void setScaleCalculator(org.anchoranalysis.image.bean.spatial.ScaleCalculator scaleCalculator)Calculates what scale-factor to apply on the image. -
isBinary
public 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. -
setBinary
public 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. -
getInterpolator
public org.anchoranalysis.image.bean.interpolator.Interpolator getInterpolator()The interpolator to use for scaling images. -
setInterpolator
public void setInterpolator(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)The interpolator to use for scaling images.
-