Class ScaleableBackground

Object
ScaleableBackground

public class ScaleableBackground extends Object
A stack that can be used as a background (and maybe scaled).

In situations, where only particular regions of a large stack (or large after upscaling) are desired, this provides a more efficient lazy interpolation strategy (just for the needed regions) rather than eagerly interpolating the entire background.

It is always flattened via a maximum intensity projection.

Author:
Owen Feehan
  • Method Details

    • noScaling

      public static ScaleableBackground noScaling(DisplayStack stack)
      Creates a background from a stack without any scaling.
      Parameters:
      stack - the stack
      Returns:
      a newly created class
    • scaleBy

      public static ScaleableBackground scaleBy(DisplayStack stack, ScaleFactor scaleFactor, VoxelsResizer resizer)
      Creates a background from a stack with scaling.
      Parameters:
      stack - the stack.
      scaleFactor - what to scale the stack by.
      resizer - an interpolator for resizing voxels.
      Returns:
      a newly created ScaleableBackground.
    • getNumberChannels

      public int getNumberChannels()
      Number of channels in the background.
      Returns:
      number of channels.
    • extractRegionFromStack

      public Stack extractRegionFromStack(BoundingBox box) throws OperationFailedException
      Extracts a portion of a stack (flattened and maybe scaled) corresponding to a bounding-box
      Parameters:
      box - bounding-box representing the region.
      Returns:
      a stack showing only the bounding-box region.
      Throws:
      OperationFailedException - if the operation cannot complete successfully.
    • sizeAfterAnyScaling

      public Extent sizeAfterAnyScaling()
      The size of the background after any scaling has occurred.
      Returns:
      the size.
    • isRGB

      public boolean isRGB()
      Does the display-stack contain an RGB image?
      Returns:
      true if the contained image is RGB, false if it is grayscale.