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, 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
Constructor and Description |
---|
DelegateReader(String format,
String suffix)
Constructs a new delegate reader.
|
DelegateReader(String format,
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.
|
String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
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(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(String id)
Initializes 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, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, 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, seriesToCoreIndex
checkSuffix, checkSuffix, getFormat, getNativeDataType, getSuffixes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes
protected boolean useLegacy
protected IFormatReader nativeReader
protected IFormatReader legacyReader
protected boolean nativeReaderInitialized
protected boolean legacyReaderInitialized
public DelegateReader(String format, String suffix)
public void setLegacy(boolean legacy)
public boolean isLegacy()
public Set<MetadataLevel> getSupportedMetadataLevels()
getSupportedMetadataLevels
in interface IMetadataConfigurable
getSupportedMetadataLevels
in class FormatHandler
public MetadataOptions getMetadataOptions()
getMetadataOptions
in interface IMetadataConfigurable
getMetadataOptions
in class FormatHandler
public void setMetadataOptions(MetadataOptions options)
setMetadataOptions
in interface IMetadataConfigurable
setMetadataOptions
in class FormatHandler
public boolean isThisType(String name, boolean open)
FormatReader
FormatReader.isThisType(RandomAccessInputStream)
.isThisType
in interface IFormatReader
isThisType
in class FormatReader
open
- 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 IOException
IFormatReader
isThisType
in interface IFormatReader
isThisType
in class FormatReader
IOException
public void setSeries(int no)
IFormatReader
setSeries
in interface IFormatReader
setSeries
in class FormatReader
public void setCoreIndex(int no)
IFormatReader
setCoreIndex
in interface IFormatReader
setCoreIndex
in class FormatReader
public void setResolution(int resolution)
IFormatReader
setResolution
in interface IFormatReader
setResolution
in class FormatReader
IFormatReader.getResolutionCount()
public void setNormalized(boolean normalize)
IFormatReader
setNormalized
in interface IFormatReader
setNormalized
in class FormatReader
public void setOriginalMetadataPopulated(boolean populate)
IFormatReader
setOriginalMetadataPopulated
in interface IFormatReader
setOriginalMetadataPopulated
in class FormatReader
public void setGroupFiles(boolean group)
IFormatReader
setGroupFiles
in interface IFormatReader
setGroupFiles
in class FormatReader
public void setFlattenedResolutions(boolean flattened)
IFormatReader
setFlattenedResolutions
in interface IFormatReader
setFlattenedResolutions
in class FormatReader
public void setMetadataFiltered(boolean filter)
IFormatReader
setMetadataFiltered
in interface IFormatReader
setMetadataFiltered
in class FormatReader
public void setMetadataStore(MetadataStore store)
IFormatReader
setMetadataStore
in interface IFormatReader
setMetadataStore
in class FormatReader
store
- a metadata store implementation.public byte[][] get8BitLookupTable() throws FormatException, 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
IOException
public short[][] get16BitLookupTable() throws FormatException, 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
IOException
public String[] getSeriesUsedFiles(boolean noPixels)
IFormatReader
getSeriesUsedFiles
in interface IFormatReader
getSeriesUsedFiles
in class FormatReader
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
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.public void close(boolean fileOnly) throws IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class FormatReader
IOException
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 void reopenFile() throws 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
IOException
public void setId(String id) throws FormatException, IOException
FormatReader
FormatReader.initFile(String id)
to initializes the input file, reads
all of the metadata and sets 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 IFormatHandler
setId
in class FormatReader
id
- a String
specifying the path to the fileFormatException
IOException
private boolean callLegacyReader()
Copyright © 2017 Open Microscopy Environment