loci.formats
Class BaseTiffReader

java.lang.Object
  extended byloci.formats.FormatHandler
      extended byloci.formats.FormatReader
          extended byloci.formats.BaseTiffReader
Direct Known Subclasses:
AndorReader, FluoviewReader, IPWReader, MetamorphReader, SEQReader, TiffReader, ZeissLSMReader

public abstract class BaseTiffReader
extends FormatReader

BaseTiffReader is the superclass for file format readers compatible with or derived from the TIFF 6.0 file format.


Field Summary
protected  Hashtable[] ifds
          List of IFDs for the current TIFF.
protected  RandomAccessFile in
          Random access file for the current TIFF.
protected  int numImages
          Number of images in the current TIFF stack.
 
Fields inherited from class loci.formats.FormatReader
DEBUG, DEBUG_LEVEL, metadata, ome
 
Fields inherited from class loci.formats.FormatHandler
chooser, currentId, filters, format, suffixes
 
Constructor Summary
BaseTiffReader(String name, String suffix)
          Constructs a new BaseTiffReader.
BaseTiffReader(String name, String[] suffixes)
          Constructs a new BaseTiffReader.
 
Method Summary
 void close()
          Closes any open files.
 int getImageCount(String id)
          Determines the number of images in the given TIFF file.
 int[] getTiffDimensions(String id)
          Gets the dimensions of the given (possibly multi-page) TIFF file.
protected  void initFile(String id)
          Initializes the given TIFF file.
protected  void initMetadata()
          Populates the metadata hashtable and OME root node.
protected  void initOMEMetadata()
          Parses OME-XML metadata.
protected  void initStandardMetadata()
          Parses standard metadata.
 boolean isThisType(byte[] block)
          Checks if the given block is a valid header for a TIFF file.
 BufferedImage open(String id, int no)
          Obtains the specified image from the given TIFF file.
protected  void put(String key, boolean value)
           
protected  void put(String key, byte value)
           
protected  void put(String key, char value)
           
protected  void put(String key, double value)
           
protected  void put(String key, float value)
           
protected  void put(String key, Hashtable ifd, int tag)
           
protected  void put(String key, int value)
           
protected  void put(String key, long value)
           
protected  void put(String key, Object value)
           
protected  void put(String key, short value)
           
protected  void putInt(String key, Hashtable ifd, int tag)
           
 
Methods inherited from class loci.formats.FormatReader
createFilters, getMetadata, getMetadataValue, getOMENode, open, testRead
 
Methods inherited from class loci.formats.FormatHandler
getFileChooser, getFileFilters, getFormat, getSuffixes, isThisType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected RandomAccessFile in
Random access file for the current TIFF.


ifds

protected Hashtable[] ifds
List of IFDs for the current TIFF.


numImages

protected int numImages
Number of images in the current TIFF stack.

Constructor Detail

BaseTiffReader

public BaseTiffReader(String name,
                      String suffix)
Constructs a new BaseTiffReader.


BaseTiffReader

public BaseTiffReader(String name,
                      String[] suffixes)
Constructs a new BaseTiffReader.

Method Detail

getTiffDimensions

public int[] getTiffDimensions(String id)
                        throws FormatException,
                               IOException
Gets the dimensions of the given (possibly multi-page) TIFF file.

Throws:
FormatException
IOException

initMetadata

protected void initMetadata()
Populates the metadata hashtable and OME root node.


initStandardMetadata

protected void initStandardMetadata()
Parses standard metadata.


initOMEMetadata

protected void initOMEMetadata()
Parses OME-XML metadata.


isThisType

public boolean isThisType(byte[] block)
Checks if the given block is a valid header for a TIFF file.

Specified by:
isThisType in class FormatReader

getImageCount

public int getImageCount(String id)
                  throws FormatException,
                         IOException
Determines the number of images in the given TIFF file.

Specified by:
getImageCount in class FormatReader
Throws:
FormatException
IOException

open

public BufferedImage open(String id,
                          int no)
                   throws FormatException,
                          IOException
Obtains the specified image from the given TIFF file.

Specified by:
open in class FormatReader
Throws:
FormatException
IOException

close

public void close()
           throws FormatException,
                  IOException
Closes any open files.

Specified by:
close in class FormatReader
Throws:
FormatException
IOException

initFile

protected void initFile(String id)
                 throws FormatException,
                        IOException
Initializes the given TIFF file.

Overrides:
initFile in class FormatReader
Throws:
FormatException
IOException

put

protected void put(String key,
                   Object value)

put

protected void put(String key,
                   int value)

put

protected void put(String key,
                   boolean value)

put

protected void put(String key,
                   byte value)

put

protected void put(String key,
                   char value)

put

protected void put(String key,
                   double value)

put

protected void put(String key,
                   float value)

put

protected void put(String key,
                   long value)

put

protected void put(String key,
                   short value)

put

protected void put(String key,
                   Hashtable ifd,
                   int tag)

putInt

protected void putInt(String key,
                      Hashtable ifd,
                      int tag)