Class ScaleImageCommonSize
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<CommonSize>
org.anchoranalysis.plugin.image.task.bean.scale.ScaleImageCommonSize
public class ScaleImageCommonSize extends ScaleImage<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 Constructor Description ScaleImageCommonSize() -
Method Summary
Modifier and Type Method Description CommonSizebeforeAnyJobIsExecuted(org.anchoranalysis.io.output.outputter.Outputter outputter, org.anchoranalysis.inference.concurrency.ConcurrencyPlan concurrencyPlan, List<org.anchoranalysis.image.io.stack.input.StackSequenceInput> inputs, org.anchoranalysis.experiment.task.ParametersExperiment parameters)org.anchoranalysis.image.bean.spatial.arrange.align.AligngetAlign()How a smaller image (after scaling) is aligned to the larger image (with the common size).intgetBackgroundIntensity()The background intensity to use in each channel when the scaled image does not cover the entire canvas.org.anchoranalysis.image.io.bean.stack.metadata.reader.ImageMetadataReadergetImageMetadataReader()How to read theImageMetadatafrom the file-system.org.anchoranalysis.image.io.bean.stack.reader.StackReadergetStackReader()Fallback forimageMetadataReaderto read image files without a direct metadata reader.protected 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, CommonSize sharedState)Produce a scaled version of aStack, mapping each channel to a scaled version of itself.voidsetAlign(org.anchoranalysis.image.bean.spatial.arrange.align.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(org.anchoranalysis.image.io.bean.stack.metadata.reader.ImageMetadataReader imageMetadataReader)How to read theImageMetadatafrom the file-system.voidsetStackReader(org.anchoranalysis.image.io.bean.stack.reader.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, isInputCompatibleWith
-
Constructor Details
-
ScaleImageCommonSize
public ScaleImageCommonSize()
-
-
Method Details
-
beforeAnyJobIsExecuted
public CommonSize beforeAnyJobIsExecuted(org.anchoranalysis.io.output.outputter.Outputter outputter, org.anchoranalysis.inference.concurrency.ConcurrencyPlan concurrencyPlan, List<org.anchoranalysis.image.io.stack.input.StackSequenceInput> inputs, org.anchoranalysis.experiment.task.ParametersExperiment parameters) throws org.anchoranalysis.experiment.ExperimentExecutionException- Specified by:
beforeAnyJobIsExecutedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,CommonSize>- Throws:
org.anchoranalysis.experiment.ExperimentExecutionException
-
scaleStack
protected 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, CommonSize sharedState) throws org.anchoranalysis.core.exception.OperationFailedExceptionDescription 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:
org.anchoranalysis.core.exception.OperationFailedException- if the scaling operation fails.
-
getImageMetadataReader
public org.anchoranalysis.image.io.bean.stack.metadata.reader.ImageMetadataReader getImageMetadataReader()How to read theImageMetadatafrom the file-system. -
setImageMetadataReader
public void setImageMetadataReader(org.anchoranalysis.image.io.bean.stack.metadata.reader.ImageMetadataReader imageMetadataReader)How to read theImageMetadatafrom the file-system. -
getStackReader
public org.anchoranalysis.image.io.bean.stack.reader.StackReader getStackReader()Fallback forimageMetadataReaderto read image files without a direct metadata reader. -
setStackReader
public void setStackReader(org.anchoranalysis.image.io.bean.stack.reader.StackReader stackReader)Fallback forimageMetadataReaderto read image files without a direct metadata reader. -
getAlign
public org.anchoranalysis.image.bean.spatial.arrange.align.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(org.anchoranalysis.image.bean.spatial.arrange.align.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.
-