Class BioformatsWriter

Direct Known Subclasses:
OMETiff, OMEXML, Tiff

public abstract class BioformatsWriter extends StackWriter
Base class for writing a stack to the filesystem using the Bioformats library.

The following formats are supported with a variety of number of channels and stacks:

  • unsigned 8-bit
  • unsigned 16-bit
  • unsigned 32-bit
  • float

Note that not all implementations support writing as RGB. When they do, it insists on three channels, and only supported unsigned 8-bit or unsigned-16 bit as channel types.

If a stack has heterogeneous channel types (i.e. not all channels have the same type) then it writes all channels with the most generic type (e.g. most bits).

Author:
Owen Feehan
  • Constructor Details

    • BioformatsWriter

      public BioformatsWriter(boolean supportsRGB)
      Creates a new BioformatsWriter instance.
      Parameters:
      supportsRGB - Whether the writer supports writing RGB images or not.
  • Method Details

    • 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.
    • createWriter

      protected abstract loci.formats.IFormatWriter createWriter() throws ImageIOException
      Creates or gets an instance of IFormatWriter which dictates the file format to use for writing.
      Returns:
      a newly created writer.
      Throws:
      ImageIOException - if a writer cannot be created successfully.