Package loci.formats.in
Class ZeissLSMReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.ZeissLSMReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
ZeissLSMReader is the file format reader for Zeiss LSM files.
- Author:
- Eric Kjellman egkjellman at wisc.edu, Melissa Linkert melissa at glencoesoftware.com, Curtis Rueden ctrueden at wisc.edu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate static final intprivate Stringprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate ome.xml.model.primitives.Color[]private String[][]private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate intprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate intprivate booleanprivate static final intprivate static final intprivate static final intprivate static final intprivate String[]private byte[][][]static final String[]private intprivate intprivate intprivate intprivate intprivate intprivate intprivate static final intprivate static final intprivate static final intprivate doubleprivate doubleprivate doubleprivate static final intprivate intprivate doubleprivate doubleprivate doubleprivate static final intprivate byte[]private intprivate intprivate loci.common.Regionprivate static final intprivate static final intprivate static final intData types.private static final intprivate static final intprivate static final intprivate static final intprivate intprivate static final intprivate booleanprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intSubblock types.private static final intprivate static final intprivate static final intDrawing element types.private TiffParserprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intData types.private Stringprivate static final intTag identifying a Zeiss LSM file.private doubleFields 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.intReturns an indication of whether the files in a multi-file dataset can be handled individually.short[][]Gets the 16-bit color lookup table associated with the most recently opened image.byte[][]Gets the 8-bit color lookup table associated with the most recently opened image.private loci.common.RandomAccessInputStreamprivate intgetEffectiveSeries(int currentSeries) private intgetExtraSeries(String file) private StringgetLSMFileFromSeries(int currentSeries) private StringgetMDBFile(String id) intReturns the optimal sub-image height for use with openBytes.intprivate intgetPosition(int currentSeries) String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.protected voidInitializes the given file (parsing header information, etc.).protected voidinitMetadata(int series) booleanisSingleFile(String id) Returns true if the named file is expected to be the only file in the dataset.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 voidprivate String[]Parse a .mdb file and return a list of referenced .lsm files.protected voidparseOverlays(int series, long data, String suffix, MetadataStore store) Parses overlay-related fields.protected voidpopulateMetadataStore(ZeissLSMReader.SubBlock block, MetadataStore store, int series) private Integerprivate ObjectvoidsetCoreIndex(int coreIndex) Set the current resolution/series (ignores subresolutions).voidsetSeries(int series) Activates the specified series.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, flattenHashtables, 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, 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, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, reopenFile, seriesToCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, 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
-
MDB_SUFFIX
-
ZEISS_ID
private static final int ZEISS_IDTag identifying a Zeiss LSM file.- See Also:
-
TYPE_SUBBLOCK
private static final int TYPE_SUBBLOCKData types.- See Also:
-
TYPE_ASCII
private static final int TYPE_ASCII- See Also:
-
TYPE_LONG
private static final int TYPE_LONG- See Also:
-
TYPE_RATIONAL
private static final int TYPE_RATIONAL- See Also:
-
TYPE_DATE
private static final int TYPE_DATE- See Also:
-
TYPE_BOOLEAN
private static final int TYPE_BOOLEAN- See Also:
-
SUBBLOCK_RECORDING
private static final int SUBBLOCK_RECORDINGSubblock types.- See Also:
-
SUBBLOCK_LASER
private static final int SUBBLOCK_LASER- See Also:
-
SUBBLOCK_TRACK
private static final int SUBBLOCK_TRACK- See Also:
-
SUBBLOCK_DETECTION_CHANNEL
private static final int SUBBLOCK_DETECTION_CHANNEL- See Also:
-
SUBBLOCK_ILLUMINATION_CHANNEL
private static final int SUBBLOCK_ILLUMINATION_CHANNEL- See Also:
-
SUBBLOCK_BEAM_SPLITTER
private static final int SUBBLOCK_BEAM_SPLITTER- See Also:
-
SUBBLOCK_DATA_CHANNEL
private static final int SUBBLOCK_DATA_CHANNEL- See Also:
-
SUBBLOCK_TIMER
private static final int SUBBLOCK_TIMER- See Also:
-
SUBBLOCK_MARKER
private static final int SUBBLOCK_MARKER- See Also:
-
SUBBLOCK_END
private static final int SUBBLOCK_END- See Also:
-
RECORDING_NAME
private static final int RECORDING_NAMEData types.- See Also:
-
RECORDING_DESCRIPTION
private static final int RECORDING_DESCRIPTION- See Also:
-
RECORDING_OBJECTIVE
private static final int RECORDING_OBJECTIVE- See Also:
-
RECORDING_ZOOM
private static final int RECORDING_ZOOM- See Also:
-
RECORDING_SAMPLE_0TIME
private static final int RECORDING_SAMPLE_0TIME- See Also:
-
RECORDING_CAMERA_BINNING
private static final int RECORDING_CAMERA_BINNING- See Also:
-
TRACK_ACQUIRE
private static final int TRACK_ACQUIRE- See Also:
-
TRACK_TIME_BETWEEN_STACKS
private static final int TRACK_TIME_BETWEEN_STACKS- See Also:
-
LASER_NAME
private static final int LASER_NAME- See Also:
-
LASER_ACQUIRE
private static final int LASER_ACQUIRE- See Also:
-
LASER_POWER
private static final int LASER_POWER- See Also:
-
CHANNEL_DETECTOR_GAIN
private static final int CHANNEL_DETECTOR_GAIN- See Also:
-
CHANNEL_PINHOLE_DIAMETER
private static final int CHANNEL_PINHOLE_DIAMETER- See Also:
-
CHANNEL_AMPLIFIER_GAIN
private static final int CHANNEL_AMPLIFIER_GAIN- See Also:
-
CHANNEL_FILTER_SET
private static final int CHANNEL_FILTER_SET- See Also:
-
CHANNEL_FILTER
private static final int CHANNEL_FILTER- See Also:
-
CHANNEL_ACQUIRE
private static final int CHANNEL_ACQUIRE- See Also:
-
CHANNEL_NAME
private static final int CHANNEL_NAME- See Also:
-
ILLUM_CHANNEL_NAME
private static final int ILLUM_CHANNEL_NAME- See Also:
-
ILLUM_CHANNEL_ATTENUATION
private static final int ILLUM_CHANNEL_ATTENUATION- See Also:
-
ILLUM_CHANNEL_WAVELENGTH
private static final int ILLUM_CHANNEL_WAVELENGTH- See Also:
-
ILLUM_CHANNEL_ACQUIRE
private static final int ILLUM_CHANNEL_ACQUIRE- See Also:
-
START_TIME
private static final int START_TIME- See Also:
-
DATA_CHANNEL_NAME
private static final int DATA_CHANNEL_NAME- See Also:
-
DATA_CHANNEL_ACQUIRE
private static final int DATA_CHANNEL_ACQUIRE- See Also:
-
BEAM_SPLITTER_FILTER
private static final int BEAM_SPLITTER_FILTER- See Also:
-
BEAM_SPLITTER_FILTER_SET
private static final int BEAM_SPLITTER_FILTER_SET- See Also:
-
TEXT
private static final int TEXTDrawing element types.- See Also:
-
LINE
private static final int LINE- See Also:
-
SCALE_BAR
private static final int SCALE_BAR- See Also:
-
OPEN_ARROW
private static final int OPEN_ARROW- See Also:
-
CLOSED_ARROW
private static final int CLOSED_ARROW- See Also:
-
RECTANGLE
private static final int RECTANGLE- See Also:
-
ELLIPSE
private static final int ELLIPSE- See Also:
-
CLOSED_POLYLINE
private static final int CLOSED_POLYLINE- See Also:
-
OPEN_POLYLINE
private static final int OPEN_POLYLINE- See Also:
-
CLOSED_BEZIER
private static final int CLOSED_BEZIER- See Also:
-
OPEN_BEZIER
private static final int OPEN_BEZIER- See Also:
-
CIRCLE
private static final int CIRCLE- See Also:
-
PALETTE
private static final int PALETTE- See Also:
-
POLYLINE_ARROW
private static final int POLYLINE_ARROW- See Also:
-
BEZIER_WITH_ARROW
private static final int BEZIER_WITH_ARROW- See Also:
-
ANGLE
private static final int ANGLE- See Also:
-
CIRCLE_3POINT
private static final int CIRCLE_3POINT- See Also:
-
METADATA_KEYS
-
pixelSizeX
private double pixelSizeX -
pixelSizeY
private double pixelSizeY -
pixelSizeZ
private double pixelSizeZ -
lut
private byte[][][] lut -
timestamps
-
lsmFilenames
-
ifdsList
-
tiffParser
-
nextLaser
private int nextLaser -
nextDetector
private int nextDetector -
nextFilter
private int nextFilter -
nextDichroicChannel
private int nextDichroicChannel -
nextDichroic
private int nextDichroic -
nextIllumChannel
private int nextIllumChannel -
nextDetectChannel
private int nextDetectChannel -
splitPlanes
private boolean splitPlanes -
zoom
private double zoom -
imageNames
-
binning
-
xCoordinates
-
yCoordinates
-
zCoordinates
-
dimensionM
private int dimensionM -
dimensionP
private int dimensionP -
rotations
private int rotations -
phases
private int phases -
illuminations
private int illuminations -
seriesCounts
-
userName
-
channelNames
-
originX
private double originX -
originY
private double originY -
originZ
private double originZ -
totalROIs
private int totalROIs -
prevPlane
private int prevPlane -
prevChannel
private int prevChannel -
prevBuf
private byte[] prevBuf -
prevRegion
private loci.common.Region prevRegion -
acquiredDate
-
channelColor
private ome.xml.model.primitives.Color[] channelColor -
isSIM
private transient boolean isSIM
-
-
Constructor Details
-
ZeissLSMReader
public ZeissLSMReader()Constructs a new Zeiss LSM reader.
-
-
Method Details
-
getOptimalWidth
public int getOptimalWidth() -
getOptimalTileHeight
public int getOptimalTileHeight()Description copied from interface:IFormatReaderReturns the optimal sub-image height for use with openBytes.- Specified by:
getOptimalTileHeightin interfaceIFormatReader- Overrides:
getOptimalTileHeightin classFormatReader
-
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
-
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
-
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
-
fileGroupOption
Description copied from interface:IFormatReaderReturns 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:
fileGroupOptionin interfaceIFormatReader- Overrides:
fileGroupOptionin classFormatReader- 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_GROUPindicates that the files cannot be handled separately; the reader will always detect and read all files in the dataset.FormatTools.CAN_GROUPindicates that the files may be handled separately, but file grouping must then be disabled viaIFormatReader.setGroupFiles(boolean).FormatTools.CANNOT_GROUPindicates that the files must be handled separately; the reader will not attempt to read all files in the dataset (this is rare). - Throws:
FormatExceptionIOException- See Also:
-
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
-
get8BitLookupTable
Description copied from interface:IFormatReaderGets the 8-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or ifIFormatReader.isIndexed()returns false, then this may return null. Also, ifIFormatReader.getPixelType()returns anything other thanFormatTools.INT8orFormatTools.UINT8, this method will return null.- Specified by:
get8BitLookupTablein interfaceIFormatReader- Overrides:
get8BitLookupTablein classFormatReader- Throws:
FormatExceptionIOException
-
get16BitLookupTable
Description copied from interface:IFormatReaderGets the 16-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or ifIFormatReader.isIndexed()returns false, then this may return null. Also, ifIFormatReader.getPixelType()returns anything other thanFormatTools.INT16orFormatTools.UINT16, this method will return null.- Specified by:
get16BitLookupTablein interfaceIFormatReader- Overrides:
get16BitLookupTablein classFormatReader- Throws:
FormatExceptionIOException
-
setCoreIndex
public void setCoreIndex(int coreIndex) Description copied from interface:IFormatReaderSet the current resolution/series (ignores subresolutions). Equivalent to setSeries, but with flattened resolutions always set to false.- Specified by:
setCoreIndexin interfaceIFormatReader- Overrides:
setCoreIndexin classFormatReader
-
setSeries
public void setSeries(int series) Description copied from interface:IFormatReaderActivates the specified series. This also resets the resolution to 0.- Specified by:
setSeriesin interfaceIFormatReader- Overrides:
setSeriesin 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:
-
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
-
getMDBFile
- Throws:
FormatExceptionIOException
-
getEffectiveSeries
private int getEffectiveSeries(int currentSeries) -
getLSMFileFromSeries
-
getExtraSeries
- Throws:
FormatExceptionIOException
-
getPosition
private int getPosition(int currentSeries) -
getCZTag
- Throws:
FormatExceptionIOException
-
initMetadata
- Throws:
FormatExceptionIOException
-
populateMetadataStore
protected void populateMetadataStore(ZeissLSMReader.SubBlock block, MetadataStore store, int series) throws FormatException - Throws:
FormatException
-
parseOverlays
protected void parseOverlays(int series, long data, String suffix, MetadataStore store) throws IOException Parses overlay-related fields.- Throws:
IOException
-
parseMDB
Parse a .mdb file and return a list of referenced .lsm files.- Throws:
FormatExceptionIOException
-
createKeys
-
readEntry
- Throws:
IOException
-
readValue
- Throws:
IOException
-
parseApplicationTags
- Throws:
IOException
-