public class ChannelSeparator extends ReaderWrapper
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
lastImage
Last image opened.
|
private int |
lastImageHeight
Height of last image opened.
|
private int |
lastImageIndex
Index of last image opened.
|
private int |
lastImageSeries
Series of last image opened.
|
private int |
lastImageWidth
Width of last image opened.
|
private int |
lastImageX
X index of last image opened.
|
private int |
lastImageY
Y index of last image opened.
|
readerCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description |
|---|
ChannelSeparator()
Constructs a ChannelSeparator around a new image reader.
|
ChannelSeparator(IFormatReader r)
Constructs a ChannelSeparator with the given reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
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.
|
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 |
isRGB()
Checks if the image planes in the file have more than one channel per
IFormatReader.openBytes(int) call. |
static ChannelSeparator |
makeChannelSeparator(IFormatReader r)
Converts the given reader into a ChannelSeparator, 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[] |
openThumbBytes(int no)
Obtains a thumbnail for the specified image plane from the current file,
as a byte array.
|
void |
setId(java.lang.String id)
Sets the current file name.
|
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, getUnderlyingReaders, getUsedFiles, getUsedFiles, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrapprivate byte[] lastImage
private int lastImageIndex
private int lastImageSeries
private int lastImageX
private int lastImageY
private int lastImageWidth
private int lastImageHeight
public ChannelSeparator()
public ChannelSeparator(IFormatReader r)
public static ChannelSeparator makeChannelSeparator(IFormatReader r)
public int getOriginalIndex(int no)
no - is an image number greater than or equal to 0 and less than
getImageCount()public int getImageCount()
IFormatReadergetImageCount in interface IFormatReadergetImageCount in class ReaderWrapperpublic java.lang.String getDimensionOrder()
IFormatReaderIFormatReader.isInterleaved() method will return true.getDimensionOrder in interface IFormatReadergetDimensionOrder 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 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[] openThumbBytes(int no)
throws FormatException,
java.io.IOException
IFormatReaderopenThumbBytes in interface IFormatReaderopenThumbBytes in class ReaderWrapperFormatExceptionjava.io.IOExceptionpublic void close(boolean fileOnly)
throws java.io.IOException
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class ReaderWrapperjava.io.IOExceptionpublic int getIndex(int z,
int c,
int t)
IFormatReadergetIndex in interface IFormatReadergetIndex in class ReaderWrapperpublic int getIndex(int z,
int c,
int t,
int moduloZ,
int moduloC,
int moduloT)
IFormatReadergetIndex in interface IFormatReadergetIndex in class ReaderWrapperpublic int[] getZCTCoords(int index)
IFormatReadergetZCTCoords in interface IFormatReadergetZCTCoords in class ReaderWrapperpublic int[] getZCTModuloCoords(int index)
IFormatReadergetZCTModuloCoords in interface IFormatReadergetZCTModuloCoords in class ReaderWrapperpublic 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.IOExceptionCopyright © 2023 Open Microscopy Environment