public class ScaleImageCommonSize extends ScaleImage<CommonSize>
When given input images of either varying or identical size, it will produce outputs of identical (scaled) size.
Whenever the scaled image is smaller than the output size, it is aligned (e.g. centered) and unused pixels are assigned the background color of 0.
binary, scaleCalculator
Constructor and Description |
---|
ScaleImageCommonSize() |
Modifier and Type | Method and Description |
---|---|
CommonSize |
beforeAnyJobIsExecuted(Outputter outputter,
ConcurrencyPlan concurrencyPlan,
List<StackSequenceInput> inputs,
ParametersExperiment parameters)
Called once before all calls to
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>) . |
Align |
getAlign()
How a smaller image (after scaling) is aligned to the larger image (with the common size).
|
int |
getBackgroundIntensity()
The background intensity to use in each channel when the scaled image does not cover the
entire canvas.
|
ImageMetadataReader |
getImageMetadataReader()
How to read the
ImageMetadata from the file-system. |
StackReader |
getStackReader()
Fallback for
imageMetadataReader to read image files without a direct metadata
reader. |
protected Stack |
scaleStack(Stack stack,
Optional<ImageSizeSuggestion> suggestedSize,
VoxelsResizer voxelsResizer,
CommonSize sharedState)
Produce a scaled version of a
Stack , mapping each channel to a scaled version of
itself. |
void |
setAlign(Align align)
How a smaller image (after scaling) is aligned to the larger image (with the common size).
|
void |
setBackgroundIntensity(int backgroundIntensity)
The background intensity to use in each channel when the scaled image does not cover the
entire canvas.
|
void |
setImageMetadataReader(ImageMetadataReader imageMetadataReader)
How to read the
ImageMetadata from the file-system. |
void |
setStackReader(StackReader stackReader)
Fallback for
imageMetadataReader to read image files without a direct metadata
reader. |
afterAllJobsAreExecuted, defaultOutputs, doJobOnInput, getInterpolator, getScaleCalculator, hasVeryQuickPerInputExecution, inputTypesExpected, isBinary, setBinary, setInterpolator, setScaleCalculator
executeJob, isInputCompatibleWith
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public CommonSize beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<StackSequenceInput> inputs, ParametersExperiment parameters) throws ExperimentExecutionException
Task
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.beforeAnyJobIsExecuted
in class Task<StackSequenceInput,CommonSize>
outputter
- the output-manager for the experiment (not for an individual job)concurrencyPlan
- available numbers of processors that can call Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
inputs
- a list of inputs, each will result in at least one call to Task.executeJob(ParametersUnbound)
.parameters
- the experiment-parameters.Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
and to Task.afterAllJobsAreExecuted(S, org.anchoranalysis.io.output.outputter.InputOutputContext)
.ExperimentExecutionException
- if a fatal error occurs executing this step of the
experiment.protected Stack scaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, CommonSize sharedState) throws OperationFailedException
ScaleImage
Stack
, mapping each channel to a scaled version of
itself.scaleStack
in class ScaleImage<CommonSize>
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 ImageMetadataReader getImageMetadataReader()
ImageMetadata
from the file-system.public void setImageMetadataReader(ImageMetadataReader imageMetadataReader)
ImageMetadata
from the file-system.public StackReader getStackReader()
imageMetadataReader
to read image files without a direct metadata
reader.public void setStackReader(StackReader stackReader)
imageMetadataReader
to read image files without a direct metadata
reader.public Align getAlign()
e.g. centered, left-aligned etc. in each dimension.
public void setAlign(Align align)
e.g. centered, left-aligned etc. in each dimension.
public int getBackgroundIntensity()
0 would create black, 255 would create white.
public void setBackgroundIntensity(int backgroundIntensity)
0 would create black, 255 would create white.
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.