Class ScaleImageCommonSize

Object
AnchorBean<Task<StackSequenceInput, CommonSize>>
Task<StackSequenceInput, CommonSize>
ScaleImage<CommonSize>
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
  • Constructor Details

    • ScaleImageCommonSize

      public ScaleImageCommonSize()
  • Method Details

    • beforeAnyJobIsExecuted

      public CommonSize beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<StackSequenceInput> inputs, ParametersExperiment parameters) throws ExperimentExecutionException
      Specified by:
      beforeAnyJobIsExecuted in class Task<StackSequenceInput, CommonSize>
      Throws:
      ExperimentExecutionException
    • scaleStack

      protected Stack scaleStack(Stack stack, Optional<ImageSizeSuggestion> suggestedSize, VoxelsResizer voxelsResizer, CommonSize sharedState) throws 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:
      OperationFailedException - if the scaling operation fails.
    • getImageMetadataReader

      public ImageMetadataReader getImageMetadataReader()
      How to read the ImageMetadata from the file-system.
    • setImageMetadataReader

      public void setImageMetadataReader(ImageMetadataReader imageMetadataReader)
      How to read the ImageMetadata from the file-system.
    • getStackReader

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

      public void setStackReader(StackReader stackReader)
      Fallback for imageMetadataReader to 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.