Class AssignmentGenerator
- All Implemented Interfaces:
Generator<Assignment<ObjectMask>>
,TransformingGenerator<Assignment<ObjectMask>,
,Stack> ElementWriter<Assignment<ObjectMask>>
Outputs a raster showing an
Assignment
on a background.
Specifically two tiled backgrounds appear, one left, and one right, and objects are colored on left and right panels, to indicate how they appear in the assignment.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionAssignmentGenerator
(DrawColoredObjects objectDrawer, IntFunction<AssignmentColorPool> colorPoolCreator, io.vavr.Tuple2<String, String> names, boolean appendUnassignedCount) Creates a newAssignmentGenerator
instance. -
Method Summary
Modifier and TypeMethodDescriptionGuarantees on the attributes of all images created by the generator.transform
(Assignment<ObjectMask> element) Applies any necessary preprocessing to create an element suitable for writing to the filesystem.Methods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorSelectFormat
selectFileExtension, writeToFile
Methods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGenerator
write, writeWithIndex
-
Constructor Details
-
AssignmentGenerator
public AssignmentGenerator(DrawColoredObjects objectDrawer, IntFunction<AssignmentColorPool> colorPoolCreator, io.vavr.Tuple2<String, String> names, boolean appendUnassignedCount) Creates a newAssignmentGenerator
instance.- Parameters:
objectDrawer
- How to color objects in the image.colorPoolCreator
- Creates aAssignmentColorPool
given a count of paired objects.names
- Names to assign respectively to the left and right images.appendUnassignedCount
- Whether to append a count of unassigned objects (in parantheses) to the name of each image.
-
-
Method Details
-
transform
Description copied from interface:TransformingGenerator
Applies any necessary preprocessing to create an element suitable for writing to the filesystem.- Parameters:
element
- element to be assigned and then transformed.- Returns:
- the transformed element after necessary preprocessing.
- Throws:
OutputWriteFailedException
- if anything goes wrong.
-
guaranteedImageAttributes
Description copied from class:RasterGenerator
Guarantees on the attributes of all images created by the generator.- Specified by:
guaranteedImageAttributes
in classRasterGenerator<Assignment<ObjectMask>>
- Returns:
- options that are guaranteed to be true of all images by the generator.
-