Class TiledReaderWriter

java.lang.Object
TiledReaderWriter

public class TiledReaderWriter extends Object
Example class for reading and writing a file in a tiled OME-Tiff format.
Author:
David Gault dgault at dundee.ac.uk
  • Constructor Summary

    Constructors
    Constructor
    Description
    TiledReaderWriter(String inputFile, String outputFile, int tileSizeX, int tileSizeY)
    Construct a new TiledReaderWriter to read the specified input file and write the given output file using the tile sizes provided.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    To read an image file and write out an OME-Tiff tiled image on the command line: $ java TiledReaderWriter input-file.oib output-file.ome.tiff 256 256
    void
    Read tiles from input file and write tiles to output OME-Tiff.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TiledReaderWriter

      public TiledReaderWriter(String inputFile, String outputFile, int tileSizeX, int tileSizeY)
      Construct a new TiledReaderWriter to read the specified input file and write the given output file using the tile sizes provided.
      Parameters:
      inputFile - the file to be read
      outputFile - the file to be written
      tileSizeX - the width of tile to attempt to use
      tileSizeY - the height of tile to attempt to use
  • Method Details

    • readWriteTiles

      public void readWriteTiles() throws loci.formats.FormatException, IOException
      Read tiles from input file and write tiles to output OME-Tiff.
      Throws:
      IOException - thrown if unable to setup input or output stream for reader or writer
      loci.formats.FormatException - thrown by FormatWriter if attempting to set invalid series
    • main

      public static void main(String[] args) throws loci.formats.FormatException, IOException, loci.common.services.DependencyException, loci.common.services.ServiceException
      To read an image file and write out an OME-Tiff tiled image on the command line: $ java TiledReaderWriter input-file.oib output-file.ome.tiff 256 256
      Parameters:
      args - inputFile, outputFile, tileSizeX and tileSizeY
      Throws:
      IOException - thrown if unable to setup input or output stream for reader or writer
      loci.formats.FormatException - thrown when setting invalid values in reader or writer
      loci.common.services.ServiceException - thrown if unable to create OME-XML meta data
      loci.common.services.DependencyException - thrown if failed to create an OMEXMLService