public interface IFormatReader extends IFormatHandler, IPyramidHandler
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)
Deprecated.
This method is no longer required for sub-resolution support.
|
int |
fileGroupOption(java.lang.String id)
Returns an indication of whether the files in a multi-file dataset can
be handled individually.
|
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 |
getCoreIndex()
Deprecated.
This method is no longer required for sub-resolution support.
|
java.util.List<CoreMetadata> |
getCoreMetadataList()
Deprecated.
Reader internals should not be accessed by reader users
|
java.lang.String |
getCurrentFile()
Returns the current file.
|
java.lang.String |
getDatasetStructureDescription()
Returns a short description of the dataset structure.
|
java.lang.String |
getDimensionOrder()
Gets a five-character string representing the
dimension order in which planes will be returned.
|
java.lang.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().
|
java.util.Hashtable<java.lang.String,java.lang.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 (real sizes).
|
int |
getIndex(int z,
int c,
int t,
int moduloZ,
int moduloC,
int moduloT)
Gets the rasterized index corresponding to the given Z, C, T,
moduloZ, moduloC and moduloT coordinates (effective sizes).
|
MetadataStore |
getMetadataStore()
Retrieves the current metadata store for this reader.
|
java.lang.Object |
getMetadataStoreRoot()
Retrieves the current metadata store's root object.
|
java.lang.Object |
getMetadataValue(java.lang.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.
|
java.lang.String[] |
getPossibleDomains(java.lang.String id)
Returns a list of scientific domains in which this format is used.
|
int |
getRequiredDirectories(java.lang.String[] files)
Returns the number of parent directories that are important when
processing the given list of files.
|
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.
|
java.util.Hashtable<java.lang.String,java.lang.Object> |
getSeriesMetadata()
Obtains the hashtable containing metadata field/value pairs from the
current series in the current file.
|
java.lang.Object |
getSeriesMetadataValue(java.lang.String field)
Obtains the specified metadata field's value for the current series
in the current file.
|
java.lang.String[] |
getSeriesUsedFiles()
Returns an array of filenames needed to open the current series.
|
java.lang.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.
|
java.lang.String[] |
getUsedFiles()
Returns an array of filenames needed to open this dataset.
|
java.lang.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 (real sizes) corresponding to the
given rasterized index value.
|
int[] |
getZCTModuloCoords(int index)
Gets the Z, C, T, moduloZ, moduloC and moduloT coordinates
(effective sizes) 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(java.lang.String id)
Returns true if the named file is expected to be the only
file in the dataset.
|
boolean |
isThisType(byte[] block)
Checks if the given block is a valid header for this file format.
|
boolean |
isThisType(loci.common.RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
boolean |
isThisType(java.lang.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).
|
java.lang.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.
|
void |
reopenFile()
Reopen any files that were closed, and which are expected to be open
while the reader is open.
|
int |
seriesToCoreIndex(int series)
Deprecated.
This method is no longer required for sub-resolution support.
|
void |
setCoreIndex(int no)
Deprecated.
This method is no longer required for sub-resolution support.
|
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 |
setSeries(int no)
Activates the specified series.
|
getFormat, getNativeDataType, getSuffixes, isThisType, setId
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
getResolution, getResolutionCount, setResolution
static final int MUST_GROUP
static final int CAN_GROUP
static final int CANNOT_GROUP
boolean isThisType(java.lang.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)
isThisType(RandomAccessInputStream)
boolean isThisType(loci.common.RandomAccessInputStream stream) throws java.io.IOException
stream
- A RandomAccessInputStream representing the file to check.
The first byte in the stream is assumed to be the first byte
in the file.java.io.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, java.io.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
java.io.IOException
short[][] get16BitLookupTable() throws FormatException, java.io.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
java.io.IOException
Modulo getModuloZ()
Modulo getModuloC()
Modulo getModuloT()
int getThumbSizeX()
int getThumbSizeY()
boolean isLittleEndian()
java.lang.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, java.io.IOException
FormatException
java.io.IOException
openBytes(int, byte[])
byte[] openBytes(int no, int x, int y, int w, int h) throws FormatException, java.io.IOException
FormatException
java.io.IOException
byte[] openBytes(int no, byte[] buf) throws FormatException, java.io.IOException
no
- the plane index within the current series.buf
- a pre-allocated buffer.buf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.java.io.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, java.io.IOException
no
- the plane index within the current series.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.java.io.IOException
- if there was a problem reading the file.java.lang.Object openPlane(int no, int x, int y, int w, int h) throws FormatException, java.io.IOException
BufferedImage
. The openPlane method exists to
maintain generality and efficiency while avoiding pollution of the API
with AWT-specific logic.FormatException
java.io.IOException
FormatReader
,
BufferedImageReader
byte[] openThumbBytes(int no) throws FormatException, java.io.IOException
FormatException
java.io.IOException
void close(boolean fileOnly) throws java.io.IOException
Closeable.close()
.java.io.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)
fileGroupOption(String)
,
isGroupFiles()
boolean isGroupFiles()
setGroupFiles(boolean)
,
fileGroupOption(String)
boolean isMetadataComplete()
int fileGroupOption(java.lang.String id) throws FormatException, java.io.IOException
id
- a file in the multi-file datasetFormatTools.MUST_GROUP
indicates that the
files cannot be handled separately; the reader will always detect and
read all files in the dataset. FormatTools.CAN_GROUP
indicates
that the files may be handled separately, but file grouping must then
be disabled via setGroupFiles(boolean)
.
FormatTools.CANNOT_GROUP
indicates that the files must be handled
separately; the reader will not attempt to read all files in the dataset
(this is rare).FormatException
java.io.IOException
FormatTools.MUST_GROUP
,
FormatTools.CAN_GROUP
,
FormatTools.CANNOT_GROUP
java.lang.String[] getUsedFiles()
IFormatHandler.setId(String)
. The remaining elements are expected to be in a
consistent order; if a directory listing is necessary to build the list
then it should be sorted first.java.lang.String[] getUsedFiles(boolean noPixels)
IFormatHandler.setId(String)
, if appropriate based upon 'noPixels'.
The remaining elements are expected to be in a consistent order;
if a directory listing is necessary to build the list then it should
be sorted first.java.lang.String[] getSeriesUsedFiles()
IFormatHandler.setId(String)
. The remaining elements are expected to be in a
consistent order; if a directory listing is necessary to build the list
then it should be sorted first.java.lang.String[] getSeriesUsedFiles(boolean noPixels)
IFormatHandler.setId(String)
, if appropriate based upon 'noPixels'.
The remaining elements are expected to be in a consistent order;
if a directory listing is necessary to build the list then it should
be sorted first.FileInfo[] getAdvancedUsedFiles(boolean noPixels)
FileInfo[] getAdvancedSeriesUsedFiles(boolean noPixels)
java.lang.String getCurrentFile()
java.lang.String[] getDomains()
int getIndex(int z, int c, int t)
int getIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT)
int[] getZCTCoords(int index)
int[] getZCTModuloCoords(int index)
java.lang.Object getMetadataValue(java.lang.String field)
field
- the name associated with the metadata fieldjava.lang.Object getSeriesMetadataValue(java.lang.String field)
field
- the name associated with the metadata fieldjava.util.Hashtable<java.lang.String,java.lang.Object> getGlobalMetadata()
java.util.Hashtable<java.lang.String,java.lang.Object> getSeriesMetadata()
@Deprecated java.util.List<CoreMetadata> getCoreMetadataList()
void setMetadataFiltered(boolean filter)
boolean isMetadataFiltered()
void setMetadataStore(MetadataStore store)
store
- a metadata store implementation.MetadataStore getMetadataStore()
null
metadata store.java.lang.Object getMetadataStoreRoot()
IFormatReader[] getUnderlyingReaders()
boolean isSingleFile(java.lang.String id) throws FormatException, java.io.IOException
FormatException
java.io.IOException
int getRequiredDirectories(java.lang.String[] files) throws FormatException, java.io.IOException
FormatException
java.io.IOException
java.lang.String getDatasetStructureDescription()
java.lang.String[] getPossibleDomains(java.lang.String id) throws FormatException, java.io.IOException
FormatException
java.io.IOException
boolean hasCompanionFiles()
int getOptimalTileWidth()
int getOptimalTileHeight()
@Deprecated int seriesToCoreIndex(int series)
@Deprecated int coreIndexToSeries(int index)
@Deprecated int getCoreIndex()
@Deprecated void setCoreIndex(int no)
boolean hasFlattenedResolutions()
void setFlattenedResolutions(boolean flatten)
void reopenFile() throws java.io.IOException
IFormatHandler.setId(java.lang.String)
has been
called, but close(false) has not been called.java.io.IOException
Copyright © 2022 Open Microscopy Environment