Class RasterGeneratorSelectFormat<T>
Object
org.anchoranalysis.image.io.stack.output.generator.RasterGenerator<T>
org.anchoranalysis.image.io.stack.output.generator.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:
ChannelGenerator,DrawObjectOnStackGenerator,ExtractBoundingBoxAreaFromStackGenerator,ObjectAsMaskGenerator,ObjectsAsGrayscaleGenerator,ObjectsAsRGBGenerator,RasterGeneratorDelegateToDisplayStack,RasterGeneratorDelegateToRaster,StackGenerator
public abstract class RasterGeneratorSelectFormat<T> extends RasterGenerator<T>
A
RasterGenerator that selects an appropriate output-format based upon each generated
image.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description RasterGeneratorSelectFormat() -
Method Summary
Modifier and Type Method Description protected 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, writeWithIndex
-
Constructor Details
-
RasterGeneratorSelectFormat
public RasterGeneratorSelectFormat()
-
-
Method Details
-
selectFileExtension
protected String selectFileExtension(Stack stack, StackWriteOptions options, OutputWriteSettings settings, Optional<Logger> logger) throws OperationFailedExceptionCombines 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 OutputWriteFailedExceptionDescription 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.
-