Class MultipleImagesReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
loci.formats.in.LeicaMicrosystemsMetadata.MultipleImagesReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
MultipleImagesReader presents a number of image files as one image reference
- Author:
- Constanze Wendlandt constanze.wendlandt at leica-microsystems.com
-
Nested Class Summary
Nested classes/interfaces inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
LMSFileReader.ImageFormat -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate LMSFileReader.ImageFormatprivate intprivate List<FormatReader> private intprivate intFields 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, 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.intGets the number of valid bits per pixel.Returns the file format in which actual image bytes are storedintGets the pixel type.intGets the number of channels returned with each call to openBytes.intgetSizeC()Gets the size of the C dimension.private voidinitReaders(List<String> ids) Creates an internal reader for each image filebooleanisRGB()Checks if the image planes in the file have more than one channel perIFormatReader.openBytes(int)call.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.voidReopen any files that were closed, and which are expected to be open while the reader is open.voidvoidsetMetadataTempBuffer(MetadataTempBuffer metaTemp) voidsetSeries(int no) Sets the field MultipleImagesReader.series.voidRearranges frame order from ZSTC order (used in XLIFs) to desired CoreMetadata.dimensionOrderMethods 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, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, 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, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, initFile, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, seriesToCoreIndex, setCoreIndex, 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
-
readers
-
imageFormat
-
tileCount
private int tileCount -
dimensionsSwapped
private boolean dimensionsSwapped -
series
private int series -
imageIndex
private int imageIndex
-
-
Constructor Details
-
MultipleImagesReader
- Throws:
FormatExceptionIOException
-
-
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.
-
setSeries
public void setSeries(int no) Sets the field MultipleImagesReader.series. Needs to be called before calling MultipleImagesReader.openBytes()- Specified by:
setSeriesin interfaceIFormatReader- Overrides:
setSeriesin classFormatReader
-
getRGBChannelCount
public int getRGBChannelCount()Description copied from interface:IFormatReaderGets the number of channels returned with each call to openBytes. The most common case where this value is greater than 1 is for interleaved RGB data, such as a 24-bit color image plane. However, it is possible for this value to be greater than 1 for non-interleaved data, such as an RGB TIFF with Planar rather than Chunky configuration.- Specified by:
getRGBChannelCountin interfaceIFormatReader- Overrides:
getRGBChannelCountin classFormatReader
-
getBitsPerPixel
public int getBitsPerPixel()Description copied from interface:IFormatReaderGets the number of valid bits per pixel. The number of valid bits per pixel is always less than or equal to the number of bits per pixel that correspond toIFormatReader.getPixelType().- Specified by:
getBitsPerPixelin interfaceIFormatReader- Overrides:
getBitsPerPixelin classFormatReader
-
getPixelType
public int getPixelType()Description copied from interface:IFormatReaderGets the pixel type.- Specified by:
getPixelTypein interfaceIFormatReader- Overrides:
getPixelTypein classFormatReader- Returns:
- the pixel type as an enumeration from
FormatToolsstatic pixel types such asFormatTools.INT8.
-
getSizeC
public int getSizeC()Description copied from interface:IFormatReaderGets the size of the C dimension.- Specified by:
getSizeCin interfaceIFormatReader- Overrides:
getSizeCin classFormatReader
-
isRGB
public boolean isRGB()Description copied from interface:IFormatReaderChecks if the image planes in the file have more than one channel perIFormatReader.openBytes(int)call. This method returns true if and only ifIFormatReader.getRGBChannelCount()returns a value greater than 1.- Specified by:
isRGBin interfaceIFormatReader- Overrides:
isRGBin 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
-
initReaders
Creates an internal reader for each image file- Parameters:
ids- list of file ids- Throws:
FormatExceptionIOException
-
getImageFormat
Description copied from class:LMSFileReaderReturns the file format in which actual image bytes are stored- Specified by:
getImageFormatin classLMSFileReader
-
setMetadataTempBuffer
-
setCoreMetadata
-
swapDimensions
Rearranges frame order from ZSTC order (used in XLIFs) to desired CoreMetadata.dimensionOrder- Throws:
FormatException
-
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
-