public abstract class DelegateReader extends FormatReader
| Modifier and Type | Field and Description |
|---|---|
protected IFormatReader |
legacyReader
Legacy reader.
|
protected boolean |
legacyReaderInitialized
Flag indicating that the legacy reader was successfully initialized.
|
protected IFormatReader |
nativeReader
Native reader.
|
protected boolean |
nativeReaderInitialized
Flag indicating that the native reader was successfully initialized.
|
protected boolean |
useLegacy
Flag indicating whether to use legacy reader by default.
|
core, coreIndex, datasetDescription, domains, fillColor, 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| Constructor and Description |
|---|
DelegateReader(java.lang.String format,
java.lang.String suffix)
Constructs a new delegate reader.
|
DelegateReader(java.lang.String format,
java.lang.String[] suffixes)
Constructs a new delegate reader.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
callLegacyReader() |
void |
close(boolean fileOnly)
Closes the currently open file.
|
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.
|
MetadataOptions |
getMetadataOptions() |
int |
getOptimalTileHeight()
Returns the optimal sub-image height for use with openBytes.
|
int |
getOptimalTileWidth()
Returns the optimal sub-image width for use with openBytes.
|
java.lang.String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
java.util.Set<MetadataLevel> |
getSupportedMetadataLevels() |
boolean |
isLegacy()
Gets whether to use the legacy reader by default.
|
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 a file matches the type of this format reader.
|
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.
|
void |
reopenFile()
Reopen any files that were closed, and which are expected to be open
while the reader is open.
|
void |
setCoreIndex(int no)
Set the current resolution/series (ignores subresolutions).
|
void |
setFlattenedResolutions(boolean flattened)
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 |
setId(java.lang.String id)
Initialize a reader from the input file name.
|
void |
setLegacy(boolean legacy)
Sets whether to use the legacy reader by default.
|
void |
setMetadataFiltered(boolean filter)
Specifies whether ugly metadata (entries with unprintable characters,
and extremely large entries) should be discarded from the metadata table.
|
void |
setMetadataOptions(MetadataOptions options) |
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.
|
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, coreIndexToSeries, fileGroupOption, flattenHashtables, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillColor, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, initFile, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, seriesToCoreIndex, setFillColor, updateMetadataListscheckSuffix, checkSuffix, getFormat, getNativeDataType, getSuffixesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormat, getNativeDataType, getSuffixesprotected boolean useLegacy
protected IFormatReader nativeReader
protected IFormatReader legacyReader
protected boolean nativeReaderInitialized
protected boolean legacyReaderInitialized
public DelegateReader(java.lang.String format,
java.lang.String suffix)
public DelegateReader(java.lang.String format,
java.lang.String[] suffixes)
public void setLegacy(boolean legacy)
public boolean isLegacy()
public java.util.Set<MetadataLevel> getSupportedMetadataLevels()
getSupportedMetadataLevels in interface IMetadataConfigurablegetSupportedMetadataLevels in class FormatHandlerpublic MetadataOptions getMetadataOptions()
getMetadataOptions in interface IMetadataConfigurablegetMetadataOptions in class FormatHandlerpublic void setMetadataOptions(MetadataOptions options)
setMetadataOptions in interface IMetadataConfigurablesetMetadataOptions in class FormatHandlerpublic boolean isThisType(java.lang.String name,
boolean open)
FormatReaderFormatReader.isThisType(RandomAccessInputStream).isThisType in interface IFormatReaderisThisType in class FormatReaderopen - If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.public boolean isThisType(loci.common.RandomAccessInputStream stream)
throws java.io.IOException
IFormatReaderisThisType in interface IFormatReaderisThisType in class FormatReaderstream - 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.IOExceptionpublic void setSeries(int no)
IFormatReadersetSeries in interface IFormatReadersetSeries in class FormatReaderpublic void setCoreIndex(int no)
IFormatReadersetCoreIndex in interface IFormatReadersetCoreIndex in class FormatReaderpublic void setResolution(int resolution)
IPyramidHandlersetResolution in interface IPyramidHandlersetResolution in class FormatReaderIPyramidHandler.getResolutionCount()public void setNormalized(boolean normalize)
IFormatReadersetNormalized in interface IFormatReadersetNormalized in class FormatReaderpublic void setOriginalMetadataPopulated(boolean populate)
IFormatReadersetOriginalMetadataPopulated in interface IFormatReadersetOriginalMetadataPopulated in class FormatReaderpublic void setGroupFiles(boolean group)
IFormatReadersetGroupFiles in interface IFormatReadersetGroupFiles in class FormatReaderIFormatReader.fileGroupOption(String),
IFormatReader.isGroupFiles()public void setFlattenedResolutions(boolean flattened)
IFormatReadersetFlattenedResolutions in interface IFormatReadersetFlattenedResolutions in class FormatReaderpublic void setMetadataFiltered(boolean filter)
IFormatReadersetMetadataFiltered in interface IFormatReadersetMetadataFiltered in class FormatReaderpublic void setMetadataStore(MetadataStore store)
IFormatReadersetMetadataStore in interface IFormatReadersetMetadataStore in class FormatReaderstore - a metadata store implementation.public 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 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 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 void close(boolean fileOnly)
throws java.io.IOException
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class FormatReaderjava.io.IOExceptionpublic int getOptimalTileWidth()
IFormatReadergetOptimalTileWidth in interface IFormatReadergetOptimalTileWidth in class FormatReaderpublic int getOptimalTileHeight()
IFormatReadergetOptimalTileHeight in interface IFormatReadergetOptimalTileHeight in class FormatReaderpublic 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 void setId(java.lang.String id)
throws FormatException,
java.io.IOException
FormatReaderFormatReader.initFile(String id) to initialize the input file, read
all of the metadata and set the reader up for reading planes.
The performance of this method depends on the format and can be up to
several minutes for large file sets.setId in interface IFormatHandlersetId in class FormatReaderid - a String specifying the path to the fileFormatExceptionjava.io.IOExceptionprivate boolean callLegacyReader()
Copyright © 2023 Open Microscopy Environment