loci.formats
Class GatanReader

java.lang.Object
  extended byloci.formats.FormatHandler
      extended byloci.formats.FormatReader
          extended byloci.formats.GatanReader

public class GatanReader
extends FormatReader

GatanReader is the file format reader for Gatan files.


Field Summary
protected  int[] dims
          Dimensions -- width, height, bytes per pixel
protected  RandomAccessFile in
          Current file.
protected  boolean littleEndian
          Flag indicating whether current file is little endian.
protected  byte[] pixelData
          Array of pixel bytes.
protected  int pixelDataNum
           
 
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
GatanReader()
          Constructs a new Gatan reader.
 
Method Summary
 void close()
          Closes any open files.
 int getImageCount(String id)
          Determines the number of images in the given Gatan file.
protected  void initFile(String id)
          Initializes the given Gatan file.
 boolean isThisType(byte[] block)
          Checks if the given block is a valid header for a Gatan file.
static void main(String[] args)
           
 BufferedImage open(String id, int no)
          Obtains the specified image from the given Gatan file.
 void parseTags(int numTags, String parent)
          Parses Gatan DM3 tags.
 
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
Current file.


littleEndian

protected boolean littleEndian
Flag indicating whether current file is little endian.


pixelData

protected byte[] pixelData
Array of pixel bytes.


dims

protected int[] dims
Dimensions -- width, height, bytes per pixel


pixelDataNum

protected int pixelDataNum
Constructor Detail

GatanReader

public GatanReader()
Constructs a new Gatan reader.

Method Detail

isThisType

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

Specified by:
isThisType in class FormatReader

getImageCount

public int getImageCount(String id)
                  throws FormatException,
                         IOException
Determines the number of images in the given Gatan 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 Gatan 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 Gatan file.

Overrides:
initFile in class FormatReader
Throws:
FormatException
IOException

parseTags

public void parseTags(int numTags,
                      String parent)
               throws IOException
Parses Gatan DM3 tags. Information on the DM3 structure found at: http://rsb.info.nih.gov/ij/plugins/DM3Format.gj.html and http://www-hrem.msm.cam.ac.uk/~cbb/info/dmformat/

Throws:
IOException

main

public static void main(String[] args)
                 throws FormatException,
                        IOException
Throws:
FormatException
IOException