Class OMEXMLWriter

All Implemented Interfaces:
Closeable, AutoCloseable, ICompressedTileWriter, IFormatHandler, IFormatWriter, IMetadataConfigurable, IPyramidHandler

public class OMEXMLWriter extends FormatWriter
OMEXMLWriter is the file format writer for OME-XML files.
  • Field Details

  • Constructor Details

    • OMEXMLWriter

      public OMEXMLWriter()
  • Method Details

    • setId

      public void setId(String id) throws FormatException, IOException
      Description copied from class: FormatWriter
      Initializes a writer from the input file name. Initializes a RandomAccessOutputStream for the output file and initializes the metadata for all the series using FormatWriter.setSeries(int).
      Specified by:
      setId in interface IFormatHandler
      Overrides:
      setId in class FormatWriter
      Parameters:
      id - a String specifying the path to the file
      Throws:
      FormatException
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class FormatWriter
      Throws:
      IOException
    • saveBytes

      public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
      Description copied from interface: IFormatWriter
      Saves the given image tile to the current series in the current file.
      Parameters:
      no - the plane index within the series.
      buf - the byte array that represents the image tile.
      x - the X coordinate of the upper-left corner of the image tile.
      y - the Y coordinate of the upper-left corner of the image tile.
      w - the width (in pixels) of the image tile.
      h - the height (in pixels) of the image tile.
      Throws:
      FormatException - if one of the parameters is invalid.
      IOException - if there was a problem writing to the file.
      See Also:
    • canDoStacks

      public boolean canDoStacks()
      Description copied from interface: IFormatWriter
      Reports whether the writer can save multiple images to a single file.
      Specified by:
      canDoStacks in interface IFormatWriter
      Overrides:
      canDoStacks in class FormatWriter
    • getPixelTypes

      public int[] getPixelTypes(String codec)
      Description copied from interface: IFormatWriter
      Gets the supported pixel types for the given codec.
      Specified by:
      getPixelTypes in interface IFormatWriter
      Overrides:
      getPixelTypes in class FormatWriter
    • preserveCreator

      public boolean preserveCreator()
      Get the value of the CREATOR_KEY option. This toggles whether or not the OME Creator attribute will be overwritten with the current Bio-Formats version. For input data that does not have a Creator attribute defined, this makes no difference. By default, returns false, i.e. the Creator will be overwritten if it exists.
      Returns:
      true if the Creator attribute should be preserved (if it exists)
    • compress

      private byte[] compress(byte[] b) throws FormatException, IOException
      Compress the given byte array using the current codec. The compressed data is then base64-encoded.
      Throws:
      FormatException
      IOException