Class OneOrThreeChannelsWriter
- Direct Known Subclasses:
ImageIOWriter
,OpenCVWriter
A base-class for a
StackWriter
that writes an image that has either one or three
channels.
The StackWriter
must also support a flexible extension, which the user can specify.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfileFormat
(StackWriteOptions writeOptions) The file format that will be written by the generator.Which extension to use to write the image (without any leading period).void
setExtension
(String extension) Which extension to use to write the image (without any leading period).void
writeStack
(Stack stack, Path filePath, StackWriteOptions options) Writes a stack to the filesystem at a particular path.protected abstract void
writeStackAfterCheck
(Stack stack, Path filePath) Writes theStack
to the file-system, after a check has already occurred that the correct number of channels exist.Methods inherited from class org.anchoranalysis.image.io.bean.stack.writer.StackWriter
fileFormatWarnUnexpected, writeStackWithExtension
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
OneOrThreeChannelsWriter
public OneOrThreeChannelsWriter()
-
-
Method Details
-
fileFormat
Description copied from class:StackWriter
The file format that will be written by the generator.- Specified by:
fileFormat
in classStackWriter
- Parameters:
writeOptions
- options which may influence how a raster is written.- Returns:
- the image file-format.
- Throws:
ImageIOException
- if unable to successfully determine the file-format to use to write.
-
writeStack
public void writeStack(Stack stack, Path filePath, StackWriteOptions options) throws ImageIOException Description copied from class:StackWriter
Writes a stack to the filesystem at a particular path.- Specified by:
writeStack
in classStackWriter
- Parameters:
stack
- the stack to write.filePath
- the path to write the file to.options
- options which may influence how a raster is written.- Throws:
ImageIOException
- if anything goes wrong while writing.
-
writeStackAfterCheck
Writes theStack
to the file-system, after a check has already occurred that the correct number of channels exist.- Parameters:
stack
- the stack to write.filePath
- the path to write the image to.- Throws:
ImageIOException
- if unable to successfully write the image.
-
getExtension
Which extension to use to write the image (without any leading period). -
setExtension
Which extension to use to write the image (without any leading period).
-