Package loci.formats.in
Class LIFReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.LIFReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
LIFReader is the file format reader for Leica LIF files.
- Author:
- Melissa Linkert melissa at glencoesoftware.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double[]private List[]private booleanprivate String[][]private String[]private List[]private List[]private String[]private HashMap[]private List[]private Double[][]private static final StringThe encoding used in this file.private longprivate Double[][]private Double[][]private List<ome.units.quantity.Length> private List<ome.units.quantity.Length> private List[]private boolean[]private boolean[]private Double[][]private String[]private LIFReader.ROI[][]private String[]private List[]private List[]private List[]private List[]private intprivate Double[]static final bytestatic final byteprivate static final Stringprivate Double[]private List<LIFReader.MemoryBlock> Memory blocks including offsets and IDprivate static final longprivate String[]private String[]static final booleanstatic final Stringprivate Double[]private ome.units.quantity.Length[]private ome.units.quantity.Length[]private ome.units.quantity.Length[]private int[][]private Double[]private String[]private static final Stringprivate boolean[]private long[]private int[]private Double[][]private Double[]private Double[]private Double[]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 TypeMethodDescriptionprivate voidaddUserCommentMeta(Element imageNode, int image) private ome.units.quantity.LengthcheckFlip(boolean flip, ome.units.quantity.Length pos) voidclose(boolean fileOnly) Closes the currently open file.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.Returns the list of available metadata options.private ome.xml.model.primitives.ColorgetChannelColor(int colorCode) private NodeListprivate intgetChannelIndex(Element filterSetting) private NodeListprivate ElementgetImageDescription(Element root) private ElementgetMetadataRoot(String xml) private NodeListintReturns the optimal sub-image height for use with openBytes.String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.private intgetTileIndex(int coreIndex) protected voidInitializes the given file (parsing header information, etc.).private voidinitMetadata(String xml) Parses a string of XML and puts the values in a Hashtable.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 voidpopulateOriginalMetadata(Element root, Deque<String> nameStack, int[] key_index, int jj) private voidseekStartOfPlane(int no, long dataOffset, long planeSize) private voidtranslateAttachmentNodes(Element imageNode, int image) private voidtranslateDetectors(Element imageNode, int image) private voidtranslateFilterSettings(Element imageNode, int image) private voidtranslateImageNames(Element imageNode, int image) private voidtranslateImageNodes(Element imageNode, int i) private voidtranslateLaserLines(Element imageNode, int image) private voidtranslateMetadata(Element root) private voidtranslateROIs(Element imageNode, int image) private voidtranslateScannerSettings(Element imageNode, int image) private voidtranslateSingleROIs(Element imageNode, int image) private doubletranslateSingleTimestamp(String timestamp) private doubletranslateSingleTimestamp(Element timestamp) private voidtranslateTimestamps(Element imageNode, int image) booleanMethods 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, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, 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, isSingleFile, isThisType, 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
-
OLD_PHYSICAL_SIZE_KEY
- See Also:
-
OLD_PHYSICAL_SIZE_DEFAULT
public static final boolean OLD_PHYSICAL_SIZE_DEFAULT- See Also:
-
LIF_MAGIC_BYTE
public static final byte LIF_MAGIC_BYTE- See Also:
-
LIF_MEMORY_BYTE
public static final byte LIF_MEMORY_BYTE- See Also:
-
ENCODING
The encoding used in this file.- See Also:
-
LOGO_FILE
- See Also:
-
STYLESHEET_FILE
- See Also:
-
CHANNEL_PRIORITIES
-
METER_MULTIPLY
private static final long METER_MULTIPLY- See Also:
-
memoryBlocks
Memory blocks including offsets and ID -
realChannel
private int[][] realChannel -
lastChannel
private int lastChannel -
lutNames
-
physicalSizeXs
-
physicalSizeYs
-
fieldPosX
-
fieldPosY
-
descriptions
-
microscopeModels
-
serialNumber
-
pinholes
-
zooms
-
zSteps
-
tSteps
-
lensNA
-
flipX
private boolean[] flipX -
flipY
private boolean[] flipY -
swapXY
private boolean[] swapXY -
expTimes
-
gains
-
detectorOffsets
-
channelNames
-
detectorModels
-
exWaves
-
activeDetector
-
detectorIndexes
-
immersions
-
corrections
-
objectiveModels
-
magnification
-
posX
private ome.units.quantity.Length[] posX -
posY
private ome.units.quantity.Length[] posY -
posZ
private ome.units.quantity.Length[] posZ -
refractiveIndex
-
cutIns
-
cutOuts
-
filterModels
-
timestamps
-
laserWavelength
-
laserIntensity
-
laserActive
-
laserFrap
-
imageROIs
-
alternateCenter
private boolean alternateCenter -
imageNames
-
acquiredDate
private double[] acquiredDate -
tileCount
private int[] tileCount -
tileBytesInc
private long[] tileBytesInc -
endPointer
private long endPointer
-
-
Constructor Details
-
LIFReader
public LIFReader()Constructs a new Leica LIF reader.
-
-
Method Details
-
createChannelPriorities
-
useOldPhysicalSizeCalculation
public boolean useOldPhysicalSizeCalculation() -
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
-
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
-
get8BitLookupTable
public byte[][] 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
-
get16BitLookupTable
public short[][] 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
-
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:
-
seekStartOfPlane
- 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
-
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
-
getAvailableOptions
Description copied from class:FormatReaderReturns the list of available metadata options.- Overrides:
getAvailableOptionsin classFormatReader
-
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
-
initMetadata
Parses a string of XML and puts the values in a Hashtable.- Throws:
FormatExceptionIOException
-
checkFlip
private ome.units.quantity.Length checkFlip(boolean flip, ome.units.quantity.Length pos) -
getMetadataRoot
- Throws:
FormatExceptionIOException
-
translateMetadata
- Throws:
FormatException
-
populateOriginalMetadata
-
translateImageNames
-
translateDetectors
- Throws:
FormatException
-
translateROIs
- Throws:
FormatException
-
translateSingleROIs
- Throws:
FormatException
-
translateLaserLines
- Throws:
FormatException
-
translateTimestamps
- Throws:
FormatException
-
translateSingleTimestamp
-
translateSingleTimestamp
-
translateFilterSettings
- Throws:
FormatException
-
translateScannerSettings
- Throws:
FormatException
-
translateAttachmentNodes
- Throws:
FormatException
-
addUserCommentMeta
- Throws:
FormatException
-
translateImageNodes
- Throws:
FormatException
-
getNodes
-
getImageDescription
-
getChannelDescriptionNodes
-
getDimensionDescriptionNodes
-
getChannelIndex
-
getChannelColor
private ome.xml.model.primitives.Color getChannelColor(int colorCode) -
getTileIndex
private int getTileIndex(int coreIndex)
-