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_DIMENSIONCOMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixesCAN_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, readPlane, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, updateMetadataListscheckSuffix, checkSuffix, getFormat, getMetadataOptions, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormat, getSuffixesgetMetadataOptions, getSupportedMetadataLevels, setMetadataOptionsprotected WrappedReader(java.lang.String format,
java.lang.String[] suffixes)
protected abstract ReaderWrapper getHelper()
public void reopenFile()
throws java.io.IOException
IFormatReaderIFormatHandler.setId(java.lang.String) has been
called, but close(false) has not been called.reopenFile in interface IFormatReaderreopenFile in class FormatReaderjava.io.IOExceptionpublic int getImageCount()
IFormatReadergetImageCount in interface IFormatReadergetImageCount in class FormatReaderpublic boolean isRGB()
IFormatReaderIFormatReader.openBytes(int) call.
This method returns true if and only if IFormatReader.getRGBChannelCount()
returns a value greater than 1.isRGB in interface IFormatReaderisRGB in class FormatReaderpublic int getSizeX()
IFormatReadergetSizeX in interface IFormatReadergetSizeX in class FormatReaderpublic int getSizeY()
IFormatReadergetSizeY in interface IFormatReadergetSizeY in class FormatReaderpublic int getSizeZ()
IFormatReadergetSizeZ in interface IFormatReadergetSizeZ in class FormatReaderpublic int getSizeC()
IFormatReadergetSizeC in interface IFormatReadergetSizeC in class FormatReaderpublic int getSizeT()
IFormatReadergetSizeT in interface IFormatReadergetSizeT in class FormatReaderpublic int getPixelType()
IFormatReadergetPixelType in interface IFormatReadergetPixelType in class FormatReaderFormatTools
static pixel types such as FormatTools.INT8.public int getBitsPerPixel()
IFormatReaderIFormatReader.getPixelType().getBitsPerPixel in interface IFormatReadergetBitsPerPixel in class FormatReaderpublic int getEffectiveSizeC()
IFormatReadergetEffectiveSizeC in interface IFormatReadergetEffectiveSizeC in class FormatReaderpublic int getRGBChannelCount()
IFormatReadergetRGBChannelCount in interface IFormatReadergetRGBChannelCount in class FormatReaderpublic boolean isIndexed()
IFormatReaderIFormatReader.getSizeC(),
IFormatReader.getEffectiveSizeC() or IFormatReader.getRGBChannelCount().isIndexed in interface IFormatReaderisIndexed in class FormatReaderpublic boolean isFalseColor()
IFormatReaderIFormatReader.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 IFormatReaderisFalseColor in class FormatReaderpublic byte[][] get8BitLookupTable()
throws FormatException,
java.io.IOException
IFormatReaderIFormatReader.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 IFormatReaderget8BitLookupTable in class FormatReaderFormatExceptionjava.io.IOExceptionpublic short[][] get16BitLookupTable()
throws FormatException,
java.io.IOException
IFormatReaderIFormatReader.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 IFormatReaderget16BitLookupTable in class FormatReaderFormatExceptionjava.io.IOExceptionpublic Modulo getModuloZ()
getModuloZ in interface IFormatReadergetModuloZ in class FormatReaderpublic Modulo getModuloC()
getModuloC in interface IFormatReadergetModuloC in class FormatReaderpublic Modulo getModuloT()
getModuloT in interface IFormatReadergetModuloT in class FormatReaderpublic int getThumbSizeX()
IFormatReadergetThumbSizeX in interface IFormatReadergetThumbSizeX in class FormatReaderpublic int getThumbSizeY()
IFormatReadergetThumbSizeY in interface IFormatReadergetThumbSizeY in class FormatReaderpublic boolean isLittleEndian()
IFormatReaderisLittleEndian in interface IFormatReaderisLittleEndian in class FormatReaderpublic java.lang.String getDimensionOrder()
IFormatReaderIFormatReader.isInterleaved() method will return true.getDimensionOrder in interface IFormatReadergetDimensionOrder in class FormatReaderpublic boolean isOrderCertain()
IFormatReaderisOrderCertain in interface IFormatReaderisOrderCertain in class FormatReaderpublic boolean isThumbnailSeries()
IFormatReaderisThumbnailSeries in interface IFormatReaderisThumbnailSeries in class FormatReaderpublic boolean isInterleaved()
IFormatReaderIFormatReader.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 IFormatReaderisInterleaved in class FormatReaderpublic boolean isInterleaved(int subC)
IFormatReaderSDTReader handles spectral-lifetime data with
interleaved lifetime bins and non-interleaved spectral channels.isInterleaved in interface IFormatReaderisInterleaved in class FormatReaderpublic byte[] openBytes(int no)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class FormatReaderFormatExceptionjava.io.IOExceptionIFormatReader.openBytes(int, byte[])public byte[] openBytes(int no,
int x,
int y,
int w,
int h)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class FormatReaderFormatExceptionjava.io.IOExceptionpublic byte[] openBytes(int no,
byte[] buf)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class FormatReaderno - 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
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class FormatReaderno - 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
IFormatReaderBufferedImage. The openPlane method exists to
maintain generality and efficiency while avoiding pollution of the API
with AWT-specific logic.openPlane in interface IFormatReaderopenPlane in class FormatReaderFormatExceptionjava.io.IOExceptionFormatReader,
BufferedImageReaderpublic byte[] openThumbBytes(int no)
throws FormatException,
java.io.IOException
IFormatReaderopenThumbBytes in interface IFormatReaderopenThumbBytes in class FormatReaderFormatExceptionjava.io.IOExceptionpublic void close(boolean fileOnly)
throws java.io.IOException
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class FormatReaderjava.io.IOExceptionpublic int getSeriesCount()
IFormatReadergetSeriesCount in interface IFormatReadergetSeriesCount in class FormatReaderpublic void setSeries(int no)
IFormatReadersetSeries in interface IFormatReadersetSeries in class FormatReaderpublic int getSeries()
IFormatReadergetSeries in interface IFormatReadergetSeries in class FormatReaderpublic boolean isMetadataComplete()
IFormatReaderisMetadataComplete in interface IFormatReaderisMetadataComplete in class FormatReaderpublic java.lang.String[] getSeriesUsedFiles(boolean noPixels)
IFormatReaderIFormatHandler.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 IFormatReadergetSeriesUsedFiles in class FormatReaderpublic java.lang.String[] getUsedFiles(boolean noPixels)
IFormatReaderIFormatHandler.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 IFormatReadergetUsedFiles in class FormatReaderpublic int getIndex(int z,
int c,
int t)
IFormatReadergetIndex in interface IFormatReadergetIndex in class FormatReaderpublic int[] getZCTCoords(int index)
IFormatReadergetZCTCoords in interface IFormatReadergetZCTCoords in class FormatReaderpublic java.lang.Object getMetadataValue(java.lang.String field)
IFormatReadergetMetadataValue in interface IFormatReadergetMetadataValue in class FormatReaderfield - the name associated with the metadata fieldpublic java.lang.Object getSeriesMetadataValue(java.lang.String field)
IFormatReadergetSeriesMetadataValue in interface IFormatReadergetSeriesMetadataValue in class FormatReaderfield - the name associated with the metadata fieldpublic java.util.Hashtable<java.lang.String,java.lang.Object> getGlobalMetadata()
IFormatReadergetGlobalMetadata in interface IFormatReadergetGlobalMetadata in class FormatReaderpublic java.util.Hashtable<java.lang.String,java.lang.Object> getSeriesMetadata()
IFormatReadergetSeriesMetadata in interface IFormatReadergetSeriesMetadata in class FormatReaderpublic java.util.List<CoreMetadata> getCoreMetadataList()
IFormatReadergetCoreMetadataList in interface IFormatReadergetCoreMetadataList in class FormatReaderpublic java.lang.Object getMetadataStoreRoot()
IFormatReadergetMetadataStoreRoot in interface IFormatReadergetMetadataStoreRoot in class FormatReaderpublic IFormatReader[] getUnderlyingReaders()
IFormatReadergetUnderlyingReaders in interface IFormatReadergetUnderlyingReaders in class FormatReaderpublic boolean isSingleFile(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReaderisSingleFile in interface IFormatReaderisSingleFile in class FormatReaderFormatExceptionjava.io.IOExceptionpublic java.lang.String getDatasetStructureDescription()
IFormatReadergetDatasetStructureDescription in interface IFormatReadergetDatasetStructureDescription in class FormatReaderpublic boolean hasCompanionFiles()
IFormatReaderhasCompanionFiles in interface IFormatReaderhasCompanionFiles in class FormatReaderpublic java.lang.String[] getPossibleDomains(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReadergetPossibleDomains in interface IFormatReadergetPossibleDomains in class FormatReaderFormatExceptionjava.io.IOExceptionpublic java.lang.String[] getDomains()
IFormatReadergetDomains in interface IFormatReadergetDomains in class FormatReaderpublic int getOptimalTileWidth()
IFormatReadergetOptimalTileWidth in interface IFormatReadergetOptimalTileWidth in class FormatReaderpublic int getOptimalTileHeight()
IFormatReadergetOptimalTileHeight in interface IFormatReadergetOptimalTileHeight in class FormatReaderpublic int getCoreIndex()
IFormatReadergetCoreIndex in interface IFormatReadergetCoreIndex in class FormatReaderpublic void setCoreIndex(int no)
IFormatReadersetCoreIndex in interface IFormatReadersetCoreIndex in class FormatReaderpublic int seriesToCoreIndex(int series)
IFormatReaderseriesToCoreIndex in interface IFormatReaderseriesToCoreIndex in class FormatReaderpublic int coreIndexToSeries(int index)
IFormatReadercoreIndexToSeries in interface IFormatReadercoreIndexToSeries in class FormatReaderpublic int getResolutionCount()
IPyramidHandlergetResolutionCount in interface IPyramidHandlergetResolutionCount in class FormatReaderpublic void setResolution(int no)
IPyramidHandlersetResolution in interface IPyramidHandlersetResolution in class FormatReaderIPyramidHandler.getResolutionCount()public int getResolution()
IPyramidHandlergetResolution in interface IPyramidHandlergetResolution in class FormatReaderIPyramidHandler.getResolutionCount()public java.lang.Class<?> getNativeDataType()
IFormatHandlerIFormatReader.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 IFormatHandlergetNativeDataType in class FormatHandlerpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class FormatReaderjava.io.IOExceptionprotected void callDeferredSetters(ReaderWrapper helper)
helper - The wrapped helperCopyright © 2022 Open Microscopy Environment