Class OneOrThreeChannelsWriter

Object
AnchorBean<StackWriter>
StackWriter
OneOrThreeChannelsWriter
Direct Known Subclasses:
ImageIOWriter, OpenCVWriter

public abstract class OneOrThreeChannelsWriter extends StackWriter
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 Details

    • OneOrThreeChannelsWriter

      public OneOrThreeChannelsWriter()
  • Method Details

    • fileFormat

      public ImageFileFormat fileFormat(StackWriteOptions writeOptions) throws ImageIOException
      Description copied from class: StackWriter
      The file format that will be written by the generator.
      Specified by:
      fileFormat in class StackWriter
      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 class StackWriter
      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

      protected abstract void writeStackAfterCheck(Stack stack, Path filePath) throws ImageIOException
      Writes the Stack 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

      public String getExtension()
      Which extension to use to write the image (without any leading period).
    • setExtension

      public void setExtension(String extension)
      Which extension to use to write the image (without any leading period).