Class VectraReader

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

public class VectraReader extends BaseTiffReader
VectraReader is the reader for PerkinElmer Vectra QPTIFF data
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
      Logger for this class.
    • SOFTWARE_CHECK

      private static final String SOFTWARE_CHECK
      TIFF image description prefix for PerkinElmer Vectra/QPTIFF files.
      See Also:
    • ANNOTATION_SUFFIX

      private static final String ANNOTATION_SUFFIX
      See Also:
    • EXTRA_FILES

      private static final List<String> EXTRA_FILES
    • pyramidDepth

      private int pyramidDepth
    • profileXML

      private String profileXML
    • allFiles

      private List<String> allFiles
  • Constructor Details

    • VectraReader

      public VectraReader()
      Constructs a new Vectra 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.
    • 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
      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:
    • openThumbBytes

      public byte[] openThumbBytes(int no) throws FormatException, IOException
      Description copied from interface: IFormatReader
      Obtains a thumbnail for the specified image plane from the current file, as a byte array.
      Specified by:
      openThumbBytes in interface IFormatReader
      Overrides:
      openThumbBytes in class MinimalTiffReader
      Throws:
      FormatException
      IOException
    • 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
    • getOptimalTileWidth

      public int getOptimalTileWidth()
      Description copied from interface: IFormatReader
      Returns the optimal sub-image width for use with openBytes.
      Specified by:
      getOptimalTileWidth in interface IFormatReader
      Overrides:
      getOptimalTileWidth in class MinimalTiffReader
    • getOptimalTileHeight

      public int getOptimalTileHeight()
      Description copied from interface: IFormatReader
      Returns the optimal sub-image height for use with openBytes.
      Specified by:
      getOptimalTileHeight in interface IFormatReader
      Overrides:
      getOptimalTileHeight in class MinimalTiffReader
    • initStandardMetadata

      protected void initStandardMetadata() throws FormatException, IOException
      Description copied from class: BaseTiffReader
      Parses standard metadata. NOTE: Absolutely no calls to the metadata store should be made in this method or methods that override this method. Data will be overwritten if you do so.
      Overrides:
      initStandardMetadata in class BaseTiffReader
      Throws:
      FormatException
      IOException
    • initMetadataStore

      protected void initMetadataStore() throws FormatException
      Description copied from class: BaseTiffReader
      Populates the metadata store using the data parsed in BaseTiffReader.initStandardMetadata() along with some further parsing done in the method itself. All calls to the active MetadataStore should be made in this method and only in this method. This is especially important for sub-classes that override the getters for pixel set array size, etc.
      Overrides:
      initMetadataStore in class BaseTiffReader
      Throws:
      FormatException
    • handleFilter

      private void handleFilter(Element filter, int channel)
    • processParentNode

      private void processParentNode(Node parent, String prefix)
    • getScanProfileXML

      public String getScanProfileXML()
      Returns an XML string corresponding to the ScanProfile node. The QPTIFF specification indicates that the ScanProfile is XML, but in practice it may be XML or JSON.
    • getImageName

      private String getImageName(int coreIndex)
    • getIFDComment

      private String getIFDComment(int ifdIndex)
    • getImageType

      private String getImageType(int ifdIndex)
    • getIFDIndex

      private int getIFDIndex(int coreIndex, int no)
      Returns the index of the IFD to be used for the given core index and image number. The IFD order in general is: - IFD #0 to n-1: full resolution images (1 RGB for BF data, n grayscale for FL) - IFD #n: RGB thumbnail - IFD #n+1 to (n*2)-1: 50% resolution images (optional) - IFD #n*2 to (n*3)-1: 25% resolution images (optional) ... - macro/overview image (optional) - label image (optional)