Class PDSReader

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

public class PDSReader extends FormatReader
PDSReader is the file format reader for Perkin Elmer densitometer files.
  • Field Details

    • PDS_MAGIC_STRING

      private static final String PDS_MAGIC_STRING
      See Also:
    • DATE_FORMAT

      private static final String DATE_FORMAT
      See Also:
    • pixelsFile

      private String pixelsFile
    • recordWidth

      private int recordWidth
    • lutIndex

      private int lutIndex
    • reverseX

      private boolean reverseX
    • reverseY

      private boolean reverseY
  • Constructor Details

    • PDSReader

      public PDSReader()
      Constructs a new PDS reader.
  • Method Details

    • isThisType

      public boolean isThisType(String name, boolean open)
      Description copied from class: FormatReader
      Checks if a file matches the type of this format reader. Checks filename suffixes against those known for this format. If the suffix check is inconclusive and the open parameter is true, the file is opened and tested with FormatReader.isThisType(RandomAccessInputStream).
      Specified by:
      isThisType in interface IFormatReader
      Overrides:
      isThisType in class FormatReader
      Parameters:
      open - If true, and the file extension is insufficient to determine the file type, the (existing) file is opened for further analysis.
    • 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 FormatReader
      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
    • get16BitLookupTable

      public short[][] get16BitLookupTable() throws FormatException, IOException
      Description copied from interface: IFormatReader
      Gets the 16-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or if IFormatReader.isIndexed() returns false, then this may return null. Also, if IFormatReader.getPixelType() returns anything other than FormatTools.INT16 or FormatTools.UINT16, this method will return null.
      Specified by:
      get16BitLookupTable in interface IFormatReader
      Overrides:
      get16BitLookupTable in class FormatReader
      Throws:
      FormatException
      IOException
    • getSeriesUsedFiles

      public String[] getSeriesUsedFiles(boolean noPixels)
      Description copied from interface: IFormatReader
      Returns an array of filenames needed to open the current series. 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:
      getSeriesUsedFiles in interface IFormatReader
      Overrides:
      getSeriesUsedFiles in class FormatReader
    • 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
      Specified by:
      openBytes in class FormatReader
      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:
    • 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 FormatReader
      Throws:
      IOException
    • initFile

      protected void initFile(String id) throws FormatException, IOException
      Description copied from class: FormatReader
      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 FormatReader
      Throws:
      FormatException - if a parsing error occurs processing the file.
      IOException - if an I/O error occurs processing the file