Class DrawObjectsGenerator
- All Implemented Interfaces:
Generator<ObjectCollectionWithProperties>,TransformingGenerator<ObjectCollectionWithProperties,,Stack> ElementWriter<ObjectCollectionWithProperties>
Generates stacks of RGB images using a
DrawObject to draw objects on a background.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionprotected RGBStackgenerateBackgroundRegion(ObjectCollectionWithProperties objects, io.vavr.control.Either<Dimensions, DisplayStack> background) Creates aRGBStackcontaining the background, without objects being drawn upon it.protected ObjectCollectionWithPropertiesCreates aObjectCollectionWithPropertiesindicative of the masks that will be imposed on top of the background-region.static DrawObjectsGeneratoroutlineSingleColor(int outlineWidth, DisplayStack background, RGBColor color) Creates a generator that draws an outline around objects on a background using a single color for all objects.static DrawObjectsGeneratoroutlineVariedColors(int numberColors, int outlineWidth, io.vavr.control.Either<Dimensions, DisplayStack> background) Creates a generator that draws an outline around objects on a background using varied colors for the objects.static DrawObjectsGeneratoroutlineVariedColors(int numberColors, int outlineWidth, DisplayStack background) Creates a generator that draws an outline around objects on a background using varied colors for the objects.static DrawObjectsGeneratoroutlineWithColorIndex(int outlineWidth, ColorIndex colorIndex) Creates a generator that draws an outline around objects using a particularColorIndex.static DrawObjectsGeneratorwithBackgroundAndColors(DrawObject drawObject, DisplayStack background, ColorIndex colorIndex) Creates a generator that draws an object in a particular way with particular colors and background.Methods inherited from class org.anchoranalysis.image.io.object.output.rgb.ObjectsAsRGBGenerator
createEmptyStackFor, getBackground, guaranteedImageAttributes, setBackground, transformMethods 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
-
withBackgroundAndColors
public static DrawObjectsGenerator withBackgroundAndColors(DrawObject drawObject, DisplayStack background, ColorIndex colorIndex) Creates a generator that draws an object in a particular way with particular colors and background.- Parameters:
drawObject- how to draw the object.background- the background.colorIndex- the colors.- Returns:
- the generator.
-
outlineVariedColors
public static DrawObjectsGenerator outlineVariedColors(int numberColors, int outlineWidth, DisplayStack background) Creates a generator that draws an outline around objects on a background using varied colors for the objects.- Parameters:
numberColors- the number of unique colors to use.outlineWidth- the width of the outline.background- the background.- Returns:
- the generator.
-
outlineWithColorIndex
Creates a generator that draws an outline around objects using a particularColorIndex.- Parameters:
outlineWidth- the width of the outline.colorIndex- the color-index.- Returns:
- the generator.
-
outlineVariedColors
public static DrawObjectsGenerator outlineVariedColors(int numberColors, int outlineWidth, io.vavr.control.Either<Dimensions, DisplayStack> background) Creates a generator that draws an outline around objects on a background using varied colors for the objects.- Parameters:
numberColors- the number of unique colors to use.outlineWidth- the width of the outline.background- the background or dimensions for a background (drawn as all black).- Returns:
- the generator.
-
outlineSingleColor
public static DrawObjectsGenerator outlineSingleColor(int outlineWidth, DisplayStack background, RGBColor color) Creates a generator that draws an outline around objects on a background using a single color for all objects.- Parameters:
outlineWidth- the width of the outline.background- the background or dimensions for a background (drawn as all black).color- the single color to use for all objects.- Returns:
- the generator.
-
generateBackgroundRegion
protected RGBStack generateBackgroundRegion(ObjectCollectionWithProperties objects, io.vavr.control.Either<Dimensions, DisplayStack> background) Description copied from class:ObjectsAsRGBGeneratorCreates aRGBStackcontaining the background, without objects being drawn upon it.This background may be all or only a region of the entire background-stack.
- Specified by:
generateBackgroundRegionin classObjectsAsRGBGenerator- Parameters:
objects- the current objects to be drawn.background- the entire background.- Returns:
- a newly created
RGBStack, as above.
-
generateMasks
Description copied from class:ObjectsAsRGBGeneratorCreates aObjectCollectionWithPropertiesindicative of the masks that will be imposed on top of the background-region.- Specified by:
generateMasksin classObjectsAsRGBGenerator- Parameters:
objects- the objects to draw.- Returns:
- either
objectsor a derived-representation ofobjects, as will be drawn on the background-region.
-