Class ScaleableBackground
Object
ScaleableBackground
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 Summary
Modifier and TypeMethodDescriptionExtracts a portion of a stack (flattened and maybe scaled) corresponding to a bounding-boxintNumber of channels in the background.booleanisRGB()Does the display-stack contain an RGB image?static ScaleableBackgroundnoScaling(DisplayStack stack) Creates a background from a stack without any scaling.static ScaleableBackgroundscaleBy(DisplayStack stack, ScaleFactor scaleFactor, VoxelsResizer resizer) Creates a background from a stack with scaling.The size of the background after any scaling has occurred.
-
Method Details
-
noScaling
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
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
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.
-