|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.ReaderWrapper
public abstract class ReaderWrapper
Abstract superclass of reader logic that wraps other readers. All methods are simply delegated to the wrapped reader.
Field Summary | |
---|---|
protected IFormatReader |
reader
FormatReader used to read the file. |
Fields inherited from interface loci.formats.IFormatReader |
---|
CAN_GROUP, CANNOT_GROUP, MUST_GROUP |
Constructor Summary | |
---|---|
ReaderWrapper()
Constructs a reader wrapper around a new image reader. |
|
ReaderWrapper(IFormatReader r)
Constructs a reader wrapper around the given reader. |
Method Summary | |
---|---|
void |
addStatusListener(StatusListener l)
Adds a listener for status update events. |
void |
close()
Closes currently open file(s) and frees allocated memory. |
void |
close(boolean fileOnly)
Closes the currently open file. |
int |
fileGroupOption(String id)
Returns an int indicating that we cannot, must, or might group the files in a given dataset. |
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. |
int[] |
getChannelDimLengths()
Gets the lengths of each subdimension of C, in fastest-to-sloweset rasterization order. |
int[] |
getChannelDimLengths(String id)
Deprecated. Replaced by IFormatReader#getChannelDimLengths() |
String[] |
getChannelDimTypes()
Gets the name of each subdimension of C, in fastest-to-slowest rasterization order. |
String[] |
getChannelDimTypes(String id)
Deprecated. Replaced by IFormatReader#getChannelDimTypes() |
CoreMetadata |
getCoreMetadata()
Obtains the core metadata values for the current file. |
CoreMetadata |
getCoreMetadata(String id)
Deprecated. Replaced by IFormatReader#getCoreMetadata() |
String |
getCurrentFile()
Returns the current file. |
String |
getDimensionOrder()
Gets a five-character string representing the dimension order within the file. |
String |
getDimensionOrder(String id)
Deprecated. Replaced by IFormatReader#getDimensionOrder() |
int |
getEffectiveSizeC()
Gets the effective size of the C dimension, guaranteeing that getEffectiveSizeC() * getSizeZ() * getSizeT() == getImageCount() regardless of the result of isRGB(). |
int |
getEffectiveSizeC(String id)
Deprecated. Replaced by IFormatReader#getEffectiveSizeC() |
String |
getFormat()
Gets the name of this file format. |
int |
getImageCount()
Determines the number of images in the current file. |
int |
getImageCount(String id)
Deprecated. Replaced by IFormatReader#getImageCount() |
int |
getIndex(int z,
int c,
int t)
Gets the rasterized index corresponding to the given Z, C and T coordinates. |
int |
getIndex(String id,
int z,
int c,
int t)
Deprecated. Replaced by IFormatReader#getIndex(int, int, int) |
Hashtable |
getMetadata()
Obtains the hashtable containing the metadata field/value pairs from the current file. |
Hashtable |
getMetadata(String id)
Deprecated. Replaced by IFormatReader#getMetadata() |
MetadataStore |
getMetadataStore()
Retrieves the current metadata store for this reader. |
MetadataStore |
getMetadataStore(String id)
Deprecated. Replaced by IFormatReader#getMetadataStore() |
Object |
getMetadataStoreRoot()
Retrieves the current metadata store's root object. |
Object |
getMetadataStoreRoot(String id)
Deprecated. Replaced by IFormatReader#getMetadataStoreRoot() |
Object |
getMetadataValue(String field)
Obtains the specified metadata field's value for the current file. |
Object |
getMetadataValue(String id,
String field)
Deprecated. Replaced by IFormatReader#getMetadataValue(String) |
int |
getPixelType()
Gets the pixel type. |
int |
getPixelType(String id)
Deprecated. Replaced by IFormatReader#getPixelType() |
IFormatReader |
getReader()
Gets the wrapped reader. |
int |
getRGBChannelCount()
Gets the number of channels per RGB image (if not RGB, this returns 1). |
int |
getRGBChannelCount(String id)
Deprecated. Replaced by IFormatReader#getRGBChannelCount() |
int |
getSeries()
Gets the currently active series. |
int |
getSeries(String id)
Deprecated. Replaced by IFormatReader#getSeries() |
int |
getSeriesCount()
Gets the number of series in this file. |
int |
getSeriesCount(String id)
Deprecated. Replaced by IFormatReader#getSeriesCount() |
int |
getSizeC()
Gets the size of the C dimension. |
int |
getSizeC(String id)
Deprecated. Replaced by IFormatReader#getSizeC() |
int |
getSizeT()
Gets the size of the T dimension. |
int |
getSizeT(String id)
Deprecated. Replaced by IFormatReader#getSizeT() |
int |
getSizeX()
Gets the size of the X dimension. |
int |
getSizeX(String id)
Deprecated. Replaced by IFormatReader#getSizeX() |
int |
getSizeY()
Gets the size of the Y dimension. |
int |
getSizeY(String id)
Deprecated. Replaced by IFormatReader#getSizeY() |
int |
getSizeZ()
Gets the size of the Z dimension. |
int |
getSizeZ(String id)
Deprecated. Replaced by IFormatReader#getSizeZ() |
StatusListener[] |
getStatusListeners()
Gets a list of all registered status update listeners. |
String[] |
getSuffixes()
Gets the default file suffixes for this file format. |
int |
getThumbSizeX()
Get the size of the X dimension for the thumbnail. |
int |
getThumbSizeX(String id)
Deprecated. Replaced by IFormatReader#getThumbSizeX() |
int |
getThumbSizeY()
Get the size of the Y dimension for the thumbnail. |
int |
getThumbSizeY(String id)
Deprecated. Replaced by IFormatReader#getThumbSizeY() |
String[] |
getUsedFiles()
Returns an array of filenames needed to open this dataset. |
String[] |
getUsedFiles(String id)
Deprecated. Replaced by IFormatReader#getUsedFiles() |
int[] |
getZCTCoords(int index)
Gets the Z, C and T coordinates corresponding to the given rasterized index value. |
int[] |
getZCTCoords(String id,
int index)
Deprecated. Replaced by IFormatReader#getZCTCoords(int) |
boolean |
isFalseColor()
Returns false if isIndexed is false, or if isIndexed is true and the lookup table represents "real" color data. |
boolean |
isGroupFiles()
Returns true if we should group files in multi-file formats. |
boolean |
isIndexed()
Gets whether the images are indexed color. |
boolean |
isInterleaved()
Gets whether or not the channels are interleaved. |
boolean |
isInterleaved(int subC)
Gets whether or not the given sub-channel is interleaved. |
boolean |
isInterleaved(String id)
Deprecated. Replaced by IFormatReader#isInterleaved() |
boolean |
isInterleaved(String id,
int subC)
Deprecated. Replaced by IFormatReader#isInterleaved(int) |
boolean |
isLittleEndian()
Gets whether the data is in little-endian format. |
boolean |
isLittleEndian(String id)
Deprecated. Replaced by IFormatReader#isLittleEndian() |
boolean |
isMetadataCollected()
Returns true if we should collect metadata. |
boolean |
isMetadataComplete()
Returns true if this format's metadata is completely parsed. |
boolean |
isMetadataFiltered()
Returns true if ugly metadata (entries with unprintable characters, and extremely large entries) are discarded from the metadata table. |
boolean |
isNormalized()
Returns true if we should normalize float data. |
boolean |
isOrderCertain()
Gets whether the dimension order and sizes are known, or merely guesses. |
boolean |
isOrderCertain(String id)
Deprecated. Replaced by IFormatReader#isOrderCertain() |
boolean |
isOriginalMetadataPopulated()
Returns true if we should save proprietary metadata in the MetadataStore. |
boolean |
isRGB()
Checks if the images in the file are RGB. |
boolean |
isRGB(String id)
Deprecated. Replaced by IFormatReader#isRGB() |
boolean |
isThisType(byte[] block)
Checks if the given block is a valid header for this file format. |
boolean |
isThisType(String name)
Checks if the given string is a valid filename for this file format. |
boolean |
isThisType(String name,
boolean open)
Checks if the given string is a valid filename for this file format. |
byte[] |
openBytes(int no)
Obtains the specified image from the current file as a byte array. |
byte[] |
openBytes(int no,
byte[] buf)
Obtains the specified image from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel). |
byte[] |
openBytes(String id,
int no)
Deprecated. Replaced by IFormatReader#openBytes(int) |
byte[] |
openBytes(String id,
int no,
byte[] buf)
Deprecated. Replaced by IFormatReader#openBytes(int, byte[]) |
BufferedImage |
openImage(int no)
Obtains the specified image from the current file. |
BufferedImage |
openImage(String id,
int no)
Deprecated. Replaced by IFormatReader#openImage(int) |
byte[] |
openThumbBytes(int no)
Obtains a thumbnail for the specified image from the current file, as a byte array. |
byte[] |
openThumbBytes(String id,
int no)
Deprecated. Replaced by IFormatReader#openThumbBytes(int) |
BufferedImage |
openThumbImage(int no)
Obtains a thumbnail for the specified image from the current file. |
BufferedImage |
openThumbImage(String id,
int no)
Deprecated. Replaced by IFormatReader#openThumbImage(int) |
void |
removeStatusListener(StatusListener l)
Removes a listener for status update events. |
void |
setGroupFiles(boolean group)
Specifies whether or not to force grouping in multi-file formats. |
void |
setId(String id)
Sets the current file name. |
void |
setId(String id,
boolean force)
Sets the current file name. |
void |
setMetadataCollected(boolean collect)
Specifies whether or not to collect metadata. |
void |
setMetadataFiltered(boolean filter)
Specifies whether ugly metadata (entries with unprintable characters, and extremely large entries) should be discarded from the metadata table. |
void |
setMetadataStore(MetadataStore store)
Sets the default metadata store for this reader. |
void |
setNormalized(boolean normalize)
Specifies whether or not to normalize float data. |
void |
setOriginalMetadataPopulated(boolean populate)
Specifies whether or not to save proprietary metadata in the MetadataStore. |
void |
setSeries(int no)
Activates the specified series. |
void |
setSeries(String id,
int no)
Deprecated. Replaced by IFormatReader#setSeries(int) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IFormatReader reader
Constructor Detail |
---|
public ReaderWrapper()
public ReaderWrapper(IFormatReader r)
Method Detail |
---|
public IFormatReader getReader()
public boolean isThisType(byte[] block)
IFormatReader
isThisType
in interface IFormatReader
public void setId(String id) throws FormatException, IOException
IFormatHandler
setId
in interface IFormatHandler
FormatException
IOException
public void setId(String id, boolean force) throws FormatException, IOException
IFormatHandler
setId
in interface IFormatHandler
force
- If set, the handler will be re-initialized no matter what.
FormatException
IOException
public int getImageCount()
IFormatReader
getImageCount
in interface IFormatReader
public boolean isRGB()
IFormatReader
isRGB
in interface IFormatReader
public int getSizeX()
IFormatReader
getSizeX
in interface IFormatReader
public int getSizeY()
IFormatReader
getSizeY
in interface IFormatReader
public int getSizeZ()
IFormatReader
getSizeZ
in interface IFormatReader
public int getSizeC()
IFormatReader
getSizeC
in interface IFormatReader
public int getSizeT()
IFormatReader
getSizeT
in interface IFormatReader
public int getPixelType()
IFormatReader
getPixelType
in interface IFormatReader
FormatTools
static pixel types such as INT8
.public int getEffectiveSizeC()
IFormatReader
getEffectiveSizeC
in interface IFormatReader
public int getRGBChannelCount()
IFormatReader
getRGBChannelCount
in interface IFormatReader
public boolean isIndexed()
IFormatReader
isIndexed
in interface IFormatReader
public boolean isFalseColor()
IFormatReader
isFalseColor
in interface IFormatReader
public byte[][] get8BitLookupTable() throws FormatException, IOException
IFormatReader
INT8
or UINT8
, this method will return null.
get8BitLookupTable
in interface IFormatReader
FormatException
IOException
public short[][] get16BitLookupTable() throws FormatException, IOException
IFormatReader
INT16
or UINT16
, this method will return null.
get16BitLookupTable
in interface IFormatReader
FormatException
IOException
public int[] getChannelDimLengths()
IFormatReader
getChannelDimLengths
in interface IFormatReader
public String[] getChannelDimTypes()
IFormatReader
FormatTools
.
getChannelDimTypes
in interface IFormatReader
public int getThumbSizeX()
IFormatReader
getThumbSizeX
in interface IFormatReader
public int getThumbSizeY()
IFormatReader
getThumbSizeY
in interface IFormatReader
public boolean isLittleEndian()
IFormatReader
isLittleEndian
in interface IFormatReader
public String getDimensionOrder()
IFormatReader
IFormatReader.isInterleaved(String)
method will return true.
getDimensionOrder
in interface IFormatReader
public boolean isOrderCertain()
IFormatReader
isOrderCertain
in interface IFormatReader
public boolean isInterleaved()
IFormatReader
isInterleaved
in interface IFormatReader
public boolean isInterleaved(int subC)
IFormatReader
SDTReader
handles spectral-lifetime data with
the interleaved lifetime bins and non-interleaved spectral channels.
isInterleaved
in interface IFormatReader
public BufferedImage openImage(int no) throws FormatException, IOException
IFormatReader
openImage
in interface IFormatReader
FormatException
IOException
public byte[] openBytes(int no) throws FormatException, IOException
IFormatReader
openBytes
in interface IFormatReader
FormatException
IOException
public byte[] openBytes(int no, byte[] buf) throws FormatException, IOException
IFormatReader
openBytes
in interface 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.public BufferedImage openThumbImage(int no) throws FormatException, IOException
IFormatReader
openThumbImage
in interface IFormatReader
FormatException
IOException
public byte[] openThumbBytes(int no) throws FormatException, IOException
IFormatReader
openThumbBytes
in interface IFormatReader
FormatException
IOException
public void close(boolean fileOnly) throws IOException
IFormatReader
IFormatHandler.close()
.
close
in interface IFormatReader
IOException
public void close() throws IOException
IFormatHandler
close
in interface IFormatHandler
IOException
public int getSeriesCount()
IFormatReader
getSeriesCount
in interface IFormatReader
public void setSeries(int no)
IFormatReader
setSeries
in interface IFormatReader
public int getSeries()
IFormatReader
getSeries
in interface IFormatReader
public void setGroupFiles(boolean group)
IFormatReader
setGroupFiles
in interface IFormatReader
public boolean isGroupFiles()
IFormatReader
isGroupFiles
in interface IFormatReader
public int fileGroupOption(String id) throws FormatException, IOException
IFormatReader
fileGroupOption
in interface IFormatReader
FormatException
IOException
public boolean isMetadataComplete()
IFormatReader
isMetadataComplete
in interface IFormatReader
public void setNormalized(boolean normalize)
IFormatReader
setNormalized
in interface IFormatReader
public boolean isNormalized()
IFormatReader
isNormalized
in interface IFormatReader
public void setMetadataCollected(boolean collect)
IFormatReader
setMetadataCollected
in interface IFormatReader
public boolean isMetadataCollected()
IFormatReader
isMetadataCollected
in interface IFormatReader
public void setOriginalMetadataPopulated(boolean populate)
IFormatReader
setOriginalMetadataPopulated
in interface IFormatReader
public boolean isOriginalMetadataPopulated()
IFormatReader
isOriginalMetadataPopulated
in interface IFormatReader
public String[] getUsedFiles()
IFormatReader
getUsedFiles
in interface IFormatReader
public String getCurrentFile()
IFormatReader
getCurrentFile
in interface IFormatReader
public int getIndex(int z, int c, int t)
IFormatReader
getIndex
in interface IFormatReader
public int[] getZCTCoords(int index)
IFormatReader
getZCTCoords
in interface IFormatReader
public Object getMetadataValue(String field)
IFormatReader
getMetadataValue
in interface IFormatReader
field
- the name associated with the metadata field
public Hashtable getMetadata()
IFormatReader
getMetadata
in interface IFormatReader
public CoreMetadata getCoreMetadata()
IFormatReader
getCoreMetadata
in interface IFormatReader
public void setMetadataFiltered(boolean filter)
IFormatReader
setMetadataFiltered
in interface IFormatReader
public boolean isMetadataFiltered()
IFormatReader
isMetadataFiltered
in interface IFormatReader
public void setMetadataStore(MetadataStore store)
IFormatReader
setMetadataStore
in interface IFormatReader
store
- a metadata store implementation.public MetadataStore getMetadataStore()
IFormatReader
null
metadata store.
getMetadataStore
in interface IFormatReader
public Object getMetadataStoreRoot()
IFormatReader
getMetadataStoreRoot
in interface IFormatReader
public boolean isThisType(String name)
IFormatHandler
isThisType
in interface IFormatHandler
public boolean isThisType(String name, boolean open)
IFormatHandler
isThisType
in interface IFormatHandler
open
- If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.public String getFormat()
IFormatHandler
getFormat
in interface IFormatHandler
public String[] getSuffixes()
IFormatHandler
getSuffixes
in interface IFormatHandler
public void addStatusListener(StatusListener l)
StatusReporter
addStatusListener
in interface StatusReporter
public void removeStatusListener(StatusListener l)
StatusReporter
removeStatusListener
in interface StatusReporter
public StatusListener[] getStatusListeners()
StatusReporter
getStatusListeners
in interface StatusReporter
public int getImageCount(String id) throws FormatException, IOException
getImageCount
in interface IFormatReader
FormatException
IOException
public boolean isRGB(String id) throws FormatException, IOException
isRGB
in interface IFormatReader
FormatException
IOException
public int getSizeX(String id) throws FormatException, IOException
getSizeX
in interface IFormatReader
FormatException
IOException
public int getSizeY(String id) throws FormatException, IOException
getSizeY
in interface IFormatReader
FormatException
IOException
public int getSizeZ(String id) throws FormatException, IOException
getSizeZ
in interface IFormatReader
FormatException
IOException
public int getSizeC(String id) throws FormatException, IOException
getSizeC
in interface IFormatReader
FormatException
IOException
public int getSizeT(String id) throws FormatException, IOException
getSizeT
in interface IFormatReader
FormatException
IOException
public int getPixelType(String id) throws FormatException, IOException
getPixelType
in interface IFormatReader
FormatException
IOException
public int getEffectiveSizeC(String id) throws FormatException, IOException
getEffectiveSizeC
in interface IFormatReader
FormatException
IOException
public int getRGBChannelCount(String id) throws FormatException, IOException
getRGBChannelCount
in interface IFormatReader
FormatException
IOException
public int[] getChannelDimLengths(String id) throws FormatException, IOException
getChannelDimLengths
in interface IFormatReader
FormatException
IOException
public String[] getChannelDimTypes(String id) throws FormatException, IOException
getChannelDimTypes
in interface IFormatReader
FormatException
IOException
public int getThumbSizeX(String id) throws FormatException, IOException
getThumbSizeX
in interface IFormatReader
FormatException
IOException
public int getThumbSizeY(String id) throws FormatException, IOException
getThumbSizeY
in interface IFormatReader
FormatException
IOException
public boolean isLittleEndian(String id) throws FormatException, IOException
isLittleEndian
in interface IFormatReader
FormatException
IOException
public String getDimensionOrder(String id) throws FormatException, IOException
getDimensionOrder
in interface IFormatReader
FormatException
IOException
public boolean isOrderCertain(String id) throws FormatException, IOException
isOrderCertain
in interface IFormatReader
FormatException
IOException
public boolean isInterleaved(String id) throws FormatException, IOException
isInterleaved
in interface IFormatReader
FormatException
IOException
public boolean isInterleaved(String id, int subC) throws FormatException, IOException
isInterleaved
in interface IFormatReader
FormatException
IOException
public BufferedImage openImage(String id, int no) throws FormatException, IOException
openImage
in interface IFormatReader
FormatException
IOException
public byte[] openBytes(String id, int no) throws FormatException, IOException
openBytes
in interface IFormatReader
FormatException
IOException
public byte[] openBytes(String id, int no, byte[] buf) throws FormatException, IOException
openBytes
in interface IFormatReader
FormatException
IOException
public BufferedImage openThumbImage(String id, int no) throws FormatException, IOException
openThumbImage
in interface IFormatReader
FormatException
IOException
public byte[] openThumbBytes(String id, int no) throws FormatException, IOException
openThumbBytes
in interface IFormatReader
FormatException
IOException
public int getSeriesCount(String id) throws FormatException, IOException
getSeriesCount
in interface IFormatReader
FormatException
IOException
public void setSeries(String id, int no) throws FormatException, IOException
setSeries
in interface IFormatReader
FormatException
IOException
public int getSeries(String id) throws FormatException, IOException
getSeries
in interface IFormatReader
FormatException
IOException
public String[] getUsedFiles(String id) throws FormatException, IOException
getUsedFiles
in interface IFormatReader
FormatException
IOException
public int getIndex(String id, int z, int c, int t) throws FormatException, IOException
getIndex
in interface IFormatReader
FormatException
IOException
public int[] getZCTCoords(String id, int index) throws FormatException, IOException
getZCTCoords
in interface IFormatReader
FormatException
IOException
public Object getMetadataValue(String id, String field) throws FormatException, IOException
getMetadataValue
in interface IFormatReader
FormatException
IOException
public Hashtable getMetadata(String id) throws FormatException, IOException
getMetadata
in interface IFormatReader
FormatException
IOException
public CoreMetadata getCoreMetadata(String id) throws FormatException, IOException
getCoreMetadata
in interface IFormatReader
FormatException
IOException
public MetadataStore getMetadataStore(String id) throws FormatException, IOException
getMetadataStore
in interface IFormatReader
FormatException
IOException
public Object getMetadataStoreRoot(String id) throws FormatException, IOException
getMetadataStoreRoot
in interface IFormatReader
FormatException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |