Class MetamorphTiffReader

All Implemented Interfaces:
Closeable, AutoCloseable, ICompressedTileReader, IFormatHandler, IFormatReader, IMetadataConfigurable, IPyramidHandler

public class MetamorphTiffReader extends BaseTiffReader
MetamorphTiffReader is the file format reader for TIFF files produced by Metamorph software version 7.5 and above.
Author:
Melissa Linkert melissa at glencoesoftware.com, Thomas Caswell tcaswell at uchicago.edu
  • Field Details

    • DATE_FORMAT

      private static final String DATE_FORMAT
      See Also:
    • files

      private String[] files
    • wellCount

      private int wellCount
    • fieldRowCount

      private int fieldRowCount
    • fieldColumnCount

      private int fieldColumnCount
    • dualCamera

      private boolean dualCamera
  • Constructor Details

    • MetamorphTiffReader

      public MetamorphTiffReader()
      Constructs a new Metamorph TIFF reader.
  • Method Details

    • isThisType

      public boolean isThisType(loci.common.RandomAccessInputStream stream) throws IOException
      Description copied from interface: IFormatReader
      Checks if the given stream is a valid stream for this file format. The number of bytes read is format-dependent.
      Specified by:
      isThisType in interface IFormatReader
      Overrides:
      isThisType in class MinimalTiffReader
      Parameters:
      stream - A RandomAccessInputStream representing the file to check. The first byte in the stream is assumed to be the first byte in the file.
      Returns:
      true if the file represented by the stream can be read by this reader; false otherwise.
      Throws:
      IOException
    • getDomains

      public String[] getDomains()
      Description copied from interface: IFormatReader
      Returns the list of domains represented by the current file.
      Specified by:
      getDomains in interface IFormatReader
      Overrides:
      getDomains in class FormatReader
    • getUsedFiles

      public String[] getUsedFiles(boolean noPixels)
      Description copied from interface: IFormatReader
      Returns an array of filenames needed to open this dataset. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned. The first element in the array is expected to be the path passed to IFormatHandler.setId(String), if appropriate based upon 'noPixels'. The remaining elements are expected to be in a consistent order; if a directory listing is necessary to build the list then it should be sorted first.
      Specified by:
      getUsedFiles in interface IFormatReader
      Overrides:
      getUsedFiles in class FormatReader
    • close

      public void close(boolean fileOnly) throws IOException
      Description copied from interface: IFormatReader
      Closes the currently open file. If the flag is set, this is all that happens; if unset, it is equivalent to calling Closeable.close().
      Specified by:
      close in interface IFormatReader
      Overrides:
      close in class MinimalTiffReader
      Throws:
      IOException
    • openBytes

      public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
      Description copied from interface: IFormatReader
      Obtains a sub-image of the specified image plane into a pre-allocated byte array.
      Specified by:
      openBytes in interface IFormatReader
      Overrides:
      openBytes in class MinimalTiffReader
      Parameters:
      no - the plane index within the current series.
      buf - a pre-allocated buffer.
      x - X coordinate of the upper-left corner of the sub-image
      y - Y coordinate of the upper-left corner of the sub-image
      w - width of the sub-image
      h - height of the sub-image
      Returns:
      the pre-allocated buffer buf for convenience.
      Throws:
      FormatException - if there was a problem parsing the metadata of the file.
      IOException - if there was a problem reading the file.
      See Also:
    • initFile

      protected void initFile(String id) throws FormatException, IOException
      Description copied from class: SubResolutionFormatReader
      Initializes the given file (parsing header information, etc.). Most subclasses should override this method to perform initialization operations such as parsing metadata.
      Overrides:
      initFile in class BaseTiffReader
      Throws:
      FormatException - if a parsing error occurs processing the file.
      IOException - if an I/O error occurs processing the file
    • getSeriesIndex

      private int getSeriesIndex(int fieldRow, int fieldColumn, int well)
    • getWell

      private MetamorphTiffReader.Well getWell(int seriesIndex)
    • getField

      private int getField(String stageLabel)
    • getWellRow

      private int getWellRow(String stageLabel)
    • getWellColumn

      private int getWellColumn(String stageLabel)
    • findTIFFs

      private void findTIFFs() throws IOException
      Throws:
      IOException
    • parseFile

      private void parseFile(String tiff, MetamorphHandler handler) throws FormatException, IOException
      Throws:
      FormatException
      IOException