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
    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)  
    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).
    int getBackgroundIntensity()
    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.ImageMetadataReader getImageMetadataReader()
    How to read the ImageMetadata from the file-system.
    org.anchoranalysis.image.io.bean.stack.reader.StackReader getStackReader()
    Fallback for imageMetadataReader to read image files without a direct metadata reader.
    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)
    Produce a scaled version of a Stack, mapping each channel to a scaled version of itself.
    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).
    void setBackgroundIntensity​(int backgroundIntensity)
    The background intensity to use in each channel when the scaled image does not cover the entire canvas.
    void setImageMetadataReader​(org.anchoranalysis.image.io.bean.stack.metadata.reader.ImageMetadataReader imageMetadataReader)
    How to read the ImageMetadata from the file-system.
    void setStackReader​(org.anchoranalysis.image.io.bean.stack.reader.StackReader stackReader)
    Fallback for imageMetadataReader to read image files without a direct metadata reader.

    Methods inherited from class org.anchoranalysis.experiment.bean.task.Task

    executeJob, isInputCompatibleWith

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • 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:
      beforeAnyJobIsExecuted in class org.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.OperationFailedException
      Description copied from class: ScaleImage
      Produce a scaled version of a Stack, mapping each channel to a scaled version of itself.
      Specified by:
      scaleStack in class ScaleImage<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 the ImageMetadata from the file-system.
    • setImageMetadataReader

      public void setImageMetadataReader​(org.anchoranalysis.image.io.bean.stack.metadata.reader.ImageMetadataReader imageMetadataReader)
      How to read the ImageMetadata from the file-system.
    • getStackReader

      public org.anchoranalysis.image.io.bean.stack.reader.StackReader getStackReader()
      Fallback for imageMetadataReader to read image files without a direct metadata reader.
    • setStackReader

      public void setStackReader​(org.anchoranalysis.image.io.bean.stack.reader.StackReader stackReader)
      Fallback for imageMetadataReader to 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.