Class ScaleableBackground
Object
org.anchoranalysis.image.io.stack.output.box.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 Summary
Modifier and Type Method Description StackextractRegionFromStack(org.anchoranalysis.spatial.box.BoundingBox box)Extracts a portion of a stack (flattened and maybe scaled) corresponding to a bounding-boxintgetNumberChannels()Number 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, org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor, org.anchoranalysis.image.voxel.resizer.VoxelsResizer resizer)Creates a background from a stack with scaling.org.anchoranalysis.spatial.box.ExtentsizeAfterAnyScaling()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, org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor, org.anchoranalysis.image.voxel.resizer.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(org.anchoranalysis.spatial.box.BoundingBox box) throws OperationFailedExceptionExtracts 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 org.anchoranalysis.spatial.box.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.
-