Class DrawObjectOnStackGenerator
Object
org.anchoranalysis.image.io.stack.output.generator.RasterGenerator<T>
org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorSelectFormat<org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask>>
org.anchoranalysis.image.io.stack.output.box.DrawObjectOnStackGenerator
- All Implemented Interfaces:
Generator<org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask>>,TransformingGenerator<org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask>,Stack>,ElementWriter<org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask>>
public class DrawObjectOnStackGenerator extends RasterGeneratorSelectFormat<org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask>>
Creates images of object(s) drawn on a background only in a local region around their bounding
box.
This provides a visualization of an object(s) and a small around of immediate background context.
- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description static DrawObjectOnStackGeneratorcreateFromGenerator(TransformingGenerator<org.anchoranalysis.spatial.box.BoundingBox,Stack> backgroundGenerator, int outlineWidth, ColorIndex colors)Creates an extracted-object generator that draws an outline - with default color green and flattened in Z.static DrawObjectOnStackGeneratorcreateFromStack(Optional<ScaleableBackground> background, int outlineWidth, ColorIndex colors)Creates the generator with maybe a stack as the background, or else an empty background - and with default color green and flattened in Z.static DrawObjectOnStackGeneratorcreateFromStack(ScaleableBackground background, int outlineWidth, ColorIndex colors)Creates the generator with a stack as the background - and with default color green and flattened across the Z-dimension.static DrawObjectOnStackGeneratorcreateWithEmptyBackground(int outlineWidth, ColorIndex colors)Creates the generator with an empty background - and with default color green and flattened in Z-dimension.StackWriteAttributesguaranteedImageAttributes()Guarantees on the attributes of all images created by the generator.Stacktransform(org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask> element)Methods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorSelectFormat
selectFileExtension, writeToFileMethods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGenerator
write, writeWithIndex
-
Method Details
-
createFromStack
public static DrawObjectOnStackGenerator createFromStack(ScaleableBackground background, int outlineWidth, ColorIndex colors)Creates the generator with a stack as the background - and with default color green and flattened across the Z-dimension.- Parameters:
background- stack that exists as a background for the object.colors- colors to use for outling of objects.outlineWidth- width of the outline around an object.- Returns:
- the newly created generator.
-
createWithEmptyBackground
public static DrawObjectOnStackGenerator createWithEmptyBackground(int outlineWidth, ColorIndex colors)Creates the generator with an empty background - and with default color green and flattened in Z-dimension.- Parameters:
outlineWidth- width of the outline around an object.colors- colors to use for outlining of objects.- Returns:
- the newly created generator.
-
createFromStack
public static DrawObjectOnStackGenerator createFromStack(Optional<ScaleableBackground> background, int outlineWidth, ColorIndex colors)Creates the generator with maybe a stack as the background, or else an empty background - and with default color green and flattened in Z.- Parameters:
background- stack that exists as a background for the object (or none, in which case a 0-valued grayscale background is assumed).colors- colors to use for outlining of objects.outlineWidth- width of the outline around an object.- Returns:
- the newly created generator.
-
createFromGenerator
public static DrawObjectOnStackGenerator createFromGenerator(TransformingGenerator<org.anchoranalysis.spatial.box.BoundingBox,Stack> backgroundGenerator, int outlineWidth, ColorIndex colors)Creates an extracted-object generator that draws an outline - with default color green and flattened in Z.- Parameters:
backgroundGenerator- generates a background for a bounding-box.outlineWidth- width of the outline around an object.colors- colors to use for outlining of objects.- Returns:
- the newly created generator.
-
transform
public Stack transform(org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask> element) throws OutputWriteFailedException- Throws:
OutputWriteFailedException
-
guaranteedImageAttributes
Description copied from class:RasterGeneratorGuarantees on the attributes of all images created by the generator.- Specified by:
guaranteedImageAttributesin classRasterGenerator<org.anchoranalysis.spatial.box.BoundedList<org.anchoranalysis.image.voxel.object.ObjectMask>>- Returns:
- options that are guaranteed to be true of all images by the generator.
-