Package loci.formats
Class DimensionSwapper
java.lang.Object
loci.formats.ReaderWrapper
loci.formats.DimensionSwapper
- All Implemented Interfaces:
Closeable,AutoCloseable,loci.formats.ICompressedTileReader,loci.formats.IFormatHandler,loci.formats.IFormatReader,loci.formats.IMetadataConfigurable,loci.formats.IPyramidHandler
Handles swapping the dimension order of an image series. This class is
useful for both reassigning ZCT sizes (the input dimension order), and
shuffling around the resultant planar order (the output dimension order).
-
Field Summary
Fields inherited from class loci.formats.ReaderWrapper
readerFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a DimensionSwapper around a new image reader.Constructs a DimensionSwapper with the given reader. -
Method Summary
Modifier and TypeMethodDescriptionintgetIndex(int z, int c, int t) intgetIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT) intgetSizeC()intgetSizeT()intgetSizeX()intgetSizeY()intgetSizeZ()getTileCodec(int no) getTileCodecOptions(int no, int x, int y) int[]getZCTCoords(int no) int[]getZCTModuloCoords(int index) static DimensionSwapperConverts the given reader into a DimensionSwapper, wrapping if needed.byte[]openBytes(int no) byte[]openBytes(int no, byte[] buf) byte[]openBytes(int no, byte[] buf, int x, int y, int w, int h) byte[]openBytes(int no, int x, int y, int w, int h) byte[]openCompressedBytes(int no, byte[] buf, int x, int y) byte[]openCompressedBytes(int no, int x, int y) byte[]openThumbBytes(int no) protected intreorder(int no) voidvoidsetOutputOrder(String outputOrder) Sets the output dimension order according to the given string (e.g., "XYZCT").voidswapDimensions(String order) Sets the input dimension order according to the given string (e.g., "XYZCT").Methods inherited from class loci.formats.ReaderWrapper
close, close, coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getCoreIndex, getCurrentFile, getDatasetStructureDescription, getDomains, getEffectiveSizeC, getFillColor, 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, getTileColumns, getTileRows, 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, setFillColor, setFlattenedResolutions, setGroupFiles, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrap
-
Constructor Details
-
DimensionSwapper
public DimensionSwapper()Constructs a DimensionSwapper around a new image reader. -
DimensionSwapper
Constructs a DimensionSwapper with the given reader.
-
-
Method Details
-
makeDimensionSwapper
Converts the given reader into a DimensionSwapper, wrapping if needed. -
swapDimensions
Sets the input dimension order according to the given string (e.g., "XYZCT"). This string indicates the planar rasterization order from the source, overriding the detected order. It may result in the dimensional axis sizes changing. If the given order is identical to the file's native order, then nothing happens. Note that this method will throw an exception if X and Y do not appear in positions 0 and 1 (although X and Y can be reversed). -
setOutputOrder
Sets the output dimension order according to the given string (e.g., "XYZCT"). This string indicates the final planar rasterization order—i.e., the mapping from 1D plane number to 3D (Z, C, T) tuple. Changing it will not affect the Z, C or T sizes but will alter the order in which planes are returned when iterating. This method is useful when your application requires a particular output dimension order; e.g., ImageJ virtual stacks must be in XYCZT order. -
getInputOrder
-
getSizeX
public int getSizeX()- Specified by:
getSizeXin interfaceloci.formats.IFormatReader- Overrides:
getSizeXin classloci.formats.ReaderWrapper
-
getSizeY
public int getSizeY()- Specified by:
getSizeYin interfaceloci.formats.IFormatReader- Overrides:
getSizeYin classloci.formats.ReaderWrapper
-
getSizeZ
public int getSizeZ()- Specified by:
getSizeZin interfaceloci.formats.IFormatReader- Overrides:
getSizeZin classloci.formats.ReaderWrapper
-
getSizeC
public int getSizeC()- Specified by:
getSizeCin interfaceloci.formats.IFormatReader- Overrides:
getSizeCin classloci.formats.ReaderWrapper
-
getSizeT
public int getSizeT()- Specified by:
getSizeTin interfaceloci.formats.IFormatReader- Overrides:
getSizeTin classloci.formats.ReaderWrapper
-
getDimensionOrder
- Specified by:
getDimensionOrderin interfaceloci.formats.IFormatReader- Overrides:
getDimensionOrderin classloci.formats.ReaderWrapper
-
openBytes
- Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openBytes
public byte[] openBytes(int no, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openBytes
- Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openBytes
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openThumbBytes
- Specified by:
openThumbBytesin interfaceloci.formats.IFormatReader- Overrides:
openThumbBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getZCTCoords
public int[] getZCTCoords(int no) - Specified by:
getZCTCoordsin interfaceloci.formats.IFormatReader- Overrides:
getZCTCoordsin classloci.formats.ReaderWrapper
-
getZCTModuloCoords
public int[] getZCTModuloCoords(int index) - Specified by:
getZCTModuloCoordsin interfaceloci.formats.IFormatReader- Overrides:
getZCTModuloCoordsin classloci.formats.ReaderWrapper
-
getIndex
public int getIndex(int z, int c, int t) - Specified by:
getIndexin interfaceloci.formats.IFormatReader- Overrides:
getIndexin classloci.formats.ReaderWrapper
-
getIndex
public int getIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT) - Specified by:
getIndexin interfaceloci.formats.IFormatReader- Overrides:
getIndexin classloci.formats.ReaderWrapper
-
getCoreMetadataList
- Specified by:
getCoreMetadataListin interfaceloci.formats.IFormatReader- Overrides:
getCoreMetadataListin classloci.formats.ReaderWrapper
-
setId
- Specified by:
setIdin interfaceloci.formats.IFormatHandler- Overrides:
setIdin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openCompressedBytes
public byte[] openCompressedBytes(int no, int x, int y) throws loci.formats.FormatException, IOException - Specified by:
openCompressedBytesin interfaceloci.formats.ICompressedTileReader- Overrides:
openCompressedBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openCompressedBytes
public byte[] openCompressedBytes(int no, byte[] buf, int x, int y) throws loci.formats.FormatException, IOException - Specified by:
openCompressedBytesin interfaceloci.formats.ICompressedTileReader- Overrides:
openCompressedBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getTileCodec
public loci.formats.codec.Codec getTileCodec(int no) throws loci.formats.FormatException, IOException - Specified by:
getTileCodecin interfaceloci.formats.ICompressedTileReader- Overrides:
getTileCodecin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getTileCodecOptions
public loci.formats.codec.CodecOptions getTileCodecOptions(int no, int x, int y) throws loci.formats.FormatException, IOException - Specified by:
getTileCodecOptionsin interfaceloci.formats.ICompressedTileReader- Overrides:
getTileCodecOptionsin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
reorder
protected int reorder(int no)
-