Class StackGenerator
- All Implemented Interfaces:
Generator<Stack>
,TransformingGenerator<Stack,
,Stack> ElementWriter<Stack>
Writes a stack to the filesystem.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionStackGenerator
(boolean always2D) Creates a generator that performs no padding.StackGenerator
(boolean padIfNecessary, boolean always2D) Creates the generator from a stack, inferring whether all stacks will be 2D from this stack's dimensions.StackGenerator
(boolean padIfNecessary, StackWriteAttributes writeOptions) Creates a newStackGenerator
instance. -
Method Summary
Modifier and TypeMethodDescriptionGuarantees on the attributes of all images created by the generator.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
-
StackGenerator
public StackGenerator(boolean always2D) Creates a generator that performs no padding.- Parameters:
always2D
- when true, this indicates that the stack is guaranteed to be always 2D.
-
StackGenerator
public StackGenerator(boolean padIfNecessary, boolean always2D) Creates the generator from a stack, inferring whether all stacks will be 2D from this stack's dimensions.- Parameters:
padIfNecessary
- iff true, in the specific case of a 2-channel stack, an additional blank channel is added to make it 3-channels.always2D
- when true, this indicates that the stack is guaranteed to be always 2D.
-
StackGenerator
Creates a newStackGenerator
instance.- Parameters:
padIfNecessary
- Iff true, in the specific case of a 2-channel stack, an additional blank channel is added to make it 3-channels.writeOptions
- Properties of the stack that is being written used to guide the outputting.
-
-
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<Stack>
- Returns:
- options that are guaranteed to be true of all images by the generator.
-