public abstract class ObjectsAsRGBGenerator extends RasterGeneratorSelectFormat<ObjectCollectionWithProperties>
ObjectCollection
upon a RGBStack
.Constructor and Description |
---|
ObjectsAsRGBGenerator(DrawObject drawObject,
ObjectDrawAttributes attributes,
io.vavr.control.Either<Dimensions,DisplayStack> background) |
Modifier and Type | Method and Description |
---|---|
protected static RGBStack |
createEmptyStackFor(Dimensions dimensions)
Creates an empty
RGBStack . |
protected abstract RGBStack |
generateBackgroundRegion(ObjectCollectionWithProperties objects,
io.vavr.control.Either<Dimensions,DisplayStack> background)
Creates a
RGBStack containing the background, without objects being drawn upon it. |
protected abstract ObjectCollectionWithProperties |
generateMasks(ObjectCollectionWithProperties objects)
Creates a
ObjectCollectionWithProperties indicative of the masks that will be imposed
on top of the background-region. |
io.vavr.control.Either<Dimensions,DisplayStack> |
getBackground()
A background image or dimensions to define an empty background.
|
StackWriteAttributes |
guaranteedImageAttributes()
Guarantees on the attributes of all images created by the generator.
|
void |
setBackground(io.vavr.control.Either<Dimensions,DisplayStack> background)
A background image or dimensions to define an empty background.
|
Stack |
transform(ObjectCollectionWithProperties element)
Applies any necessary preprocessing to create an element suitable for writing to the
filesystem.
|
selectFileExtension, writeToFile
write, writeWithIndex
public ObjectsAsRGBGenerator(DrawObject drawObject, ObjectDrawAttributes attributes, io.vavr.control.Either<Dimensions,DisplayStack> background)
public Stack transform(ObjectCollectionWithProperties element) throws OutputWriteFailedException
TransformingGenerator
element
- element to be assigned and then transformedOutputWriteFailedException
- if anything goes wrongpublic StackWriteAttributes guaranteedImageAttributes()
RasterGenerator
guaranteedImageAttributes
in class RasterGenerator<ObjectCollectionWithProperties>
protected abstract RGBStack generateBackgroundRegion(ObjectCollectionWithProperties objects, io.vavr.control.Either<Dimensions,DisplayStack> background) throws CreateException
RGBStack
containing the background, without objects being drawn upon it.
This background may be all or only a region of the entire background-stack.
objects
- the current objects to be drawn.background
- the entire background.RGBStack
, as above.CreateException
- if the background cannot be successfully created.protected abstract ObjectCollectionWithProperties generateMasks(ObjectCollectionWithProperties objects) throws CreateException
ObjectCollectionWithProperties
indicative of the masks that will be imposed
on top of the background-region.objects
- the objects to draw.objects
or a derived-representation of objects
, as will be
drawn on the background-region.CreateException
- if the background cannot be successfully created.protected static RGBStack createEmptyStackFor(Dimensions dimensions)
RGBStack
.
Empty implies all voxels are zero-valued i.e. have black color.
dimensions
- the size of the stack to create.RGBStack
.public io.vavr.control.Either<Dimensions,DisplayStack> getBackground()
public void setBackground(io.vavr.control.Either<Dimensions,DisplayStack> background)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.