public class DimensionSwapper extends ReaderWrapper
Modifier and Type | Field and Description |
---|---|
private java.util.List<CoreMetadata> |
core
Core metadata associated with this dimension swapper.
|
reader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
DimensionSwapper()
Constructs a DimensionSwapper around a new image reader.
|
DimensionSwapper(IFormatReader r)
Constructs a DimensionSwapper with the given reader.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<CoreMetadata> |
getCoreMetadataList()
Obtains the core metadata values for the current file.
|
java.lang.String |
getDimensionOrder()
Gets a five-character string representing the
dimension order in which planes will be returned.
|
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.String |
getInputOrder() |
int |
getSizeC()
Gets the size of the C dimension.
|
int |
getSizeT()
Gets the size of the T dimension.
|
int |
getSizeX()
Gets the size of the X dimension.
|
int |
getSizeY()
Gets the size of the Y dimension.
|
int |
getSizeZ()
Gets the size of the Z dimension.
|
int[] |
getZCTCoords(int no)
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.
|
static DimensionSwapper |
makeDimensionSwapper(IFormatReader r)
Converts the given reader into a DimensionSwapper, 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.
|
protected int |
reorder(int no) |
void |
setId(java.lang.String id)
Sets the current file name.
|
void |
setOutputOrder(java.lang.String outputOrder)
Sets the output dimension order according to the given string (e.g.,
"XYZCT").
|
void |
swapDimensions(java.lang.String order)
Sets the input dimension order according to the given string (e.g.,
"XYZCT").
|
close, close, coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getCoreIndex, getCurrentFile, getDatasetStructureDescription, getDomains, getEffectiveSizeC, getFormat, getGlobalMetadata, getImageCount, getMetadataOptions, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getModuloC, getModuloT, getModuloZ, getNativeDataType, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getReader, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getSeries, getSeriesCount, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFlattenedResolutions, setGroupFiles, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrap
private java.util.List<CoreMetadata> core
public DimensionSwapper()
public DimensionSwapper(IFormatReader r)
public static DimensionSwapper makeDimensionSwapper(IFormatReader r)
public void swapDimensions(java.lang.String order)
public void setOutputOrder(java.lang.String outputOrder)
public java.lang.String getInputOrder()
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 getSizeZ()
IFormatReader
getSizeZ
in interface IFormatReader
getSizeZ
in class ReaderWrapper
public int getSizeC()
IFormatReader
getSizeC
in interface IFormatReader
getSizeC
in class ReaderWrapper
public int getSizeT()
IFormatReader
getSizeT
in interface IFormatReader
getSizeT
in class ReaderWrapper
public java.lang.String getDimensionOrder()
IFormatReader
IFormatReader.isInterleaved()
method will return true.getDimensionOrder
in interface IFormatReader
getDimensionOrder
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, 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) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
no
- the image index within the file.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, 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 image index within the file.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
IFormatReader
openThumbBytes
in interface IFormatReader
openThumbBytes
in class ReaderWrapper
FormatException
java.io.IOException
public int[] getZCTCoords(int no)
IFormatReader
getZCTCoords
in interface IFormatReader
getZCTCoords
in class ReaderWrapper
public int[] getZCTModuloCoords(int index)
IFormatReader
getZCTModuloCoords
in interface IFormatReader
getZCTModuloCoords
in class ReaderWrapper
public int getIndex(int z, int c, int t)
IFormatReader
getIndex
in interface IFormatReader
getIndex
in class ReaderWrapper
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 java.util.List<CoreMetadata> getCoreMetadataList()
IFormatReader
getCoreMetadataList
in interface IFormatReader
getCoreMetadataList
in class ReaderWrapper
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
protected int reorder(int no)
Copyright © 2017 Open Microscopy Environment