Package loci.formats.in
Class XLEFReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
loci.formats.in.XLEFReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
XLEFReader is the file format reader for Leica Microsystems' XLEF files.
- Author:
- Melissa Linkert melissa at glencoesoftware.com, Constanze Wendlandt constanze.wendlandt at leica-microsystems.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classHelper class to sort file paths by name and depthNested classes/interfaces inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
LMSFileReader.ImageFormat -
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidclose(boolean fileOnly) Closes the currently open file.intReturns an indication of whether the files in a multi-file dataset can be handled individually.Returns the file format in which actual image bytes are storedprivate intgetReaderIndex(int seriesIndex) Returns the index of the correct reader for the series index.private byte[]getRgbChannel(int channel, byte[] in) Returns single channel data for an rgb planeprivate intgetSeriesPerReaderIndex(int series) Returns the index of the series (tile) in the corresponding readerString[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.String[]getUsedFiles(boolean noPixels) Returns an array of filenames needed to open this dataset.protected voidInitializes the given file (parsing header information, etc.).booleanisSingleFile(String id) Returns true if the named file is expected to be the only file in the dataset.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[]openBytes(int no, int x, int y, int w, int h) Obtains a sub-image of the specified image plane, whose upper-left corner is given by (x, y).private byte[]openBytesJpeg(int no, byte[] buf, int x, int y, int w, int h) Gets bytes of jpeg images.voidReopen any files that were closed, and which are expected to be open while the reader is open.private voidprivate voidSorts frames of all MultipleImagesReaders as per core dimension sizes and orderprivate voidSorts file paths by name and depth and moves current file path to the beginningprivate intsum(int[] arr, int start, int end) Sums up all values of an array, from start index to (including) end indexprivate voidtransformBytes8To16(byte[] in, byte[] out, int outRes) Transforms an 8bit byte array to a 16bit byte array, optionally with bit upscaling (8-16bit)Methods 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, 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, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, 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
-
readers
-
-
Constructor Details
-
XLEFReader
public XLEFReader()Constructs a new Leica XLEF reader.
-
-
Method Details
-
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.
-
openBytes
Description copied from interface:IFormatReaderObtains a sub-image of the specified image plane, whose upper-left corner is given by (x, y).- Specified by:
openBytesin interfaceIFormatReader- Overrides:
openBytesin classFormatReader- Throws:
FormatExceptionIOException
-
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
-
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
-
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:
-
getUsedFiles
Description copied from interface:IFormatReaderReturns an array of filenames needed to open this dataset. 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:
getUsedFilesin interfaceIFormatReader- Overrides:
getUsedFilesin classFormatReader
-
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
-
reopenFile
Description copied from interface:IFormatReaderReopen any files that were closed, and which are expected to be open while the reader is open. This assumes thatIFormatHandler.setId(java.lang.String)has been called, but close(false) has not been called.- Specified by:
reopenFilein interfaceIFormatReader- Overrides:
reopenFilein classFormatReader- Throws:
IOException
-
getImageFormat
Description copied from class:LMSFileReaderReturns the file format in which actual image bytes are stored- Specified by:
getImageFormatin classLMSFileReader
-
getReaderIndex
private int getReaderIndex(int seriesIndex) Returns the index of the correct reader for the series index. Currently, tilescans are treated as if each tile was an own series (like in LIFReader), so one reader may contain multiple series.- Parameters:
seriesIndex- index of series- Returns:
- reader which contains the series
-
getSeriesPerReaderIndex
private int getSeriesPerReaderIndex(int series) Returns the index of the series (tile) in the corresponding reader- Parameters:
series- index of the series over all readers- Returns:
-
openBytesJpeg
private byte[] openBytesJpeg(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException Gets bytes of jpeg images. Originally monochrome images that were stored by LASX as 24bit (RGB) jpegs are transformed to monochrome again (upscaled to their original bit depth)- Parameters:
no- the plane index within the current seriesbuf- a pre-allocated bufferx- 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:
- Throws:
FormatExceptionIOException
-
sortMultipleImagesReaders
Sorts frames of all MultipleImagesReaders as per core dimension sizes and order- Throws:
FormatException
-
setMetadataOfMultipleImagesReaders
private void setMetadataOfMultipleImagesReaders() -
transformBytes8To16
private void transformBytes8To16(byte[] in, byte[] out, int outRes) Transforms an 8bit byte array to a 16bit byte array, optionally with bit upscaling (8-16bit)- Parameters:
in- 8bit buffer with dataout- 16bit buffer to be filledoutRes- resolution to which data shall be upscaled (8-16)
-
getRgbChannel
private byte[] getRgbChannel(int channel, byte[] in) Returns single channel data for an rgb plane- Parameters:
channel- Index of channel that shall be readin- channel separated buffer
-
sum
private int sum(int[] arr, int start, int end) Sums up all values of an array, from start index to (including) end index- Parameters:
arr-start- first array position whose value shall be addedend- last array position whose value shall be added- Returns:
-
sortPaths
Sorts file paths by name and depth and moves current file path to the beginning- Parameters:
paths-
-