loci.formats
Class DimensionSwapper

java.lang.Object
  extended by loci.formats.ReaderWrapper
      extended by loci.formats.DimensionSwapper
All Implemented Interfaces:
IFormatHandler, IFormatReader, StatusReporter

public class DimensionSwapper
extends ReaderWrapper

Handles swapping the dimension order of a file.

Source code:
Trac, SVN


Field Summary
 
Fields inherited from class loci.formats.ReaderWrapper
reader
 
Fields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
 
Constructor Summary
DimensionSwapper()
          Constructs a DimensionSwapper around a new image reader.
DimensionSwapper(IFormatReader r)
          Constructs a DimensionSwapper with the given reader.
 
Method Summary
 String getDimensionOrder()
          Gets a five-character string representing the dimension order within the file.
 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.
 void swapDimensions(String order)
          Swaps the dimensions according to the given dimension order.
 
Methods inherited from class loci.formats.ReaderWrapper
addStatusListener, close, close, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getChannelDimLengths, getChannelDimLengths, getChannelDimTypes, getChannelDimTypes, getCoreMetadata, getCoreMetadata, getCurrentFile, getDimensionOrder, getEffectiveSizeC, getEffectiveSizeC, getFormat, getImageCount, getImageCount, getIndex, getIndex, getMetadata, getMetadata, getMetadataStore, getMetadataStore, getMetadataStoreRoot, getMetadataStoreRoot, getMetadataValue, getMetadataValue, getPixelType, getPixelType, getReader, getRGBChannelCount, getRGBChannelCount, getSeries, getSeries, getSeriesCount, getSeriesCount, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getStatusListeners, getSuffixes, getThumbSizeX, getThumbSizeX, getThumbSizeY, getThumbSizeY, getUsedFiles, getUsedFiles, getZCTCoords, getZCTCoords, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isInterleaved, isInterleaved, isLittleEndian, isLittleEndian, isMetadataCollected, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOrderCertain, isOriginalMetadataPopulated, isRGB, isRGB, isThisType, isThisType, isThisType, openBytes, openBytes, openBytes, openBytes, openImage, openImage, openThumbBytes, openThumbBytes, openThumbImage, openThumbImage, removeStatusListener, setGroupFiles, setId, setId, setMetadataCollected, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setSeries, setSeries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DimensionSwapper

public DimensionSwapper()
Constructs a DimensionSwapper around a new image reader.


DimensionSwapper

public DimensionSwapper(IFormatReader r)
Constructs a DimensionSwapper with the given reader.

Method Detail

getSizeX

public int getSizeX()
Description copied from interface: IFormatReader
Gets the size of the X dimension.

Specified by:
getSizeX in interface IFormatReader
Overrides:
getSizeX in class ReaderWrapper

getSizeY

public int getSizeY()
Description copied from interface: IFormatReader
Gets the size of the Y dimension.

Specified by:
getSizeY in interface IFormatReader
Overrides:
getSizeY in class ReaderWrapper

getSizeZ

public int getSizeZ()
Description copied from interface: IFormatReader
Gets the size of the Z dimension.

Specified by:
getSizeZ in interface IFormatReader
Overrides:
getSizeZ in class ReaderWrapper

getSizeC

public int getSizeC()
Description copied from interface: IFormatReader
Gets the size of the C dimension.

Specified by:
getSizeC in interface IFormatReader
Overrides:
getSizeC in class ReaderWrapper

getSizeT

public int getSizeT()
Description copied from interface: IFormatReader
Gets the size of the T dimension.

Specified by:
getSizeT in interface IFormatReader
Overrides:
getSizeT in class ReaderWrapper

getDimensionOrder

public String getDimensionOrder()
Description copied from interface: IFormatReader
Gets a five-character string representing the dimension order within the file. Valid orders are: In cases where the channels are interleaved (e.g., CXYTZ), C will be the first dimension after X and Y (e.g., XYCTZ) and the IFormatReader.isInterleaved(String) method will return true.

Specified by:
getDimensionOrder in interface IFormatReader
Overrides:
getDimensionOrder in class ReaderWrapper

swapDimensions

public void swapDimensions(String order)
Swaps the dimensions according to the given dimension order. 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).