public class ChannelMerger extends ReaderWrapper
reader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
ChannelMerger()
Constructs a ChannelMerger around a new image reader.
|
ChannelMerger(IFormatReader r)
Constructs a ChannelMerger with the given reader.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canMerge()
Determines whether the channels in the file can be merged.
|
java.lang.String |
getDimensionOrder()
Gets a five-character string representing the
dimension order in which planes will be returned.
|
int |
getImageCount()
Determines the number of image planes in the current file.
|
int |
getIndex(int z,
int c,
int t)
Gets the rasterized index corresponding
to the given Z, C and T coordinates (real sizes).
|
int |
getIndex(int z,
int c,
int t,
int moduloZ,
int moduloC,
int moduloT)
Gets the rasterized index corresponding to the given Z, C, T,
moduloZ, moduloC and moduloT coordinates (effective sizes).
|
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 |
getOriginalIndex(int no)
Returns the image number in the original dataset that corresponds to the
given image number.
|
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[] |
getZCTCoords(int index)
Gets the Z, C and T coordinates (real sizes) corresponding to the
given rasterized index value.
|
int[] |
getZCTModuloCoords(int index)
Gets the Z, C, T, moduloZ, moduloC and moduloT coordinates
(effective sizes) corresponding to the given rasterized index
value.
|
boolean |
isIndexed()
Gets whether the image planes are indexed color.
|
boolean |
isInterleaved()
Gets whether or not the channels are interleaved.
|
boolean |
isRGB()
Checks if the image planes in the file have more than one channel per
IFormatReader.openBytes(int) call. |
static ChannelMerger |
makeChannelMerger(IFormatReader r)
Converts the given reader into a ChannelMerger, 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.
|
close, close, coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getCoreIndex, getCoreMetadataList, getCurrentFile, getDatasetStructureDescription, getDomains, getEffectiveSizeC, getFillColor, getFormat, getGlobalMetadata, getMetadataOptions, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getModuloC, getModuloT, getModuloZ, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getReader, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getSeries, getSeriesCount, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openPlane, openThumbBytes, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrap
public ChannelMerger()
public ChannelMerger(IFormatReader r)
public static ChannelMerger makeChannelMerger(IFormatReader r)
public boolean canMerge()
public int getOriginalIndex(int no) throws FormatException, java.io.IOException
no
- is an image number greater than or equal to 0 and less than
getImageCount()FormatException
java.io.IOException
public int getImageCount()
IFormatReader
getImageCount
in interface IFormatReader
getImageCount
in class ReaderWrapper
public java.lang.String getDimensionOrder()
IFormatReader
IFormatReader.isInterleaved()
method will return true.getDimensionOrder
in interface IFormatReader
getDimensionOrder
in class ReaderWrapper
public boolean isInterleaved()
IFormatReader
IFormatReader.getDimensionOrder()
returns XYCTZ or XYCZT,
and this method returns true.
Note that this flag returns whether or not the data returned by
IFormatReader.openBytes(int)
is interleaved. In most cases, this will
match the interleaving in the original file, but for some formats (e.g.
TIFF) channel re-ordering is done internally and the return value of
this method will not match what is in the original file.isInterleaved
in interface IFormatReader
isInterleaved
in class ReaderWrapper
public boolean isRGB()
IFormatReader
IFormatReader.openBytes(int)
call.
This method returns true if and only if IFormatReader.getRGBChannelCount()
returns a value greater than 1.isRGB
in interface IFormatReader
isRGB
in class ReaderWrapper
public boolean isIndexed()
IFormatReader
IFormatReader.getSizeC()
,
IFormatReader.getEffectiveSizeC()
or IFormatReader.getRGBChannelCount()
.isIndexed
in interface IFormatReader
isIndexed
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 int getIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT)
IFormatReader
getIndex
in interface IFormatReader
getIndex
in class ReaderWrapper
public int getIndex(int z, int c, int t)
IFormatReader
getIndex
in interface IFormatReader
getIndex
in class ReaderWrapper
public int[] getZCTCoords(int index)
IFormatReader
getZCTCoords
in interface IFormatReader
getZCTCoords
in class ReaderWrapper
public int[] getZCTModuloCoords(int index)
IFormatReader
getZCTModuloCoords
in interface IFormatReader
getZCTModuloCoords
in class ReaderWrapper
public 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 from 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 from 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 from 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