Package loci.formats.in
Class LOFReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
loci.formats.in.LOFReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
LOFReader is the file format reader for Leica Microsystems' LOF files.
- Author:
- Melissa Linkert melissa at glencoesoftware.com, Constanze Wendlandt constanze.wendlandt at leica-microsystems.com
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
LMSFileReader.ImageFormat -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe encoding used in this file.private longprivate intstatic final bytestatic final byteprivate LOFReader.MetadataSourceOffsets to memory blocks, paired with their corresponding description.Fields inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
associatedXmlDoc, log, metaTemp, OLD_PHYSICAL_SIZE_DEFAULT, OLD_PHYSICAL_SIZE_KEYFields 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 voidcheckForLofLayout(loci.common.RandomAccessInputStream in, String filename) Checks if file layout meets lof file specificationsvoidclose(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 file format in which actual image bytes are storedintReturns 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.).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 voidseekStartOfPlane(int no, long dataOffset, long planeSize) voidsetIdWithMetadata(String id, XlifDocument xml) Inits the LOFReader using passed xml (from XLIF) for metadata initiation, instead of reading the LOF's included xmlMethods inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
addSeriesMeta, addSeriesMetaList, fileExists, getCore, makeFilterMetadata, setCore, translateMetadata, translateMetadata, useOldPhysicalSizeCalculationMethods 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, close, coreIndexToSeries, fileGroupOption, 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, isSingleFile, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, 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
-
LOF_MAGIC_BYTE
public static final byte LOF_MAGIC_BYTE- See Also:
-
LOF_MEMORY_BYTE
public static final byte LOF_MEMORY_BYTE- See Also:
-
ENCODING
The encoding used in this file.- See Also:
-
offsets
Offsets to memory blocks, paired with their corresponding description. -
lastChannel
private int lastChannel -
endPointer
private long endPointer -
metadataSource
-
-
Constructor Details
-
LOFReader
public LOFReader()Constructs a new Leica LOF reader. -
LOFReader
-
-
Method Details
-
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:
-
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 classLMSFileReader- Throws:
IOException
-
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
-
getImageFormat
Description copied from class:LMSFileReaderReturns the file format in which actual image bytes are stored- Specified by:
getImageFormatin classLMSFileReader
-
checkForLofLayout
private void checkForLofLayout(loci.common.RandomAccessInputStream in, String filename) throws FormatException, IOException Checks if file layout meets lof file specifications- Parameters:
in- lof file streamfilename- name of the lof file- Throws:
FormatExceptionIOException
-
seekStartOfPlane
- Throws:
IOException
-
getTileIndex
private int getTileIndex(int coreIndex) -
setIdWithMetadata
Inits the LOFReader using passed xml (from XLIF) for metadata initiation, instead of reading the LOF's included xml- Parameters:
id- LOF file idxml- XML from xlif that points to LOF file- Throws:
FormatExceptionIOException
-