public class ChannelFiller extends ReaderWrapper
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Boolean |
filled
Whether to fill in the indices.
|
protected int |
lutLength
Number of LUT components.
|
readerCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description |
|---|
ChannelFiller()
Constructs a ChannelFiller around a new image reader.
|
ChannelFiller(IFormatReader r)
Constructs a ChannelFiller with a given reader.
|
| Modifier and Type | Method and Description |
|---|---|
short[][] |
get16BitLookupTable()
Gets the 16-bit color lookup table associated with
the most recently opened image.
|
byte[][] |
get8BitLookupTable()
Gets the 8-bit color lookup table associated with
the most recently opened image.
|
int |
getBitsPerPixel()
Gets the number of valid bits per pixel.
|
private int |
getLookupTableComponentCount()
Gets the number of color components in the lookup table.
|
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 |
getSizeC()
Gets the size of the C 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.
|
boolean |
isFilled()
Returns true if the indices are being factored out.
|
boolean |
isIndexed()
Gets whether the image planes are indexed color.
|
boolean |
isRGB()
Checks if the image planes in the file have more than one channel per
IFormatReader.openBytes(int) call. |
static ChannelFiller |
makeChannelFiller(IFormatReader r)
Converts the given reader into a ChannelFiller, 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 |
setFilled(boolean filled)
Toggles whether the indices should be factored out.
|
void |
setId(java.lang.String id)
Sets the current file name.
|
close, close, coreIndexToSeries, duplicate, fileGroupOption, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, 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, getSeriesCount, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeT, getSizeX, getSizeY, getSizeZ, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openPlane, openThumbBytes, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrapprotected java.lang.Boolean filled
protected int lutLength
public ChannelFiller()
public ChannelFiller(IFormatReader r)
public static ChannelFiller makeChannelFiller(IFormatReader r)
public boolean isFilled()
public void setFilled(boolean filled)
public int getSizeC()
IFormatReadergetSizeC in interface IFormatReadergetSizeC in class ReaderWrapperpublic boolean isRGB()
IFormatReaderIFormatReader.openBytes(int) call.
This method returns true if and only if IFormatReader.getRGBChannelCount()
returns a value greater than 1.isRGB in interface IFormatReaderisRGB in class ReaderWrapperpublic boolean isIndexed()
IFormatReaderIFormatReader.getSizeC(),
IFormatReader.getEffectiveSizeC() or IFormatReader.getRGBChannelCount().isIndexed in interface IFormatReaderisIndexed in class ReaderWrapperpublic int getBitsPerPixel()
IFormatReaderIFormatReader.getPixelType().getBitsPerPixel in interface IFormatReadergetBitsPerPixel in class ReaderWrapperpublic byte[][] get8BitLookupTable()
throws FormatException,
java.io.IOException
IFormatReaderIFormatReader.isIndexed() returns
false, then this may return null. Also, if IFormatReader.getPixelType() returns
anything other than FormatTools.INT8 or FormatTools.UINT8,
this method will return null.get8BitLookupTable in interface IFormatReaderget8BitLookupTable in class ReaderWrapperFormatExceptionjava.io.IOExceptionpublic short[][] get16BitLookupTable()
throws FormatException,
java.io.IOException
IFormatReaderIFormatReader.isIndexed() returns
false, then this may return null. Also, if IFormatReader.getPixelType() returns
anything other than FormatTools.INT16 or FormatTools.UINT16, this method will return null.get16BitLookupTable in interface IFormatReaderget16BitLookupTable in class ReaderWrapperFormatExceptionjava.io.IOExceptionpublic byte[] openBytes(int no)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperFormatExceptionjava.io.IOExceptionIFormatReader.openBytes(int, byte[])public byte[] openBytes(int no,
byte[] buf)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperno - 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
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperFormatExceptionjava.io.IOExceptionpublic byte[] openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperno - 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 byte[] openCompressedBytes(int no,
int x,
int y)
throws FormatException,
java.io.IOException
ICompressedTileReaderopenCompressedBytes in interface ICompressedTileReaderopenCompressedBytes in class ReaderWrapperno - plane indexx - tile X index (indexed from 0, @see getTileColumns(int))y - tile Y index (indexed from 0, @see getTileRows(int))FormatExceptionjava.io.IOExceptionpublic byte[] openCompressedBytes(int no,
byte[] buf,
int x,
int y)
throws FormatException,
java.io.IOException
ICompressedTileReaderopenCompressedBytes in interface ICompressedTileReaderopenCompressedBytes in class ReaderWrapperno - 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))FormatExceptionjava.io.IOExceptionpublic Codec getTileCodec(int no) throws FormatException, java.io.IOException
ICompressedTileReadergetTileCodec in interface ICompressedTileReadergetTileCodec in class ReaderWrapperno - plane indexFormatExceptionjava.io.IOExceptionICompressedTileReader.openCompressedBytes(int, int, int)public CodecOptions getTileCodecOptions(int no, int x, int y) throws FormatException, java.io.IOException
ICompressedTileReadergetTileCodecOptions in interface ICompressedTileReadergetTileCodecOptions in class ReaderWrapperno - plane indexx - tile X index (indexed from 0, @see getTileColumns(int))y - tile Y index (indexed from 0, @see getTileRows(int))FormatExceptionjava.io.IOExceptionICompressedTileReader.getTileCodec(int)public java.lang.Class<?> getNativeDataType()
IFormatHandlerIFormatReader.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 IFormatHandlergetNativeDataType in class ReaderWrapperpublic void setId(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatHandlersetId in interface IFormatHandlersetId in class ReaderWrapperFormatExceptionjava.io.IOExceptionprivate int getLookupTableComponentCount()
throws FormatException,
java.io.IOException
FormatExceptionjava.io.IOExceptionCopyright © 2024 Open Microscopy Environment