loci.formats.in

## Class SVSReader

- java.lang.Object
- - loci.formats.FormatHandler
  - - loci.formats.FormatReader
    - - loci.formats.SubResolutionFormatReader
      - - loci.formats.in.MinimalTiffReader
        - - loci.formats.in.BaseTiffReader
          - - loci.formats.in.SVSReader

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ICompressedTileReader, IFormatHandler, IFormatReader, IMetadataConfigurable, IPyramidHandler
  Direct Known Subclasses:
    MikroscanTiffReader

      public class SVSReader
      extends BaseTiffReader

  SVSReader is the file format reader for Aperio SVS TIFF files.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.String` | `APERIO_IMAGE_DESCRIPTION_PREFIX` TIFF image description prefix for Aperio SVS files.
    `private java.lang.String[]` | `comments`
    `private java.lang.String` | `date`
    `private static java.lang.String` | `DATE_FORMAT`
    `private ome.xml.model.primitives.Color` | `displayColor`
    `private java.util.ArrayList<java.lang.String>` | `dyeNames`
    `private java.lang.Double` | `emissionWavelength`
    `private java.lang.Double` | `excitationWavelength`
    `private java.lang.Double` | `exposureScale`
    `private java.lang.Double` | `exposureTime`
    `private int` | `extraImages`
    `private int` | `labelIndex`
    `private static org.slf4j.Logger` | `LOGGER` Logger for this class.
    `private int` | `macroIndex`
    `private java.lang.Double` | `magnification`
    `private java.lang.Double` | `physicalDistanceFromLeftEdge`
    `private java.lang.Double` | `physicalDistanceFromTopEdge`
    `static boolean` | `REMOVE_THUMBNAIL_DEFAULT`
    `static java.lang.String` | `REMOVE_THUMBNAIL_KEY`
    `private java.lang.String` | `time`
    `private java.lang.Double[]` | `zPosition`

    - ### Fields inherited from class loci.formats.in.BaseTiffReader

      `DATE_FORMATS`

    - ### Fields inherited from class loci.formats.in.MinimalTiffReader

      `canSeparateSeries, equalStrips, ifds, lastPlane, mergeSubIFDs, noSubresolutions, seriesToIFD, subResolutionIFDs, thumbnailIFDs, tiffParser, use64Bit`

    - ### Fields inherited from class loci.formats.SubResolutionFormatReader

      `core`

    - ### Fields inherited from class loci.formats.FormatReader

      `coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION`

    - ### Fields inherited from class loci.formats.FormatHandler

      `COMPRESSION_SUFFIXES, currentId, format, metadataOptions, suffixes`

    - ### Fields inherited from interface loci.formats.IFormatReader

      `CAN_GROUP, CANNOT_GROUP, MUST_GROUP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SVSReader()` Constructs a new SVS reader.
    `SVSReader(java.lang.String name, java.lang.String[] suffixes)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(boolean fileOnly)` Closes the currently open file.
    `int` | `fileGroupOption(java.lang.String id)` Returns an indication of whether the files in a multi-file dataset can be handled individually.
    `protected java.util.ArrayList<java.lang.String>` | `getAvailableOptions()` Returns the list of available metadata options.
    `protected ome.xml.model.primitives.Timestamp` | `getDatestamp()`
    `protected ome.xml.model.primitives.Color` | `getDisplayColor()`
    `protected java.util.ArrayList<java.lang.String>` | `getDyeNames()`
    `protected ome.units.quantity.Length` | `getEmission()`
    `protected ome.units.quantity.Length` | `getExcitation()`
    `protected java.lang.Double` | `getExposureTime()`
    `protected IFD` | `getIFD(int no)` Get the IFD corresponding to the given plane in the current series.
    `private int` | `getIFDIndex(int coreIndex, int no)`
    `protected double` | `getMagnification()`
    `int` | `getOptimalTileHeight()` Returns the optimal sub-image height for use with openBytes.
    `int` | `getOptimalTileWidth()` Returns the optimal sub-image width for use with openBytes.
    `protected ome.units.quantity.Length[]` | `getPhysicalSizes()`
    `Codec` | `getTileCodec(int no)` Retrieve a codec that can be used to decompress compressed tiles.
    `CodecOptions` | `getTileCodecOptions(int no, int x, int y)` Retrieve codec options that can be used to decompressed the specified tile.
    `int` | `getTileColumns(int no)` Get the number of columns of tiles in the specified plane in the current series.
    `int` | `getTileRows(int no)` Get the number of rows of tiles in the specified plane in the current series.
    `protected void` | `initMetadataStore()` Populates the metadata store using the data parsed in `BaseTiffReader.initStandardMetadata()` along with some further parsing done in the method itself.
    `protected void` | `initStandardMetadata()` Parses standard metadata.
    `boolean` | `isThisType(java.lang.String name, boolean open)` Checks if a file matches the type of this format reader.
    `byte[]` | `openBytes(int no, byte[] buf, int x, int y, int w, int h)` Obtains a sub-image of the specified image plane into a pre-allocated byte array.
    `byte[]` | `openCompressedBytes(int no, byte[] buf, int x, int y)` Retrieve the specified tile without performing any decompression.
    `byte[]` | `openCompressedBytes(int no, int x, int y)` Retrieve the specified tile without performing any decompression.
    `byte[]` | `openThumbBytes(int no)` Obtains a thumbnail for the specified image plane from the current file, as a byte array.
    `boolean` | `removeThumbnail()`

    - ### Methods inherited from class loci.formats.in.BaseTiffReader

      `getExifTagName, getImageCreationDate, initFile, initMetadata, put, put, put, put, put, put, put, put, put, put, putDouble, putInt, putString`

    - ### Methods inherited from class loci.formats.in.MinimalTiffReader

      `copyTile, get16BitLookupTable, get8BitLookupTable, getCompressedByteCount, getIFDs, getThumbnailIFDs, getThumbSizeX, getThumbSizeY, getTileIndex, initTiffParser, isThisType, reopenFile, setResolutionLevel`

    - ### Methods inherited from class loci.formats.SubResolutionFormatReader

      `coreIndexToSeries, flattenHashtables, getCoreIndex, getCoreMetadataList, getCurrentCore, getResolution, getResolutionCount, getSeries, getSeriesCount, seriesToCoreIndex, setCoreIndex, setResolution, setSeries`

    - ### Methods inherited from class loci.formats.FormatReader

      `addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCorrection, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillColor, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getRGBChannelCount, getRotationTransform, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, readPlane, readPlane, readPlane, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, updateMetadataLists`

    - ### Methods inherited from class loci.formats.FormatHandler

      `checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptions`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface loci.formats.IFormatHandler

      `getFormat, getNativeDataType, getSuffixes`

    - ### Methods inherited from interface loci.formats.IMetadataConfigurable

      `getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions`

- - ### Field Detail

    - #### REMOVE_THUMBNAIL_KEY

          public static final java.lang.String REMOVE_THUMBNAIL_KEY

      See Also:
        Constant Field Values

    - #### REMOVE_THUMBNAIL_DEFAULT

          public static final boolean REMOVE_THUMBNAIL_DEFAULT

      See Also:
        Constant Field Values

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      Logger for this class.

    - #### APERIO_IMAGE_DESCRIPTION_PREFIX

          private static final java.lang.String APERIO_IMAGE_DESCRIPTION_PREFIX

      TIFF image description prefix for Aperio SVS files.
      See Also:
        Constant Field Values

    - #### DATE_FORMAT

          private static final java.lang.String DATE_FORMAT

      See Also:
        Constant Field Values

    - #### zPosition

          private java.lang.Double[] zPosition

    - #### comments

          private java.lang.String[] comments

    - #### emissionWavelength

          private java.lang.Double emissionWavelength

    - #### excitationWavelength

          private java.lang.Double excitationWavelength

    - #### exposureTime

          private java.lang.Double exposureTime

    - #### exposureScale

          private java.lang.Double exposureScale

    - #### magnification

          private java.lang.Double magnification

    - #### date

          private java.lang.String date

    - #### time

          private java.lang.String time

    - #### dyeNames

          private java.util.ArrayList<java.lang.String> dyeNames

    - #### displayColor

          private transient ome.xml.model.primitives.Color displayColor

    - #### labelIndex

          private int labelIndex

    - #### macroIndex

          private int macroIndex

    - #### extraImages

          private int extraImages

    - #### physicalDistanceFromLeftEdge

          private transient java.lang.Double physicalDistanceFromLeftEdge

    - #### physicalDistanceFromTopEdge

          private transient java.lang.Double physicalDistanceFromTopEdge

  - ### Constructor Detail

    - #### SVSReader

          public SVSReader()

      Constructs a new SVS reader.

    - #### SVSReader

          public SVSReader(java.lang.String name,
                           java.lang.String[] suffixes)

  - ### Method Detail

    - #### removeThumbnail

          public boolean removeThumbnail()

    - #### fileGroupOption

          public int fileGroupOption(java.lang.String id)
                              throws FormatException,
                                     java.io.IOException

      Description copied from interface: `IFormatReader`
      Returns an indication of whether the files in a multi-file dataset can be handled individually. This method is only useful for formats and datasets which contain multiple files.
      Specified by:
        `fileGroupOption` in interface `IFormatReader`
      Overrides:
        `fileGroupOption` in class `FormatReader`
      Parameters:
        `id` - a file in the multi-file dataset
      Returns:
        an int indicating that we cannot, must, or might group the files. A return value of `FormatTools.MUST_GROUP` indicates that the files cannot be handled separately; the reader will always detect and read all files in the dataset. `FormatTools.CAN_GROUP` indicates that the files may be handled separately, but file grouping must then be disabled via `IFormatReader.setGroupFiles(boolean)`. `FormatTools.CANNOT_GROUP` indicates that the files must be handled separately; the reader will not attempt to read all files in the dataset (this is rare).
      Throws:
        `FormatException`
        `java.io.IOException`
      See Also:
        `FormatTools.MUST_GROUP`, `FormatTools.CAN_GROUP`, `FormatTools.CANNOT_GROUP`

    - #### isThisType

          public boolean isThisType(java.lang.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`
        `open` - If true, and the file extension is insufficient to determine the file type, the (existing) file is opened for further analysis.

    - #### openBytes

          public byte[] openBytes(int no,
                                  byte[] buf,
                                  int x,
                                  int y,
                                  int w,
                                  int h)
                           throws FormatException,
                                  java.io.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.
        `java.io.IOException` - if there was a problem reading the file.
      See Also:
        `IFormatReader.openBytes(int, byte[], int, int, int, int)`

    - #### openThumbBytes

          public byte[] openThumbBytes(int no)
                                throws FormatException,
                                       java.io.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`
        `java.io.IOException`

    - #### close

          public void close(boolean fileOnly)
                     throws java.io.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:
        `java.io.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`

    - #### getTileRows

          public int getTileRows(int no)

      Description copied from interface: `ICompressedTileReader`
      Get the number of rows of tiles in the specified plane in the current series.
      Specified by:
        `getTileRows` in interface `ICompressedTileReader`
      Overrides:
        `getTileRows` in class `FormatReader`
      Parameters:
        `no` - plane index
      Returns:
        tile row count

    - #### getTileColumns

          public int getTileColumns(int no)

      Description copied from interface: `ICompressedTileReader`
      Get the number of columns of tiles in the specified plane in the current series.
      Specified by:
        `getTileColumns` in interface `ICompressedTileReader`
      Overrides:
        `getTileColumns` in class `FormatReader`
      Parameters:
        `no` - plane index
      Returns:
        tile column count

    - #### openCompressedBytes

          public byte[] openCompressedBytes(int no,
                                            int x,
                                            int y)
                                     throws FormatException,
                                            java.io.IOException

      Description copied from interface: `ICompressedTileReader`
      Retrieve the specified tile without performing any decompression.
      Parameters:
        `no` - plane index
        `x` - tile X index (indexed from 0, @see getTileColumns(int))
        `y` - tile Y index (indexed from 0, @see getTileRows(int))
      Returns:
        compressed tile bytes
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### openCompressedBytes

          public byte[] openCompressedBytes(int no,
                                            byte[] buf,
                                            int x,
                                            int y)
                                     throws FormatException,
                                            java.io.IOException

      Description copied from interface: `ICompressedTileReader`
      Retrieve the specified tile without performing any decompression.
      Parameters:
        `no` - plane index
        `buf` - pre-allocated buffer in which to store compressed bytes
        `x` - tile X index (indexed from 0, @see getTileColumns(int))
        `y` - tile Y index (indexed from 0, @see getTileRows(int))
      Returns:
        compressed tile bytes
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### getTileCodec

          public Codec getTileCodec(int no)
                             throws FormatException,
                                    java.io.IOException

      Description copied from interface: `ICompressedTileReader`
      Retrieve a codec that can be used to decompress compressed tiles.
      Parameters:
        `no` - plane index
      Returns:
        codec that can be used for compressed tiles in the specified plane
      Throws:
        `FormatException`
        `java.io.IOException`
      See Also:
        `ICompressedTileReader.openCompressedBytes(int, int, int)`

    - #### getTileCodecOptions

          public CodecOptions getTileCodecOptions(int no,
                                                  int x,
                                                  int y)
                                           throws FormatException,
                                                  java.io.IOException

      Description copied from interface: `ICompressedTileReader`
      Retrieve codec options that can be used to decompressed the specified tile.
      Parameters:
        `no` - plane index
        `x` - tile X index (indexed from 0, @see getTileColumns(int))
        `y` - tile Y index (indexed from 0, @see getTileRows(int))
      Returns:
        codec options
      Throws:
        `FormatException`
        `java.io.IOException`
      See Also:
        `ICompressedTileReader.getTileCodec(int)`

    - #### getAvailableOptions

          protected java.util.ArrayList<java.lang.String> getAvailableOptions()

      Description copied from class: `FormatReader`
      Returns the list of available metadata options.
      Overrides:
        `getAvailableOptions` in class `FormatReader`

    - #### initStandardMetadata

          protected void initStandardMetadata()
                                       throws FormatException,
                                              java.io.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`
        `java.io.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`

    - #### getIFDIndex

          private int getIFDIndex(int coreIndex,
                                  int no)

    - #### getEmission

          protected ome.units.quantity.Length getEmission()

    - #### getExcitation

          protected ome.units.quantity.Length getExcitation()

    - #### getExposureTime

          protected java.lang.Double getExposureTime()

    - #### getDatestamp

          protected ome.xml.model.primitives.Timestamp getDatestamp()

    - #### getPhysicalSizes

          protected ome.units.quantity.Length[] getPhysicalSizes()

    - #### getMagnification

          protected double getMagnification()

    - #### getDyeNames

          protected java.util.ArrayList<java.lang.String> getDyeNames()

    - #### getDisplayColor

          protected ome.xml.model.primitives.Color getDisplayColor()

    - #### getIFD

          protected IFD getIFD(int no)

      Get the IFD corresponding to the given plane in the current series. Initializes the underlying TiffParser if necessary.
      Parameters:
        `no` - index
      Returns:
        corresponding IFD

Copyright © 2026 Open Microscopy Environment