S
- shared-state for task.public abstract class ScaleImage<S> extends Task<StackSequenceInput,S>
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 |
---|---|---|
yes | A scaled copy of the input image. | |
no | A scaled copy of the maximum-intensity-projection of the input image. | |
inherited from Task |
Modifier and Type | Field and Description |
---|---|
protected 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.
|
protected ScaleCalculator |
scaleCalculator
Calculates what scale-factor to apply on the image.
|
Constructor and Description |
---|
ScaleImage() |
Modifier and Type | Method and Description |
---|---|
void |
afterAllJobsAreExecuted(S sharedState,
InputOutputContext context)
Called once after all calls to
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>) . |
OutputEnabledMutable |
defaultOutputs()
If specified, default rules for determine which outputs are enabled or not.
|
void |
doJobOnInput(InputBound<StackSequenceInput,S> input)
Performs the task on a particular input.
|
Interpolator |
getInterpolator()
The interpolator to use for scaling images.
|
ScaleCalculator |
getScaleCalculator()
Calculates what scale-factor to apply on the image.
|
boolean |
hasVeryQuickPerInputExecution()
Is the execution-time of the task per-input expected to be very quick to execute?
|
InputTypesExpected |
inputTypesExpected()
Highest class(es) that will function as a valid input.
|
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.
|
protected abstract Stack |
scaleStack(Stack stack,
Optional<ImageSizeSuggestion> suggestedSize,
VoxelsResizer voxelsResizer,
S sharedState)
Produce a scaled version of a
Stack , mapping each channel to a scaled version of
itself. |
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.
|
void |
setInterpolator(Interpolator interpolator)
The interpolator to use for scaling images.
|
void |
setScaleCalculator(ScaleCalculator scaleCalculator)
Calculates what scale-factor to apply on the image.
|
beforeAnyJobIsExecuted, executeJob, isInputCompatibleWith
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
protected ScaleCalculator scaleCalculator
protected boolean binary
public InputTypesExpected inputTypesExpected()
Task
This is usually the class of T (or sometimes the absolute base class InputFromManager).
inputTypesExpected
in class Task<StackSequenceInput,S>
public void doJobOnInput(InputBound<StackSequenceInput,S> input) throws JobExecutionException
Task
doJobOnInput
in class Task<StackSequenceInput,S>
input
- the input for the job.JobExecutionException
- if an error occurs executing a particular job, that is not
otherwise suppressed.public void afterAllJobsAreExecuted(S sharedState, InputOutputContext context) throws ExperimentExecutionException
Task
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.afterAllJobsAreExecuted
in class Task<StackSequenceInput,S>
sharedState
- the shared-statecontext
- IO-context for experiment (not for an individual job)ExperimentExecutionException
- if a fatal error occurs executing this step of the
experiment.public boolean hasVeryQuickPerInputExecution()
Task
hasVeryQuickPerInputExecution
in class Task<StackSequenceInput,S>
public OutputEnabledMutable defaultOutputs()
Task
defaultOutputs
in class Task<StackSequenceInput,S>
protected abstract Stack scaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, S sharedState) throws OperationFailedException
Stack
, mapping each channel to a scaled version of
itself.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.OperationFailedException
public ScaleCalculator getScaleCalculator()
public void setScaleCalculator(ScaleCalculator scaleCalculator)
public boolean isBinary()
public void setBinary(boolean binary)
public Interpolator getInterpolator()
public void setInterpolator(Interpolator interpolator)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.