Class RasterGeneratorSelectFormat<T>
Object
RasterGenerator<T>
RasterGeneratorSelectFormat<T>
- Type Parameters:
T- the type of entity that is transformed to aStack
- All Implemented Interfaces:
Generator<T>,TransformingGenerator<T,,Stack> ElementWriter<T>
- Direct Known Subclasses:
AssignmentGenerator,ChannelGenerator,DrawObjectOnStackGenerator,ExtractBoundingBoxAreaFromStackGenerator,ObjectAsMaskGenerator,ObjectsAsGrayscaleGenerator,ObjectsAsRGBGenerator,RasterGeneratorDelegateToDisplayStack,RasterGeneratorDelegateToRaster,StackGenerator
A
RasterGenerator that selects an appropriate output-format based upon each generated
image.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringselectFileExtension(Stack stack, StackWriteOptions options, OutputWriteSettings settings, Optional<Logger> logger) Combines stack-write-options derived for a particular stack with the general write-options associated with theRasterGenerator.protected voidwriteToFile(T element, Stack transformedElement, StackWriteOptions options, OutputWriteSettings settings, Path filePath) Writes a stack to the file-system.Methods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGenerator
guaranteedImageAttributes, write, writeWithIndexMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.anchoranalysis.io.generator.TransformingGenerator
transform
-
Constructor Details
-
RasterGeneratorSelectFormat
public RasterGeneratorSelectFormat()
-
-
Method Details
-
selectFileExtension
protected String selectFileExtension(Stack stack, StackWriteOptions options, OutputWriteSettings settings, Optional<Logger> logger) throws OperationFailedException Combines stack-write-options derived for a particular stack with the general write-options associated with theRasterGenerator.- Specified by:
selectFileExtensionin classRasterGenerator<T>- Parameters:
stack- the stack to select a file-extension foroptions- options that describe howstackshould be writtensettings- general settings for writing outputlogger- logger for information messages or warnings associated with writing outputs- Returns:
- the file extension without any leading period
- Throws:
OperationFailedException- if the operation could not be successfully completed.
-
writeToFile
protected void writeToFile(T element, Stack transformedElement, StackWriteOptions options, OutputWriteSettings settings, Path filePath) throws OutputWriteFailedException Description copied from class:RasterGeneratorWrites a stack to the file-system.- Specified by:
writeToFilein classRasterGenerator<T>- Parameters:
element- the element for the generator before transforming to aStacktransformedElement- theStackthatelementwas transformed intooptions- options that describe howstackshould be writtensettings- general settings for writing output.filePath- the file-path to write too including the extension.- Throws:
OutputWriteFailedException- if the image could not be be successfully written to the file-system.
-