Package loci.formats.in
Class DeltavisionReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.DeltavisionReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
- Direct Known Subclasses:
RCPNLReader
DeltavisionReader is the file format reader for Deltavision files.
- Author:
- Melissa Linkert melissa at glencoesoftware.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classThis private class structure holds the details for the extended header. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether or not the stage moved backwards.private booleanstatic final StringDeprecated.static final String[]private Stringstatic final intstatic final intprotected DeltavisionReader.DVExtHdrFields[]Initialize an array of Extended Header Field structures.private intSize of extended header.private static final intprivate static final String[]private Stringprivate int[]private static final shortprivate Stringprivate static final intprivate Double[]private static final intprivate booleanprotected intprotected intThe number of ints in each extended header section.protected intprotected booleanprivate booleanprotected intSize of one time element in the extended header.protected intSize of one wave in the extended header.private intNumber of tiles in X direction.private intNumber of tiles in Y direction.protected intSize of one z section in the extended header.Fields inherited from class loci.formats.FormatReader
core, coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSIONFields inherited from class loci.formats.FormatHandler
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixesFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(boolean fileOnly) Closes the currently open file.private voidFind the log files.private StringgetImageSequence(int imageSequence) Get the image sequence string.private StringgetPixelString(int filePixelType) Get a descriptive string representing the pixel type.private intgetPixelType(int filePixelType) Get the OME pixel type from the pixel type stored in the file.longgetPlaneByteOffset(int currentZ, int currentW, int currentT) Given any specific Z, W, and T of a plane, determine the absolute byte offset of the plane in the file.private intgetPlaneIndex(int series, int plane) String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.private intprotected voidprotected voidInitializes the given file (parsing header information, etc.).protected voidbooleanisSingleFile(String id) Returns true if the named file is expected to be the only file in the dataset.booleanisThisType(String name, boolean open) Checks if a file matches the type of this format reader.booleanisThisType(loci.common.RandomAccessInputStream stream) Checks if the given stream is a valid stream for this file format.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.private voidparseDeconvolutionLog(loci.common.RandomAccessInputStream s, MetadataStore store) Parse deconvolution output, if it exists.private booleanparseLogFile(MetadataStore store) Extract metadata from associated log file, if it exists.protected voidpopulateObjective(MetadataStore store, int lensID) Populate an Objective based upon the lens ID.private voidreadWavelength(int channel, MetadataStore store) private voidsetOffsetInfo(int numZSections, int numWaves, int numTimes, int numPanels) This method calculates the size of a w, t, z section depending on which sequence is being usedvoidsetTruncatedFileFlag(boolean truncatedFileFlag) This flag indicates if the file is known to be truncated.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, coreIndexToSeries, fileGroupOption, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, 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, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, updateMetadataListsMethods inherited from class loci.formats.FormatHandler
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface loci.formats.ICompressedTileReader
getTileCodec, getTileCodecOptions, openCompressedBytes, openCompressedBytesMethods inherited from interface loci.formats.IFormatHandler
getFormat, getNativeDataType, getSuffixesMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
DV_MAGIC_BYTES_1
public static final int DV_MAGIC_BYTES_1- See Also:
-
DV_MAGIC_BYTES_2
public static final int DV_MAGIC_BYTES_2- See Also:
-
DATE_FORMAT
Deprecated.UseDATE_FORMATSinstead- See Also:
-
DATE_FORMATS
-
LITTLE_ENDIAN
private static final short LITTLE_ENDIAN- See Also:
-
HEADER_LENGTH
private static final int HEADER_LENGTH- See Also:
-
NEW_TYPE
private static final int NEW_TYPE- See Also:
-
MAX_CHANNELS
private static final int MAX_CHANNELS- See Also:
-
IMAGE_TYPES
-
extSize
private int extSizeSize of extended header. -
wSize
protected int wSizeSize of one wave in the extended header. -
zSize
protected int zSizeSize of one z section in the extended header. -
tSize
protected int tSizeSize of one time element in the extended header. -
panelSize
protected int panelSize -
xTiles
private int xTilesNumber of tiles in X direction. -
yTiles
private int yTilesNumber of tiles in Y direction. -
backwardsStageX
private boolean backwardsStageXWhether or not the stage moved backwards. -
backwardsStageY
private boolean backwardsStageY -
numIntsPerSection
protected int numIntsPerSectionThe number of ints in each extended header section. These fields appear to be all blank but need to be skipped to get to the floats afterwards -
numFloatsPerSection
protected int numFloatsPerSection -
extHdrFields
Initialize an array of Extended Header Field structures. -
ndFilters
-
lengths
private int[] lengths -
logFile
-
deconvolutionLogFile
-
truncatedFileFlag
private boolean truncatedFileFlag -
imageSequence
-
newFileType
private boolean newFileType -
positionInT
protected boolean positionInT
-
-
Constructor Details
-
DeltavisionReader
public DeltavisionReader()Constructs a new Deltavision reader.
-
-
Method Details
-
isSingleFile
Description copied from interface:IFormatReaderReturns true if the named file is expected to be the only file in the dataset. For single-file formats, always returns true.- Specified by:
isSingleFilein interfaceIFormatReader- Overrides:
isSingleFilein classFormatReader- Throws:
FormatExceptionIOException
-
isThisType
Description copied from class:FormatReaderChecks 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 withFormatReader.isThisType(RandomAccessInputStream).- Specified by:
isThisTypein interfaceIFormatReader- Overrides:
isThisTypein classFormatReader- Parameters:
open- If true, and the file extension is insufficient to determine the file type, the (existing) file is opened for further analysis.
-
isThisType
Description copied from interface:IFormatReaderChecks if the given stream is a valid stream for this file format. The number of bytes read is format-dependent.- Specified by:
isThisTypein interfaceIFormatReader- Overrides:
isThisTypein classFormatReader- 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
-
getSeriesUsedFiles
Description copied from interface:IFormatReaderReturns 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 toIFormatHandler.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:
getSeriesUsedFilesin interfaceIFormatReader- Overrides:
getSeriesUsedFilesin classFormatReader
-
openBytes
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException Description copied from interface:IFormatReaderObtains a sub-image of the specified image plane into a pre-allocated byte array.- Specified by:
openBytesin interfaceIFormatReader- Specified by:
openBytesin classFormatReader- 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-imagey- Y coordinate of the upper-left corner of the sub-imagew- width of the sub-imageh- height of the sub-image- Returns:
- the pre-allocated buffer
buffor 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
Description copied from interface:IFormatReaderCloses the currently open file. If the flag is set, this is all that happens; if unset, it is equivalent to callingCloseable.close().- Specified by:
closein interfaceIFormatReader- Overrides:
closein classFormatReader- Throws:
IOException
-
setTruncatedFileFlag
public void setTruncatedFileFlag(boolean truncatedFileFlag) This flag indicates if the file is known to be truncated. If true, the dimension size information is kept as it is specified in the file header, otherwise the length of the file is used to override size information. This flag must be set beforeFormatReader.setId(String)is called. Default is false. -
initFile
Description copied from class:FormatReaderInitializes the given file (parsing header information, etc.). Most subclasses should override this method to perform initialization operations such as parsing metadata.- Overrides:
initFilein classFormatReader- Throws:
FormatException- if a parsing error occurs processing the file.IOException- if an I/O error occurs processing the file
-
initPixels
- Throws:
FormatExceptionIOException
-
initExtraMetadata
- Throws:
FormatExceptionIOException
-
getPixelString
Get a descriptive string representing the pixel type. -
getPixelType
private int getPixelType(int filePixelType) Get the OME pixel type from the pixel type stored in the file. -
getImageSequence
Get the image sequence string. -
setOffsetInfo
private void setOffsetInfo(int numZSections, int numWaves, int numTimes, int numPanels) This method calculates the size of a w, t, z section depending on which sequence is being used- Parameters:
numZSections-numWaves-numTimes-numPanels-
-
getTotalPlaneHeaderSize
private int getTotalPlaneHeaderSize() -
getPlaneIndex
private int getPlaneIndex(int series, int plane) -
getPlaneByteOffset
public long getPlaneByteOffset(int currentZ, int currentW, int currentT) Given any specific Z, W, and T of a plane, determine the absolute byte offset of the plane in the file.- Parameters:
currentZ-currentW-currentT-
-
findLogFiles
Find the log files.- Throws:
IOException
-
parseLogFile
Extract metadata from associated log file, if it exists.- Throws:
FormatExceptionIOException
-
parseDeconvolutionLog
private void parseDeconvolutionLog(loci.common.RandomAccessInputStream s, MetadataStore store) throws IOException Parse deconvolution output, if it exists.- Throws:
IOException
-
readWavelength
- Throws:
FormatExceptionIOException
-
populateObjective
Populate an Objective based upon the lens ID. This is based upon information received from Applied Precision.- Throws:
FormatException
-
DATE_FORMATSinstead