Class ScaleImageCommonSize
Object
AnchorBean<Task<StackSequenceInput, CommonSize>>
Task<StackSequenceInput, CommonSize>
Creates a scaled copy of images, ensuring all images have identical output size.
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.
- Author:
- Owen Feehan
-
Field Summary
Fields inherited from class org.anchoranalysis.plugin.image.task.bean.scale.ScaleImage
binary, scaleCalculator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<StackSequenceInput> inputs, ParametersExperiment parameters) AligngetAlign()How a smaller image (after scaling) is aligned to the larger image (with the common size).intThe background intensity to use in each channel when the scaled image does not cover the entire canvas.ImageMetadataReaderHow to read theImageMetadatafrom the file-system.StackReaderFallback forimageMetadataReaderto read image files without a direct metadata reader.protected StackscaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, CommonSize sharedState) Produce a scaled version of aStack, mapping each channel to a scaled version of itself.voidsetAlign(Align align) How a smaller image (after scaling) is aligned to the larger image (with the common size).voidsetBackgroundIntensity(int backgroundIntensity) The background intensity to use in each channel when the scaled image does not cover the entire canvas.voidsetImageMetadataReader(ImageMetadataReader imageMetadataReader) How to read theImageMetadatafrom the file-system.voidsetStackReader(StackReader stackReader) Fallback forimageMetadataReaderto read image files without a direct metadata reader.Methods inherited from class org.anchoranalysis.plugin.image.task.bean.scale.ScaleImage
afterAllJobsAreExecuted, defaultOutputs, doJobOnInput, getInterpolator, getScaleCalculator, hasVeryQuickPerInputExecution, inputTypesExpected, isBinary, setBinary, setInterpolator, setScaleCalculatorMethods inherited from class org.anchoranalysis.experiment.bean.task.Task
executeJob, isInputCompatibleWithMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ScaleImageCommonSize
public ScaleImageCommonSize()
-
-
Method Details
-
beforeAnyJobIsExecuted
public CommonSize beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<StackSequenceInput> inputs, ParametersExperiment parameters) throws ExperimentExecutionException - Specified by:
beforeAnyJobIsExecutedin classTask<StackSequenceInput, CommonSize>- Throws:
ExperimentExecutionException
-
scaleStack
protected Stack scaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, CommonSize sharedState) throws OperationFailedException Description copied from class:ScaleImageProduce a scaled version of aStack, mapping each channel to a scaled version of itself.- Specified by:
scaleStackin classScaleImage<CommonSize>- 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.
-
getImageMetadataReader
public ImageMetadataReader getImageMetadataReader()How to read theImageMetadatafrom the file-system. -
setImageMetadataReader
public void setImageMetadataReader(ImageMetadataReader imageMetadataReader) How to read theImageMetadatafrom the file-system. -
getStackReader
public StackReader getStackReader()Fallback forimageMetadataReaderto read image files without a direct metadata reader. -
setStackReader
public void setStackReader(StackReader stackReader) Fallback forimageMetadataReaderto read image files without a direct metadata reader. -
getAlign
public Align getAlign()How a smaller image (after scaling) is aligned to the larger image (with the common size).e.g. centered, left-aligned etc. in each dimension.
-
setAlign
public void setAlign(Align align) How a smaller image (after scaling) is aligned to the larger image (with the common size).e.g. centered, left-aligned etc. in each dimension.
-
getBackgroundIntensity
public int getBackgroundIntensity()The background intensity to use in each channel when the scaled image does not cover the entire canvas.0 would create black, 255 would create white.
-
setBackgroundIntensity
public void setBackgroundIntensity(int backgroundIntensity) The background intensity to use in each channel when the scaled image does not cover the entire canvas.0 would create black, 255 would create white.
-