|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.BaseTiffReader
public abstract class BaseTiffReader
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. |
Fields inherited from class loci.formats.FormatReader |
---|
collectMetadata, core, filterMetadata, group, in, metadata, metadataStore, normalizeData, saveOriginalMetadata, series, THUMBNAIL_DIMENSION |
Fields inherited from class loci.formats.FormatHandler |
---|
currentId, debug, debugLevel, format, statusListeners, suffixes |
Fields inherited from interface loci.formats.IFormatReader |
---|
CAN_GROUP, CANNOT_GROUP, MUST_GROUP |
Constructor Summary | |
---|---|
BaseTiffReader(String name,
String suffix)
Constructs a new BaseTiffReader. |
|
BaseTiffReader(String name,
String[] suffixes)
Constructs a new BaseTiffReader. |
Method Summary | |
---|---|
short[][] |
get16BitLookupTable()
Gets the 16-bit color lookup table associated with the most recently opened image. |
byte[][] |
get8BitLookupTable()
Gets the 8-bit color lookup table associated with the most recently opened image. |
protected String |
getImageCreationDate()
Retrieves the image creation date. |
protected String |
getImageDescription()
Retrieves the image description. |
protected String |
getImageName()
Retrieves the image name from the TIFF. |
Object |
getMetadataValue(String field)
Obtains the specified metadata field's value for the current file. |
int[] |
getTiffDimensions()
Gets the dimensions of the given (possibly multi-page) TIFF file. |
protected void |
initFile(String id)
Initializes the given file (parsing header information, etc.). |
protected void |
initMetadata()
Populates the metadata hashtable and metadata store. |
protected void |
initMetadataStore()
Populates the metadata store using the data parsed in initStandardMetadata() along with some further parsing done in
the method itself. |
protected void |
initStandardMetadata()
Parses standard metadata. |
boolean |
isThisType(byte[] block)
Checks if the given block is a valid header for this file format. |
byte[] |
openBytes(int no,
byte[] buf)
Obtains the specified image from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel). |
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)
|
protected byte[] |
swapIfRequired(byte[] byteArray)
Examines a byte array to see if it needs to be byte swapped and modifies the byte array directly. |
Methods inherited from class loci.formats.FormatHandler |
---|
addStatusListener, debug, getFormat, getStatusListeners, getSuffixes, isThisType, isThisType, removeStatusListener, setDebug, setDebugLevel, setId, status, status, status, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface loci.formats.IFormatHandler |
---|
getFormat, getSuffixes, isThisType, isThisType, setId |
Methods inherited from interface loci.formats.StatusReporter |
---|
addStatusListener, getStatusListeners, removeStatusListener |
Field Detail |
---|
protected Hashtable[] ifds
Constructor Detail |
---|
public BaseTiffReader(String name, String suffix)
public BaseTiffReader(String name, String[] suffixes)
Method Detail |
---|
public int[] getTiffDimensions() throws FormatException, IOException
FormatException
IOException
public boolean isThisType(byte[] block)
IFormatReader
public byte[][] get8BitLookupTable() throws FormatException, IOException
IFormatReader
INT8
or UINT8
, this method will return null.
get8BitLookupTable
in interface IFormatReader
get8BitLookupTable
in class FormatReader
FormatException
IOException
public short[][] get16BitLookupTable() throws FormatException, IOException
IFormatReader
INT16
or UINT16
, this method will return null.
get16BitLookupTable
in interface IFormatReader
get16BitLookupTable
in class FormatReader
FormatException
IOException
public Object getMetadataValue(String field)
IFormatReader
getMetadataValue
in interface IFormatReader
getMetadataValue
in class FormatReader
field
- the name associated with the metadata field
public byte[] openBytes(int no, byte[] buf) throws FormatException, IOException
IFormatReader
no
- the image index within the file.buf
- a pre-allocated buffer.
buf
for convenience.
FormatException
- if there was a problem parsing the metadata of the
file.
IOException
- if there was a problem reading the file.protected void initMetadata() throws FormatException, IOException
FormatException
IOException
protected void initStandardMetadata() throws FormatException, IOException
FormatException
IOException
protected void initMetadataStore()
initStandardMetadata()
along with some further parsing done in
the method itself.
All calls to the active MetadataStore
should be made in this
method and only in this method. This is especially important for
sub-classes that override the getters for pixel set array size, etc.
protected String getImageName()
protected String getImageCreationDate()
protected String getImageDescription()
protected byte[] swapIfRequired(byte[] byteArray) throws FormatException, IOException
byteArray
- The byte array to check and modify if required.
IOException
- if there is an error read from the file.
FormatException
- if there is an error during metadata parsing.protected void put(String key, Object value)
protected void put(String key, int value)
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, long value)
protected void put(String key, short value)
protected void put(String key, Hashtable ifd, int tag)
protected void putInt(String key, Hashtable ifd, int tag)
protected void initFile(String id) throws FormatException, IOException
FormatReader
initFile
in class FormatReader
FormatException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |