public abstract class WrappedReader extends FormatReader
core, coreIndex, datasetDescription, domains, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Modifier | Constructor and Description |
---|---|
protected |
WrappedReader(java.lang.String format,
java.lang.String[] suffixes)
Constructs a new wrapped reader with the given name and suffixes.
|
Modifier and Type | Method and Description |
---|---|
protected void |
callDeferredSetters(ReaderWrapper helper)
A helper may not exist before initFile() is called.
|
void |
close() |
void |
close(boolean fileOnly)
Closes the currently open file.
|
int |
coreIndexToSeries(int index)
Returns the series corresponding to the specified core index.
|
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 |
getBitsPerPixel()
Gets the number of valid bits per pixel.
|
int |
getCoreIndex()
Return the index into CoreMetadata of the current resolution/series.
|
java.util.List<CoreMetadata> |
getCoreMetadataList()
Obtains the core metadata values for 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.
|
protected abstract ReaderWrapper |
getHelper()
Get the helper class that reads images
|
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).
|
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() |
java.lang.Class<?> |
getNativeDataType()
Returns the native data type of image planes for this reader, as returned
by
IFormatReader.openPlane(int, int, int, int, int) or IFormatWriter.savePlane(int, java.lang.Object) . |
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 |
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.
|
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(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(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.
|
boolean |
hasCompanionFiles()
Returns true if this format supports multi-file datasets.
|
boolean |
isFalseColor()
Returns false if
IFormatReader.isIndexed() is false, or if IFormatReader.isIndexed()
is true and the lookup table represents "real" color data. |
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 |
isOrderCertain()
Gets whether the dimension order and sizes are known, or merely guesses.
|
boolean |
isRGB()
Checks if the image planes in the file have more than one channel per
IFormatReader.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 |
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)
Returns the first core index corresponding to the specified series.
|
void |
setCoreIndex(int no)
Set the current resolution/series (ignores subresolutions).
|
void |
setResolution(int no)
Set the resolution level.
|
void |
setSeries(int no)
Activates the specified series.
|
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, fileGroupOption, flattenHashtables, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getCompression, getContrastMethod, getCorrection, getCurrentCore, getCurrentFile, getDetectorType, getDimensionOrder, getExperimentType, getFilamentType, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getIlluminationType, getImmersion, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMicrobeamManipulationType, getMicroscopeType, getNamingConvention, getPixelType, getPulse, getRequiredDirectories, getRotationTransform, getSeriesMeta, getSeriesUsedFiles, getUsedFiles, getZCTModuloCoords, hasFlattenedResolutions, initFile, isGroupFiles, isMetadataFiltered, isNormalized, isOriginalMetadataPopulated, isThisType, isThisType, isThisType, isThisType, isUsedFile, makeFilterMetadata, readPlane, readPlane, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, updateMetadataLists
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getSuffixes, getSupportedMetadataLevels, setMetadataOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getSuffixes
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
protected WrappedReader(java.lang.String format, java.lang.String[] suffixes)
protected abstract ReaderWrapper getHelper()
public void reopenFile() throws java.io.IOException
IFormatReader
IFormatHandler.setId(java.lang.String)
has been
called, but close(false) has not been called.reopenFile
in interface IFormatReader
reopenFile
in class FormatReader
java.io.IOException
public int getImageCount()
IFormatReader
getImageCount
in interface IFormatReader
getImageCount
in class FormatReader
public boolean isRGB()
IFormatReader
IFormatReader.openBytes(int)
call.
This method returns true if and only if IFormatReader.getRGBChannelCount()
returns a value greater than 1.isRGB
in interface IFormatReader
isRGB
in class FormatReader
public int getSizeX()
IFormatReader
getSizeX
in interface IFormatReader
getSizeX
in class FormatReader
public int getSizeY()
IFormatReader
getSizeY
in interface IFormatReader
getSizeY
in class FormatReader
public int getSizeZ()
IFormatReader
getSizeZ
in interface IFormatReader
getSizeZ
in class FormatReader
public int getSizeC()
IFormatReader
getSizeC
in interface IFormatReader
getSizeC
in class FormatReader
public int getSizeT()
IFormatReader
getSizeT
in interface IFormatReader
getSizeT
in class FormatReader
public int getPixelType()
IFormatReader
getPixelType
in interface IFormatReader
getPixelType
in class FormatReader
FormatTools
static pixel types such as FormatTools.INT8
.public int getBitsPerPixel()
IFormatReader
IFormatReader.getPixelType()
.getBitsPerPixel
in interface IFormatReader
getBitsPerPixel
in class FormatReader
public int getEffectiveSizeC()
IFormatReader
getEffectiveSizeC
in interface IFormatReader
getEffectiveSizeC
in class FormatReader
public int getRGBChannelCount()
IFormatReader
getRGBChannelCount
in interface IFormatReader
getRGBChannelCount
in class FormatReader
public boolean isIndexed()
IFormatReader
IFormatReader.getSizeC()
,
IFormatReader.getEffectiveSizeC()
or IFormatReader.getRGBChannelCount()
.isIndexed
in interface IFormatReader
isIndexed
in class FormatReader
public boolean isFalseColor()
IFormatReader
IFormatReader.isIndexed()
is false, or if IFormatReader.isIndexed()
is true and the lookup table represents "real" color data. Returns true
if IFormatReader.isIndexed()
is true and the lookup table is only present to aid
in visualization.isFalseColor
in interface IFormatReader
isFalseColor
in class FormatReader
public byte[][] get8BitLookupTable() throws FormatException, java.io.IOException
IFormatReader
IFormatReader.isIndexed()
returns
false, then this may return null. Also, if IFormatReader.getPixelType()
returns
anything other than FormatTools.INT8
or FormatTools.UINT8
,
this method will return null.get8BitLookupTable
in interface IFormatReader
get8BitLookupTable
in class FormatReader
FormatException
java.io.IOException
public short[][] get16BitLookupTable() throws FormatException, java.io.IOException
IFormatReader
IFormatReader.isIndexed()
returns
false, then this may return null. Also, if IFormatReader.getPixelType()
returns
anything other than FormatTools.INT16
or FormatTools.UINT16
, this method will return null.get16BitLookupTable
in interface IFormatReader
get16BitLookupTable
in class FormatReader
FormatException
java.io.IOException
public Modulo getModuloZ()
getModuloZ
in interface IFormatReader
getModuloZ
in class FormatReader
public Modulo getModuloC()
getModuloC
in interface IFormatReader
getModuloC
in class FormatReader
public Modulo getModuloT()
getModuloT
in interface IFormatReader
getModuloT
in class FormatReader
public int getThumbSizeX()
IFormatReader
getThumbSizeX
in interface IFormatReader
getThumbSizeX
in class FormatReader
public int getThumbSizeY()
IFormatReader
getThumbSizeY
in interface IFormatReader
getThumbSizeY
in class FormatReader
public boolean isLittleEndian()
IFormatReader
isLittleEndian
in interface IFormatReader
isLittleEndian
in class FormatReader
public java.lang.String getDimensionOrder()
IFormatReader
IFormatReader.isInterleaved()
method will return true.getDimensionOrder
in interface IFormatReader
getDimensionOrder
in class FormatReader
public boolean isOrderCertain()
IFormatReader
isOrderCertain
in interface IFormatReader
isOrderCertain
in class FormatReader
public boolean isThumbnailSeries()
IFormatReader
isThumbnailSeries
in interface IFormatReader
isThumbnailSeries
in class FormatReader
public boolean isInterleaved()
IFormatReader
IFormatReader.getDimensionOrder()
returns XYCTZ or XYCZT,
and this method returns true.
Note that this flag returns whether or not the data returned by
IFormatReader.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.isInterleaved
in interface IFormatReader
isInterleaved
in class FormatReader
public boolean isInterleaved(int subC)
IFormatReader
SDTReader
handles spectral-lifetime data with
interleaved lifetime bins and non-interleaved spectral channels.isInterleaved
in interface IFormatReader
isInterleaved
in class FormatReader
public byte[] openBytes(int no) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
FormatException
java.io.IOException
IFormatReader.openBytes(int, byte[])
public byte[] openBytes(int no, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
FormatException
java.io.IOException
public byte[] openBytes(int no, byte[] buf) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
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.public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
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.public java.lang.Object openPlane(int no, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
BufferedImage
. The openPlane method exists to
maintain generality and efficiency while avoiding pollution of the API
with AWT-specific logic.openPlane
in interface IFormatReader
openPlane
in class FormatReader
FormatException
java.io.IOException
FormatReader
,
BufferedImageReader
public byte[] openThumbBytes(int no) throws FormatException, java.io.IOException
IFormatReader
openThumbBytes
in interface IFormatReader
openThumbBytes
in class FormatReader
FormatException
java.io.IOException
public void close(boolean fileOnly) throws java.io.IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class FormatReader
java.io.IOException
public int getSeriesCount()
IFormatReader
getSeriesCount
in interface IFormatReader
getSeriesCount
in class FormatReader
public void setSeries(int no)
IFormatReader
setSeries
in interface IFormatReader
setSeries
in class FormatReader
public int getSeries()
IFormatReader
getSeries
in interface IFormatReader
getSeries
in class FormatReader
public boolean isMetadataComplete()
IFormatReader
isMetadataComplete
in interface IFormatReader
isMetadataComplete
in class FormatReader
public java.lang.String[] getSeriesUsedFiles(boolean noPixels)
IFormatReader
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.getSeriesUsedFiles
in interface IFormatReader
getSeriesUsedFiles
in class FormatReader
public java.lang.String[] getUsedFiles(boolean noPixels)
IFormatReader
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.getUsedFiles
in interface IFormatReader
getUsedFiles
in class FormatReader
public int getIndex(int z, int c, int t)
IFormatReader
getIndex
in interface IFormatReader
getIndex
in class FormatReader
public int[] getZCTCoords(int index)
IFormatReader
getZCTCoords
in interface IFormatReader
getZCTCoords
in class FormatReader
public java.lang.Object getMetadataValue(java.lang.String field)
IFormatReader
getMetadataValue
in interface IFormatReader
getMetadataValue
in class FormatReader
field
- the name associated with the metadata fieldpublic java.lang.Object getSeriesMetadataValue(java.lang.String field)
IFormatReader
getSeriesMetadataValue
in interface IFormatReader
getSeriesMetadataValue
in class FormatReader
field
- the name associated with the metadata fieldpublic java.util.Hashtable<java.lang.String,java.lang.Object> getGlobalMetadata()
IFormatReader
getGlobalMetadata
in interface IFormatReader
getGlobalMetadata
in class FormatReader
public java.util.Hashtable<java.lang.String,java.lang.Object> getSeriesMetadata()
IFormatReader
getSeriesMetadata
in interface IFormatReader
getSeriesMetadata
in class FormatReader
public java.util.List<CoreMetadata> getCoreMetadataList()
IFormatReader
getCoreMetadataList
in interface IFormatReader
getCoreMetadataList
in class FormatReader
public java.lang.Object getMetadataStoreRoot()
IFormatReader
getMetadataStoreRoot
in interface IFormatReader
getMetadataStoreRoot
in class FormatReader
public IFormatReader[] getUnderlyingReaders()
IFormatReader
getUnderlyingReaders
in interface IFormatReader
getUnderlyingReaders
in class FormatReader
public boolean isSingleFile(java.lang.String id) throws FormatException, java.io.IOException
IFormatReader
isSingleFile
in interface IFormatReader
isSingleFile
in class FormatReader
FormatException
java.io.IOException
public java.lang.String getDatasetStructureDescription()
IFormatReader
getDatasetStructureDescription
in interface IFormatReader
getDatasetStructureDescription
in class FormatReader
public boolean hasCompanionFiles()
IFormatReader
hasCompanionFiles
in interface IFormatReader
hasCompanionFiles
in class FormatReader
public java.lang.String[] getPossibleDomains(java.lang.String id) throws FormatException, java.io.IOException
IFormatReader
getPossibleDomains
in interface IFormatReader
getPossibleDomains
in class FormatReader
FormatException
java.io.IOException
public java.lang.String[] getDomains()
IFormatReader
getDomains
in interface IFormatReader
getDomains
in class FormatReader
public int getOptimalTileWidth()
IFormatReader
getOptimalTileWidth
in interface IFormatReader
getOptimalTileWidth
in class FormatReader
public int getOptimalTileHeight()
IFormatReader
getOptimalTileHeight
in interface IFormatReader
getOptimalTileHeight
in class FormatReader
public int getCoreIndex()
IFormatReader
getCoreIndex
in interface IFormatReader
getCoreIndex
in class FormatReader
public void setCoreIndex(int no)
IFormatReader
setCoreIndex
in interface IFormatReader
setCoreIndex
in class FormatReader
public int seriesToCoreIndex(int series)
IFormatReader
seriesToCoreIndex
in interface IFormatReader
seriesToCoreIndex
in class FormatReader
public int coreIndexToSeries(int index)
IFormatReader
coreIndexToSeries
in interface IFormatReader
coreIndexToSeries
in class FormatReader
public int getResolutionCount()
IPyramidHandler
getResolutionCount
in interface IPyramidHandler
getResolutionCount
in class FormatReader
public void setResolution(int no)
IPyramidHandler
setResolution
in interface IPyramidHandler
setResolution
in class FormatReader
IPyramidHandler.getResolutionCount()
public int getResolution()
IPyramidHandler
getResolution
in interface IPyramidHandler
getResolution
in class FormatReader
IPyramidHandler.getResolutionCount()
public java.lang.Class<?> getNativeDataType()
IFormatHandler
IFormatReader.openPlane(int, int, int, int, int)
or IFormatWriter.savePlane(int, java.lang.Object)
.
For most readers this type will be a byte array; however, some readers
call external APIs that work with other types such as
BufferedImage
.getNativeDataType
in interface IFormatHandler
getNativeDataType
in class FormatHandler
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class FormatReader
java.io.IOException
protected void callDeferredSetters(ReaderWrapper helper)
helper
- The wrapped helperCopyright © 2020 Open Microscopy Environment