public interface IFormatReader extends IFormatHandler, IMetadataConfigurable
Modifier and Type | Field and Description |
---|---|
static int |
CAN_GROUP |
static int |
CANNOT_GROUP |
static int |
MUST_GROUP
File grouping options.
|
Modifier and Type | Method and Description |
---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
int |
coreIndexToSeries(int index)
Returns the series corresponding to the specified core index.
|
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.
|
FileInfo[] |
getAdvancedSeriesUsedFiles(boolean noPixels)
Returns an array of FileInfo objects representing the files needed to
open the current series.
|
FileInfo[] |
getAdvancedUsedFiles(boolean noPixels)
Returns an array of FileInfo objects representing the files needed
to open this dataset.
|
int |
getBitsPerPixel()
Gets the number of valid bits per pixel.
|
int[] |
getChannelDimLengths()
Deprecated.
|
String[] |
getChannelDimTypes()
Deprecated.
|
int |
getCoreIndex()
Return the index into CoreMetadata of the current resolution/series.
|
CoreMetadata[] |
getCoreMetadata()
Deprecated.
Use #getCoreMetadataList instead.
|
List<CoreMetadata> |
getCoreMetadataList()
Obtains the core metadata values for the current file.
|
String |
getCurrentFile()
Returns the current file.
|
String |
getDatasetStructureDescription()
Returns a short description of the dataset structure.
|
String |
getDimensionOrder()
Gets a five-character string representing the
dimension order in which planes will be returned.
|
String[] |
getDomains()
Returns the list of domains represented by the current file.
|
int |
getEffectiveSizeC()
Gets the effective size of the C dimension, guaranteeing that
getEffectiveSizeC() * getSizeZ() * getSizeT() == getImageCount()
regardless of the result of isRGB().
|
Hashtable<String,Object> |
getGlobalMetadata()
Obtains the hashtable containing the metadata field/value pairs from
the current file.
|
int |
getImageCount()
Determines the number of image planes 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.
|
MetadataStore |
getMetadataStore()
Retrieves the current metadata store for this reader.
|
Object |
getMetadataStoreRoot()
Retrieves the current metadata store's root object.
|
Object |
getMetadataValue(String field)
Obtains the specified metadata field's value for the current file.
|
Modulo |
getModuloC() |
Modulo |
getModuloT() |
Modulo |
getModuloZ() |
int |
getOptimalTileHeight()
Returns the optimal sub-image height for use with openBytes.
|
int |
getOptimalTileWidth()
Returns the optimal sub-image width for use with openBytes.
|
int |
getPixelType()
Gets the pixel type.
|
String[] |
getPossibleDomains(String id)
Returns a list of scientific domains in which this format is used.
|
int |
getRequiredDirectories(String[] files)
Returns the number of parent directories that are important when
processing the given list of files.
|
int |
getResolution()
Get the current resolution level.
|
int |
getResolutionCount()
Return the number of resolutions for the current series.
|
int |
getRGBChannelCount()
Gets the number of channels returned with each call to openBytes.
|
int |
getSeries()
Gets the currently active series.
|
int |
getSeriesCount()
Gets the number of series in this file.
|
Hashtable<String,Object> |
getSeriesMetadata()
Obtains the hashtable containing metadata field/value pairs from the
current series in the current file.
|
Object |
getSeriesMetadataValue(String field)
Obtains the specified metadata field's value for the current series
in the current file.
|
String[] |
getSeriesUsedFiles()
Returns an array of filenames needed to open the current series.
|
String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
int |
getSizeC()
Gets the size of the C dimension.
|
int |
getSizeT()
Gets the size of the T dimension.
|
int |
getSizeX()
Gets the size of the X dimension.
|
int |
getSizeY()
Gets the size of the Y dimension.
|
int |
getSizeZ()
Gets the size of the Z dimension.
|
int |
getThumbSizeX()
Get the size of the X dimension for the thumbnail.
|
int |
getThumbSizeY()
Get the size of the Y dimension for the thumbnail.
|
IFormatReader[] |
getUnderlyingReaders()
Retrieves all underlying readers.
|
String[] |
getUsedFiles()
Returns an array of filenames needed to open this dataset.
|
String[] |
getUsedFiles(boolean noPixels)
Returns an array of filenames needed to open this dataset.
|
int[] |
getZCTCoords(int index)
Gets the Z, C and T coordinates corresponding
to the given rasterized index value.
|
boolean |
hasCompanionFiles()
Returns true if this format supports multi-file datasets.
|
boolean |
hasFlattenedResolutions()
Return whether or not resolution flattening is enabled.
|
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 image planes 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 |
isLittleEndian()
Gets whether the data is in little-endian format.
|
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 |
isOriginalMetadataPopulated()
Returns true if we should save proprietary metadata
in the MetadataStore.
|
boolean |
isRGB()
Checks if the image planes in the file have more than one channel per
openBytes(int) call. |
boolean |
isSingleFile(String id)
Returns true if this is a single-file format.
|
boolean |
isThisType(byte[] block)
Checks if the given block is a valid header for this file format.
|
boolean |
isThisType(RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
boolean |
isThisType(String name,
boolean open)
Checks if the given file is a valid instance of this file format.
|
boolean |
isThumbnailSeries()
Gets whether the current series is a lower resolution copy of a different
series.
|
byte[] |
openBytes(int no)
Obtains the specified image plane from the current file as a byte array.
|
byte[] |
openBytes(int no,
byte[] buf)
Obtains the specified image plane from the current file into a
pre-allocated byte array of
(sizeX * sizeY * bytesPerPixel * RGB channel count).
|
byte[] |
openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Obtains a sub-image of the specified image plane
into a pre-allocated byte array.
|
byte[] |
openBytes(int no,
int x,
int y,
int w,
int h)
Obtains a sub-image of the specified image plane,
whose upper-left corner is given by (x, y).
|
Object |
openPlane(int no,
int x,
int y,
int w,
int h)
Obtains the specified image plane (or sub-image thereof) in the reader's
native data structure.
|
byte[] |
openThumbBytes(int no)
Obtains a thumbnail for the specified image plane from the current file,
as a byte array.
|
int |
seriesToCoreIndex(int series)
Returns the first core index corresponding to the specified series.
|
void |
setCoreIndex(int no)
Set the current resolution/series (ignores subresolutions).
|
void |
setFlattenedResolutions(boolean flatten)
Set whether or not to flatten resolutions into individual series.
|
void |
setGroupFiles(boolean group)
Specifies whether or not to force grouping in multi-file formats.
|
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 |
setResolution(int resolution)
Set the resolution level.
|
void |
setSeries(int no)
Activates the specified series.
|
getFormat, getNativeDataType, getSuffixes, isThisType, setId
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
static final int MUST_GROUP
static final int CAN_GROUP
static final int CANNOT_GROUP
boolean isThisType(String name, boolean open)
open
- If true, and the file extension is insufficient to determine
the file type, the file may be opened for further analysis, or other
relatively expensive file system operations (such as file existence
tests and directory listings) may be performed. If false, file system
access is not allowed.boolean isThisType(byte[] block)
boolean isThisType(RandomAccessInputStream stream) throws IOException
IOException
int getImageCount()
boolean isRGB()
openBytes(int)
call.
This method returns true if and only if getRGBChannelCount()
returns a value greater than 1.int getSizeX()
int getSizeY()
int getSizeZ()
int getSizeC()
int getSizeT()
int getPixelType()
FormatTools
static pixel types such as FormatTools.INT8
.int getBitsPerPixel()
getPixelType()
.int getEffectiveSizeC()
int getRGBChannelCount()
boolean isIndexed()
getSizeC()
,
getEffectiveSizeC()
or getRGBChannelCount()
.boolean isFalseColor()
isIndexed()
is false, or if isIndexed()
is true and the lookup table represents "real" color data. Returns true
if isIndexed()
is true and the lookup table is only present to aid
in visualization.byte[][] get8BitLookupTable() throws FormatException, IOException
isIndexed()
returns
false, then this may return null. Also, if getPixelType()
returns
anything other than FormatTools.INT8
or FormatTools.UINT8
,
this method will return null.FormatException
IOException
short[][] get16BitLookupTable() throws FormatException, IOException
isIndexed()
returns
false, then this may return null. Also, if getPixelType()
returns
anything other than FormatTools.INT16
or FormatTools.UINT16
, this method will return null.FormatException
IOException
Modulo getModuloZ()
Modulo getModuloC()
Modulo getModuloT()
int[] getChannelDimLengths()
String[] getChannelDimTypes()
FormatTools
.int getThumbSizeX()
int getThumbSizeY()
boolean isLittleEndian()
String getDimensionOrder()
isInterleaved()
method will return true.boolean isOrderCertain()
boolean isThumbnailSeries()
boolean isInterleaved()
getDimensionOrder()
returns XYCTZ or XYCZT,
and this method returns true.
Note that this flag returns whether or not the data returned by
openBytes(int)
is interleaved. In most cases, this will
match the interleaving in the original file, but for some formats (e.g.
TIFF) channel re-ordering is done internally and the return value of
this method will not match what is in the original file.boolean isInterleaved(int subC)
SDTReader
handles spectral-lifetime data with
interleaved lifetime bins and non-interleaved spectral channels.byte[] openBytes(int no) throws FormatException, IOException
FormatException
IOException
openBytes(int, byte[])
byte[] openBytes(int no, int x, int y, int w, int h) throws FormatException, IOException
FormatException
IOException
byte[] openBytes(int no, byte[] buf) throws FormatException, IOException
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.byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
no
- the image index within the file.buf
- a pre-allocated buffer.x
- X coordinate of the upper-left corner of the sub-imagey
- Y coordinate of the upper-left corner of the sub-imagew
- width of the sub-imageh
- height of the sub-imagebuf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.IOException
- if there was a problem reading the file.Object openPlane(int no, int x, int y, int w, int h) throws FormatException, IOException
BufferedImage
. The openPlane method exists to
maintain generality and efficiency while avoiding pollution of the API
with AWT-specific logic.FormatException
IOException
FormatReader
,
BufferedImageReader
byte[] openThumbBytes(int no) throws FormatException, IOException
FormatException
IOException
void close(boolean fileOnly) throws IOException
Closeable.close()
.IOException
int getSeriesCount()
void setSeries(int no)
int getSeries()
void setNormalized(boolean normalize)
boolean isNormalized()
void setOriginalMetadataPopulated(boolean populate)
boolean isOriginalMetadataPopulated()
void setGroupFiles(boolean group)
boolean isGroupFiles()
boolean isMetadataComplete()
int fileGroupOption(String id) throws FormatException, IOException
FormatException
IOException
String[] getUsedFiles()
String[] getUsedFiles(boolean noPixels)
String[] getSeriesUsedFiles()
String[] getSeriesUsedFiles(boolean noPixels)
FileInfo[] getAdvancedUsedFiles(boolean noPixels)
FileInfo[] getAdvancedSeriesUsedFiles(boolean noPixels)
String getCurrentFile()
String[] getDomains()
int getIndex(int z, int c, int t)
int[] getZCTCoords(int index)
Object getMetadataValue(String field)
field
- the name associated with the metadata fieldObject getSeriesMetadataValue(String field)
field
- the name associated with the metadata fieldHashtable<String,Object> getGlobalMetadata()
Hashtable<String,Object> getSeriesMetadata()
List<CoreMetadata> getCoreMetadataList()
void setMetadataFiltered(boolean filter)
boolean isMetadataFiltered()
void setMetadataStore(MetadataStore store)
store
- a metadata store implementation.MetadataStore getMetadataStore()
null
metadata store.Object getMetadataStoreRoot()
IFormatReader[] getUnderlyingReaders()
boolean isSingleFile(String id) throws FormatException, IOException
FormatException
IOException
int getRequiredDirectories(String[] files) throws FormatException, IOException
FormatException
IOException
String getDatasetStructureDescription()
String[] getPossibleDomains(String id) throws FormatException, IOException
FormatException
IOException
boolean hasCompanionFiles()
int getOptimalTileWidth()
int getOptimalTileHeight()
int seriesToCoreIndex(int series)
int coreIndexToSeries(int index)
int getCoreIndex()
void setCoreIndex(int no)
int getResolutionCount()
void setResolution(int resolution)
getResolutionCount()
int getResolution()
getResolutionCount()
boolean hasFlattenedResolutions()
void setFlattenedResolutions(boolean flatten)
CoreMetadata[] getCoreMetadata()
Copyright © 2014 Open Microscopy Environment