loci.formats
Class ChannelMerger

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

public class ChannelMerger
extends ReaderWrapper

Logic to automatically merge channels in 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
ChannelMerger()
          Constructs a ChannelMerger around a new image reader.
ChannelMerger(IFormatReader r)
          Constructs a ChannelMerger with the given reader.
 
Method Summary
 boolean canMerge()
          Determines whether the channels in the file can be merged.
 String getDimensionOrder()
          Gets a five-character string representing the dimension order within the file.
 int getImageCount()
          Determines the number of images 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.
 int[] getZCTCoords(int index)
          Gets the Z, C and T coordinates corresponding to the given rasterized index value.
 boolean isRGB()
          Checks if the images in the file are RGB.
 byte[] openBytes(int no)
          Obtains the specified image from the given file as a byte array.
 BufferedImage openImage(int no)
          Obtains the specified image from the current file.
 BufferedImage openThumbImage(int no)
          Obtains a thumbnail for the specified image from the current file.
 
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, getIndex, getMetadata, getMetadata, getMetadataStore, getMetadataStore, getMetadataStoreRoot, getMetadataStoreRoot, getMetadataValue, getMetadataValue, getPixelType, getPixelType, getReader, getRGBChannelCount, getRGBChannelCount, getSeries, getSeries, getSeriesCount, getSeriesCount, getSizeC, getSizeC, getSizeT, getSizeT, getSizeX, getSizeX, getSizeY, getSizeY, getSizeZ, getSizeZ, getStatusListeners, getSuffixes, getThumbSizeX, getThumbSizeX, getThumbSizeY, getThumbSizeY, getUsedFiles, getUsedFiles, getZCTCoords, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isInterleaved, isInterleaved, isLittleEndian, isLittleEndian, isMetadataCollected, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOrderCertain, isOriginalMetadataPopulated, isRGB, isThisType, isThisType, isThisType, openBytes, openBytes, openBytes, openImage, openThumbBytes, openThumbBytes, 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

ChannelMerger

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


ChannelMerger

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

Method Detail

canMerge

public boolean canMerge()
Determines whether the channels in the file can be merged.


getImageCount

public int getImageCount()
Description copied from interface: IFormatReader
Determines the number of images in the current file.

Specified by:
getImageCount in interface IFormatReader
Overrides:
getImageCount 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

isRGB

public boolean isRGB()
Description copied from interface: IFormatReader
Checks if the images in the file are RGB.

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

openImage

public BufferedImage openImage(int no)
                        throws FormatException,
                               IOException
Description copied from interface: IFormatReader
Obtains the specified image from the current file.

Specified by:
openImage in interface IFormatReader
Overrides:
openImage in class ReaderWrapper
Throws:
FormatException
IOException

openBytes

public byte[] openBytes(int no)
                 throws FormatException,
                        IOException
Obtains the specified image from the given file as a byte array. For convenience, the channels are sequential, i.e. "RRR...GGG...BBB".

Specified by:
openBytes in interface IFormatReader
Overrides:
openBytes in class ReaderWrapper
Throws:
FormatException
IOException

openThumbImage

public BufferedImage openThumbImage(int no)
                             throws FormatException,
                                    IOException
Description copied from interface: IFormatReader
Obtains a thumbnail for the specified image from the current file.

Specified by:
openThumbImage in interface IFormatReader
Overrides:
openThumbImage in class ReaderWrapper
Throws:
FormatException
IOException

getIndex

public int getIndex(int z,
                    int c,
                    int t)
Description copied from interface: IFormatReader
Gets the rasterized index corresponding to the given Z, C and T coordinates.

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

getZCTCoords

public int[] getZCTCoords(int index)
Description copied from interface: IFormatReader
Gets the Z, C and T coordinates corresponding to the given rasterized index value.

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