Package loci.formats
Class TileStitcher
java.lang.Object
loci.formats.ReaderWrapper
loci.formats.TileStitcher
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate Integer[][]private intprivate intFields inherited from class loci.formats.ReaderWrapper
readerFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a TileStitcher around a new image reader.Constructs a TileStitcher with the given reader. -
Method Summary
Modifier and TypeMethodDescriptionClass<?> Returns the native data type of image planes for this reader, as returned byIFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.savePlane(int, java.lang.Object).intGets the number of series in this file.intgetSizeX()Gets the size of the X dimension.intgetSizeY()Gets the size of the Y dimension.getTileCodec(int no) Retrieve a codec that can be used to decompress compressed tiles.getTileCodecOptions(int no, int x, int y) Retrieve codec options that can be used to decompressed the specified tile.intgetTileColumns(int no) Get the number of columns of tiles in the specified plane in the current series.intgetTileRows(int no) Get the number of rows of tiles in the specified plane in the current series.static TileStitcherConverts the given reader into a TileStitcher, wrapping if needed.byte[]openBytes(int no) Obtains the specified image plane from the current file as a byte array.byte[]openBytes(int no, byte[] buf) Obtains the specified image plane from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel * RGB channel count).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).byte[]openCompressedBytes(int no, byte[] buf, int x, int y) Retrieve the specified tile without performing any decompression.byte[]openCompressedBytes(int no, int x, int y) Retrieve the specified tile without performing any decompression.voidSets the current file name.Methods inherited from class loci.formats.ReaderWrapper
close, close, coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getCoreIndex, getCoreMetadataList, getCurrentFile, getDatasetStructureDescription, getDimensionOrder, getDomains, getEffectiveSizeC, getFillColor, getFormat, getGlobalMetadata, getImageCount, getIndex, getIndex, getMetadataOptions, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getModuloC, getModuloT, getModuloZ, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getReader, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getSeries, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeZ, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openPlane, openThumbBytes, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrap
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
tileX
private int tileX -
tileY
private int tileY -
tileMap
-
-
Constructor Details
-
TileStitcher
public TileStitcher()Constructs a TileStitcher around a new image reader. -
TileStitcher
Constructs a TileStitcher with the given reader.
-
-
Method Details
-
makeTileStitcher
Converts the given reader into a TileStitcher, wrapping if needed. -
getSizeX
public int getSizeX()Description copied from interface:IFormatReaderGets the size of the X dimension.- Specified by:
getSizeXin interfaceIFormatReader- Overrides:
getSizeXin classReaderWrapper
-
getSizeY
public int getSizeY()Description copied from interface:IFormatReaderGets the size of the Y dimension.- Specified by:
getSizeYin interfaceIFormatReader- Overrides:
getSizeYin classReaderWrapper
-
getSeriesCount
public int getSeriesCount()Description copied from interface:IFormatReaderGets the number of series in this file.- Specified by:
getSeriesCountin interfaceIFormatReader- Overrides:
getSeriesCountin classReaderWrapper
-
openBytes
Description copied from interface:IFormatReaderObtains the specified image plane from the current file as a byte array.- Specified by:
openBytesin interfaceIFormatReader- Overrides:
openBytesin classReaderWrapper- Throws:
FormatExceptionIOException- See Also:
-
openBytes
Description copied from interface:IFormatReaderObtains the specified image plane from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel * RGB channel count).- Specified by:
openBytesin interfaceIFormatReader- Overrides:
openBytesin classReaderWrapper- Parameters:
no- the plane index within the current series.buf- a pre-allocated buffer.- 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 classReaderWrapper- Throws:
FormatExceptionIOException
-
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- Overrides:
openBytesin classReaderWrapper- 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.
-
setId
Description copied from interface:IFormatHandlerSets the current file name.- Specified by:
setIdin interfaceIFormatHandler- Overrides:
setIdin classReaderWrapper- Throws:
FormatExceptionIOException
-
getTileRows
public int getTileRows(int no) Description copied from interface:ICompressedTileReaderGet the number of rows of tiles in the specified plane in the current series.- Specified by:
getTileRowsin interfaceICompressedTileReader- Overrides:
getTileRowsin classReaderWrapper- Parameters:
no- plane index- Returns:
- tile row count
-
getTileColumns
public int getTileColumns(int no) Description copied from interface:ICompressedTileReaderGet the number of columns of tiles in the specified plane in the current series.- Specified by:
getTileColumnsin interfaceICompressedTileReader- Overrides:
getTileColumnsin classReaderWrapper- Parameters:
no- plane index- Returns:
- tile column count
-
openCompressedBytes
Description copied from interface:ICompressedTileReaderRetrieve the specified tile without performing any decompression.- Specified by:
openCompressedBytesin interfaceICompressedTileReader- Overrides:
openCompressedBytesin classReaderWrapper- Parameters:
no- plane indexx- tile X index (indexed from 0, @see getTileColumns(int))y- tile Y index (indexed from 0, @see getTileRows(int))- Returns:
- compressed tile bytes
- Throws:
FormatExceptionIOException
-
openCompressedBytes
public byte[] openCompressedBytes(int no, byte[] buf, int x, int y) throws FormatException, IOException Description copied from interface:ICompressedTileReaderRetrieve the specified tile without performing any decompression.- Specified by:
openCompressedBytesin interfaceICompressedTileReader- Overrides:
openCompressedBytesin classReaderWrapper- Parameters:
no- plane indexbuf- pre-allocated buffer in which to store compressed bytesx- tile X index (indexed from 0, @see getTileColumns(int))y- tile Y index (indexed from 0, @see getTileRows(int))- Returns:
- compressed tile bytes
- Throws:
FormatExceptionIOException
-
getTileCodec
Description copied from interface:ICompressedTileReaderRetrieve a codec that can be used to decompress compressed tiles.- Specified by:
getTileCodecin interfaceICompressedTileReader- Overrides:
getTileCodecin classReaderWrapper- Parameters:
no- plane index- Returns:
- codec that can be used for compressed tiles in the specified plane
- Throws:
FormatExceptionIOException- See Also:
-
getTileCodecOptions
Description copied from interface:ICompressedTileReaderRetrieve codec options that can be used to decompressed the specified tile.- Specified by:
getTileCodecOptionsin interfaceICompressedTileReader- Overrides:
getTileCodecOptionsin classReaderWrapper- Parameters:
no- plane indexx- tile X index (indexed from 0, @see getTileColumns(int))y- tile Y index (indexed from 0, @see getTileRows(int))- Returns:
- codec options
- Throws:
FormatExceptionIOException- See Also:
-
getNativeDataType
Description copied from interface:IFormatHandlerReturns the native data type of image planes for this reader, as returned byIFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.savePlane(int, java.lang.Object). For most readers this type will be a byte array; however, some readers call external APIs that work with other types such asBufferedImage.- Specified by:
getNativeDataTypein interfaceIFormatHandler- Overrides:
getNativeDataTypein classReaderWrapper
-