public class TileStitcher extends ReaderWrapper
Modifier and Type | Class and Description |
---|---|
(package private) class |
TileStitcher.TileCoordinate |
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
private java.lang.Integer[][] |
tileMap |
private int |
tileX |
private int |
tileY |
reader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
TileStitcher()
Constructs a TileStitcher around a new image reader.
|
TileStitcher(IFormatReader r)
Constructs a TileStitcher with the given reader.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
getNativeDataType()
Returns the native data type of image planes for this reader, as returned
by
IFormatReader.openPlane(int, int, int, int, int) or IFormatWriter.savePlane(int, java.lang.Object) . |
int |
getSeriesCount()
Gets the number of series in this file.
|
int |
getSizeX()
Gets the size of the X dimension.
|
int |
getSizeY()
Gets the size of the Y dimension.
|
Codec |
getTileCodec(int no)
Retrieve a codec that can be used to decompress compressed tiles.
|
CodecOptions |
getTileCodecOptions(int no,
int x,
int y)
Retrieve codec options that can be used to decompressed the specified tile.
|
int |
getTileColumns(int no)
Get the number of columns of tiles in the specified plane in the current series.
|
int |
getTileRows(int no)
Get the number of rows of tiles in the specified plane in the current series.
|
static TileStitcher |
makeTileStitcher(IFormatReader r)
Converts 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.
|
void |
setId(java.lang.String id)
Sets the current file name.
|
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
private static final org.slf4j.Logger LOGGER
private int tileX
private int tileY
private java.lang.Integer[][] tileMap
public TileStitcher()
public TileStitcher(IFormatReader r)
public static TileStitcher makeTileStitcher(IFormatReader r)
public int getSizeX()
IFormatReader
getSizeX
in interface IFormatReader
getSizeX
in class ReaderWrapper
public int getSizeY()
IFormatReader
getSizeY
in interface IFormatReader
getSizeY
in class ReaderWrapper
public int getSeriesCount()
IFormatReader
getSeriesCount
in interface IFormatReader
getSeriesCount
in class ReaderWrapper
public byte[] openBytes(int no) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
FormatException
java.io.IOException
IFormatReader.openBytes(int, byte[])
public byte[] openBytes(int no, byte[] buf) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
no
- the plane index within the current series.buf
- a pre-allocated buffer.buf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.java.io.IOException
- if there was a problem reading the file.public byte[] openBytes(int no, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
FormatException
java.io.IOException
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
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-imagebuf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.java.io.IOException
- if there was a problem reading the file.public void setId(java.lang.String id) throws FormatException, java.io.IOException
IFormatHandler
setId
in interface IFormatHandler
setId
in class ReaderWrapper
FormatException
java.io.IOException
public int getTileRows(int no)
ICompressedTileReader
getTileRows
in interface ICompressedTileReader
getTileRows
in class ReaderWrapper
no
- plane indexpublic int getTileColumns(int no)
ICompressedTileReader
getTileColumns
in interface ICompressedTileReader
getTileColumns
in class ReaderWrapper
no
- plane indexpublic byte[] openCompressedBytes(int no, int x, int y) throws FormatException, java.io.IOException
ICompressedTileReader
openCompressedBytes
in interface ICompressedTileReader
openCompressedBytes
in class ReaderWrapper
no
- plane indexx
- tile X index (indexed from 0, @see getTileColumns(int))y
- tile Y index (indexed frmo 0, @see getTileRows(int))FormatException
java.io.IOException
public byte[] openCompressedBytes(int no, byte[] buf, int x, int y) throws FormatException, java.io.IOException
ICompressedTileReader
openCompressedBytes
in interface ICompressedTileReader
openCompressedBytes
in class ReaderWrapper
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 frmo 0, @see getTileRows(int))FormatException
java.io.IOException
public Codec getTileCodec(int no) throws FormatException, java.io.IOException
ICompressedTileReader
getTileCodec
in interface ICompressedTileReader
getTileCodec
in class ReaderWrapper
no
- plane indexFormatException
java.io.IOException
ICompressedTileReader.openCompressedBytes(int, int, int)
public CodecOptions getTileCodecOptions(int no, int x, int y) throws FormatException, java.io.IOException
ICompressedTileReader
getTileCodecOptions
in interface ICompressedTileReader
getTileCodecOptions
in class ReaderWrapper
no
- plane indexx
- tile X index (indexed from 0, @see getTileColumns(int))y
- tile Y index (indexed frmo 0, @see getTileRows(int))FormatException
java.io.IOException
ICompressedTileReader.getTileCodec(int)
public java.lang.Class<?> getNativeDataType()
IFormatHandler
IFormatReader.openPlane(int, int, int, int, int)
or IFormatWriter.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 as
BufferedImage
.getNativeDataType
in interface IFormatHandler
getNativeDataType
in class ReaderWrapper
Copyright © 2024 Open Microscopy Environment