public abstract class FormatReader extends FormatHandler implements IFormatReader
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<CoreMetadata> |
core
Core metadata values.
|
protected int |
coreIndex
The number of the current series.
|
protected java.lang.String |
datasetDescription
Short description of the structure of the dataset.
|
protected java.lang.String[] |
domains
List of domains in which this format is used.
|
private loci.common.services.ServiceFactory |
factory |
protected java.lang.Byte |
fillColor
Fill value for undefined pixels.
|
protected boolean |
filterMetadata
Whether or not to filter out invalid metadata.
|
protected boolean |
flattenedResolutions
Whether or not resolutions are flattened.
|
protected boolean |
group
Whether or not to group multi-file formats.
|
protected boolean |
hasCompanionFiles
Whether this format supports multi-file datasets.
|
protected loci.common.RandomAccessInputStream |
in
Current file.
|
protected boolean |
indexedAsRGB
Whether or not MetadataStore sets C = 3 for indexed color images.
|
protected java.util.Hashtable<java.lang.String,java.lang.Object> |
metadata
Hashtable containing metadata key/value pairs.
|
protected MetadataStore |
metadataStore
Current metadata store.
|
protected boolean |
normalizeData
Whether or not to normalize float data.
|
protected int |
resolution
The number of the current resolution.
|
protected boolean |
saveOriginalMetadata
Whether or not to save proprietary metadata in the MetadataStore.
|
protected int |
series
The number of the current series (non flat).
|
private OMEXMLService |
service |
protected boolean |
suffixNecessary
Whether the file extension matching one of the reader's suffixes
is necessary to identify the file as an instance of this format.
|
protected boolean |
suffixSufficient
Whether the file extension matching one of the reader's suffixes
is sufficient to identify the file as an instance of this format.
|
protected static int |
THUMBNAIL_DIMENSION
Default thumbnail width and height.
|
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixesCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description |
|---|
FormatReader(java.lang.String format,
java.lang.String suffix)
Constructs a format reader with the given name and default suffix.
|
FormatReader(java.lang.String format,
java.lang.String[] suffixes)
Constructs a format reader with the given name and default suffixes.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGlobalMeta(java.lang.String key,
boolean value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
byte value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
char value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
double value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
float value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
int value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
long value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
java.lang.Object value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMeta(java.lang.String key,
short value)
Adds an entry to the global metadata table.
|
protected void |
addGlobalMetaList(java.lang.String key,
java.lang.Object value)
Add the given key/value pair to the global metadata hashtable.
|
protected void |
addMeta(java.lang.String key,
java.lang.Object value,
java.util.Hashtable<java.lang.String,java.lang.Object> meta)
Adds an entry to the specified Hashtable.
|
protected void |
addMetaList(java.lang.String key,
java.lang.Object value,
java.util.Hashtable<java.lang.String,java.lang.Object> meta)
Add the given key/value pair to the given hashtable.
|
protected void |
addSeriesMeta(java.lang.String key,
boolean value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
byte value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
char value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
double value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
float value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
int value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
long value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
java.lang.Object value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMeta(java.lang.String key,
short value)
Adds an entry to the metadata table for the current series.
|
protected void |
addSeriesMetaList(java.lang.String key,
java.lang.Object value)
Add the given key/value pair to the current series metadata hashtable.
|
void |
close() |
void |
close(boolean fileOnly)
Closes the currently open file.
|
int |
coreIndexToSeries(int index)
Returns the series corresponding to the specified core index.
|
int |
fileGroupOption(java.lang.String id)
Returns an indication of whether the files in a multi-file dataset can
be handled individually.
|
protected void |
flattenHashtables()
Call
updateMetadataLists(Hashtable) on
all metadata hashtables. |
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.
|
protected ome.xml.model.enums.AcquisitionMode |
getAcquisitionMode(java.lang.String value)
Deprecated.
|
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.
|
protected ome.xml.model.enums.ArcType |
getArcType(java.lang.String value)
Deprecated.
|
protected java.util.ArrayList<java.lang.String> |
getAvailableOptions()
Returns the list of available metadata options.
|
protected ome.xml.model.enums.Binning |
getBinning(java.lang.String value)
Deprecated.
|
int |
getBitsPerPixel()
Gets the number of valid bits per pixel.
|
protected ome.xml.model.enums.Compression |
getCompression(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.ContrastMethod |
getContrastMethod(java.lang.String value)
Deprecated.
|
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.
|
protected ome.xml.model.enums.Correction |
getCorrection(java.lang.String value)
Deprecated.
|
protected CoreMetadata |
getCurrentCore()
Get the CoreMetadata corresponding to the current series and resolution
|
java.lang.String |
getCurrentFile()
Returns the current file.
|
java.lang.String |
getDatasetStructureDescription()
Returns a short description of the dataset structure.
|
protected ome.xml.model.enums.DetectorType |
getDetectorType(java.lang.String value)
Deprecated.
|
java.lang.String |
getDimensionOrder()
Gets a five-character string representing the
dimension order in which planes will be returned.
|
protected ome.xml.model.enums.DimensionOrder |
getDimensionOrder(java.lang.String value)
Deprecated.
|
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().
|
protected ome.xml.model.enums.ExperimentType |
getExperimentType(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.FilamentType |
getFilamentType(java.lang.String value)
Deprecated.
|
java.lang.Byte |
getFillColor()
Return the fill value for undefined pixels.
|
protected ome.xml.model.enums.FillRule |
getFillRule(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.FilterType |
getFilterType(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.FontFamily |
getFontFamily(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.FontStyle |
getFontStyle(java.lang.String value)
Deprecated.
|
protected java.lang.Object |
getGlobalMeta(java.lang.String key)
Gets a value from the global metadata table.
|
java.util.Hashtable<java.lang.String,java.lang.Object> |
getGlobalMetadata()
Obtains the hashtable containing the metadata field/value pairs from
the current file.
|
protected ome.xml.model.enums.IlluminationType |
getIlluminationType(java.lang.String value)
Deprecated.
|
int |
getImageCount()
Determines the number of image planes in the current file.
|
protected ome.xml.model.enums.Immersion |
getImmersion(java.lang.String value)
Deprecated.
|
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).
|
protected ome.xml.model.enums.LaserMedium |
getLaserMedium(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.LaserType |
getLaserType(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.Marker |
getMarker(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.Medium |
getMedium(java.lang.String value)
Deprecated.
|
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.
|
protected ome.xml.model.enums.MicrobeamManipulationType |
getMicrobeamManipulationType(java.lang.String value)
Deprecated.
|
protected ome.xml.model.enums.MicroscopeType |
getMicroscopeType(java.lang.String value)
Deprecated.
|
Modulo |
getModuloC() |
Modulo |
getModuloT() |
Modulo |
getModuloZ() |
protected ome.xml.model.enums.NamingConvention |
getNamingConvention(java.lang.String value)
Deprecated.
|
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.
|
protected ome.xml.model.enums.PixelType |
getPixelType(java.lang.String value)
Deprecated.
|
java.lang.String[] |
getPossibleDomains(java.lang.String id)
Returns a list of scientific domains in which this format is used.
|
protected ome.xml.model.enums.Pulse |
getPulse(java.lang.String value)
Deprecated.
|
int |
getRequiredDirectories(java.lang.String[] files)
Returns the number of parent directories that are important when
processing the given list of files.
|
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.
|
protected ome.xml.model.AffineTransform |
getRotationTransform(double theta)
Construct an
AffineTransform corresponding to
the given angle. |
int |
getSeries()
Gets the currently active series.
|
int |
getSeriesCount()
Gets the number of series in this file.
|
protected java.lang.Object |
getSeriesMeta(java.lang.String key)
Gets an entry from the metadata table for the current series.
|
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.
|
int |
getTileColumns(int no)
Get the number of columns of tiles in the specified plane in the current series.
|
int |
getTileRows(int no)
Get the number of rows of tiles in the specified plane in the current series.
|
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.
|
protected void |
initFile(java.lang.String id)
Initializes the given file (parsing header information, etc.).
|
boolean |
isFalseColor()
Returns false if
IFormatReader.isIndexed() is false, or if IFormatReader.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.
|
private boolean |
isOmero(java.lang.String id) |
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
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 |
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)
Checks if a file matches the type of this format handler.
|
boolean |
isThisType(java.lang.String name,
boolean open)
Checks if a file matches the type of this format reader.
|
boolean |
isThumbnailSeries()
Gets whether the current series is a lower resolution copy of a different
series.
|
protected boolean |
isUsedFile(java.lang.String file)
Returns true if the given file name is in the used files list.
|
protected MetadataStore |
makeFilterMetadata()
Return a properly configured loci.formats.meta.FilterMetadata.
|
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).
|
abstract 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.
|
protected byte[] |
readPlane(loci.common.RandomAccessInputStream s,
int x,
int y,
int w,
int h,
byte[] buf)
Reads a raw plane from disk.
|
protected byte[] |
readPlane(loci.common.RandomAccessInputStream s,
int x,
int y,
int w,
int h,
int scanlinePad,
byte[] buf)
Reads a raw plane from disk.
|
protected byte[] |
readPlane(loci.common.RandomAccessInputStream s,
int x,
int y,
int w,
int h,
int scanlinePad,
int imageWidth,
int imageHeight,
byte[] buf) |
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 |
setFillColor(java.lang.Byte color)
Set the fill value for undefined pixels.
|
void |
setFlattenedResolutions(boolean flattened)
Set whether or not to flatten resolutions into individual series.
|
void |
setGroupFiles(boolean groupFiles)
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 |
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 |
setResolution(int no)
Set the resolution level.
|
void |
setSeries(int no)
Activates the specified series.
|
private void |
setupService()
Initialize the OMEXMLService needed by
setId(String) |
protected void |
updateMetadataLists(java.util.Hashtable<java.lang.String,java.lang.Object> meta)
For the given metadata hashtable, replace any value that is
a list with one key/value pair per list entry.
|
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormat, getNativeDataType, getSuffixesgetMetadataOptions, getSupportedMetadataLevels, setMetadataOptionsgetTileCodec, getTileCodecOptions, openCompressedBytes, openCompressedBytesprotected static final int THUMBNAIL_DIMENSION
protected transient loci.common.RandomAccessInputStream in
protected java.util.Hashtable<java.lang.String,java.lang.Object> metadata
protected int coreIndex
protected int series
protected java.util.List<CoreMetadata> core
protected int resolution
protected boolean flattenedResolutions
protected boolean suffixNecessary
protected boolean suffixSufficient
protected boolean hasCompanionFiles
protected java.lang.String datasetDescription
protected boolean normalizeData
protected boolean filterMetadata
protected boolean saveOriginalMetadata
protected boolean indexedAsRGB
protected boolean group
protected java.lang.Byte fillColor
protected java.lang.String[] domains
protected MetadataStore metadataStore
getMetadataStore() prevent "null" access.private loci.common.services.ServiceFactory factory
private OMEXMLService service
public FormatReader(java.lang.String format,
java.lang.String suffix)
public FormatReader(java.lang.String format,
java.lang.String[] suffixes)
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 IFormatReaderjava.io.IOExceptionprotected void initFile(java.lang.String id)
throws FormatException,
java.io.IOException
FormatException - if a parsing error occurs processing the file.java.io.IOException - if an I/O error occurs processing the fileprotected java.util.ArrayList<java.lang.String> getAvailableOptions()
protected boolean isUsedFile(java.lang.String file)
protected void addMeta(java.lang.String key,
java.lang.Object value,
java.util.Hashtable<java.lang.String,java.lang.Object> meta)
protected void addGlobalMeta(java.lang.String key,
java.lang.Object value)
protected void addGlobalMeta(java.lang.String key,
boolean value)
protected void addGlobalMeta(java.lang.String key,
byte value)
protected void addGlobalMeta(java.lang.String key,
short value)
protected void addGlobalMeta(java.lang.String key,
int value)
protected void addGlobalMeta(java.lang.String key,
long value)
protected void addGlobalMeta(java.lang.String key,
float value)
protected void addGlobalMeta(java.lang.String key,
double value)
protected void addGlobalMeta(java.lang.String key,
char value)
protected java.lang.Object getGlobalMeta(java.lang.String key)
protected void addMetaList(java.lang.String key,
java.lang.Object value,
java.util.Hashtable<java.lang.String,java.lang.Object> meta)
key - the key to store in the hashtablevalue - the value to store in the hashtable or listmeta - the hashtable in which to store the key/valueprotected void addGlobalMetaList(java.lang.String key,
java.lang.Object value)
key - the key to store in the hashtablevalue - the value to store in the hashtable or listprotected void addSeriesMetaList(java.lang.String key,
java.lang.Object value)
protected void flattenHashtables()
updateMetadataLists(Hashtable) on
all metadata hashtables.protected void updateMetadataLists(java.util.Hashtable<java.lang.String,java.lang.Object> meta)
meta - the hashtable from which to remove listsprotected void addSeriesMeta(java.lang.String key,
java.lang.Object value)
protected void addSeriesMeta(java.lang.String key,
boolean value)
protected void addSeriesMeta(java.lang.String key,
byte value)
protected void addSeriesMeta(java.lang.String key,
short value)
protected void addSeriesMeta(java.lang.String key,
int value)
protected void addSeriesMeta(java.lang.String key,
long value)
protected void addSeriesMeta(java.lang.String key,
float value)
protected void addSeriesMeta(java.lang.String key,
double value)
protected void addSeriesMeta(java.lang.String key,
char value)
protected java.lang.Object getSeriesMeta(java.lang.String key)
protected byte[] readPlane(loci.common.RandomAccessInputStream s,
int x,
int y,
int w,
int h,
byte[] buf)
throws java.io.IOException
java.io.IOExceptionprotected byte[] readPlane(loci.common.RandomAccessInputStream s,
int x,
int y,
int w,
int h,
int scanlinePad,
byte[] buf)
throws java.io.IOException
java.io.IOExceptionprotected byte[] readPlane(loci.common.RandomAccessInputStream s,
int x,
int y,
int w,
int h,
int scanlinePad,
int imageWidth,
int imageHeight,
byte[] buf)
throws java.io.IOException
java.io.IOExceptionprotected MetadataStore makeFilterMetadata()
public boolean isThisType(java.lang.String name,
boolean open)
isThisType(RandomAccessInputStream).isThisType in interface IFormatReaderopen - If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.public boolean isThisType(byte[] block)
IFormatReaderisThisType in interface IFormatReaderIFormatReader.isThisType(RandomAccessInputStream)public boolean isThisType(loci.common.RandomAccessInputStream stream)
throws java.io.IOException
IFormatReaderisThisType in interface IFormatReaderstream - 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 int getImageCount()
IFormatReadergetImageCount in interface IFormatReaderpublic 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 IFormatReaderpublic int getSizeX()
IFormatReadergetSizeX in interface IFormatReaderpublic int getSizeY()
IFormatReadergetSizeY in interface IFormatReaderpublic int getSizeZ()
IFormatReadergetSizeZ in interface IFormatReaderpublic int getSizeC()
IFormatReadergetSizeC in interface IFormatReaderpublic int getSizeT()
IFormatReadergetSizeT in interface IFormatReaderpublic int getPixelType()
IFormatReadergetPixelType in interface IFormatReaderFormatTools
static pixel types such as FormatTools.INT8.public int getBitsPerPixel()
IFormatReaderIFormatReader.getPixelType().getBitsPerPixel in interface IFormatReaderpublic int getEffectiveSizeC()
IFormatReadergetEffectiveSizeC in interface IFormatReaderpublic int getRGBChannelCount()
IFormatReadergetRGBChannelCount in interface IFormatReaderpublic boolean isIndexed()
IFormatReaderIFormatReader.getSizeC(),
IFormatReader.getEffectiveSizeC() or IFormatReader.getRGBChannelCount().isIndexed in interface IFormatReaderpublic 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 IFormatReaderpublic 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 IFormatReaderFormatExceptionjava.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 IFormatReaderFormatExceptionjava.io.IOExceptionpublic Modulo getModuloZ()
getModuloZ in interface IFormatReaderpublic Modulo getModuloC()
getModuloC in interface IFormatReaderpublic Modulo getModuloT()
getModuloT in interface IFormatReaderpublic int getThumbSizeX()
IFormatReadergetThumbSizeX in interface IFormatReaderpublic int getThumbSizeY()
IFormatReadergetThumbSizeY in interface IFormatReaderpublic boolean isLittleEndian()
IFormatReaderisLittleEndian in interface IFormatReaderpublic java.lang.String getDimensionOrder()
IFormatReaderIFormatReader.isInterleaved() method will return true.getDimensionOrder in interface IFormatReaderpublic boolean isOrderCertain()
IFormatReaderisOrderCertain in interface IFormatReaderpublic boolean isThumbnailSeries()
IFormatReaderisThumbnailSeries in interface IFormatReaderpublic 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 IFormatReaderpublic boolean isInterleaved(int subC)
IFormatReaderSDTReader handles spectral-lifetime data with
interleaved lifetime bins and non-interleaved spectral channels.isInterleaved in interface IFormatReaderpublic byte[] openBytes(int no)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderFormatExceptionjava.io.IOExceptionIFormatReader.openBytes(int, byte[])public byte[] openBytes(int no,
byte[] buf)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderno - 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,
int x,
int y,
int w,
int h)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderFormatExceptionjava.io.IOExceptionpublic abstract byte[] openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderno - 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 IFormatReaderFormatExceptionjava.io.IOExceptionFormatReader,
BufferedImageReaderpublic byte[] openThumbBytes(int no)
throws FormatException,
java.io.IOException
IFormatReaderopenThumbBytes in interface IFormatReaderFormatExceptionjava.io.IOExceptionpublic void close(boolean fileOnly)
throws java.io.IOException
IFormatReaderCloseable.close().close in interface IFormatReaderjava.io.IOExceptionpublic int getSeriesCount()
IFormatReadergetSeriesCount in interface IFormatReaderpublic void setSeries(int no)
IFormatReadersetSeries in interface IFormatReaderpublic int getSeries()
IFormatReadergetSeries in interface IFormatReaderpublic void setGroupFiles(boolean groupFiles)
IFormatReadersetGroupFiles in interface IFormatReaderIFormatReader.fileGroupOption(String),
IFormatReader.isGroupFiles()public boolean isGroupFiles()
IFormatReaderisGroupFiles in interface IFormatReaderIFormatReader.setGroupFiles(boolean),
IFormatReader.fileGroupOption(String)public int fileGroupOption(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReaderfileGroupOption in interface IFormatReaderid - 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 IFormatReader.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).FormatExceptionjava.io.IOExceptionFormatTools.MUST_GROUP,
FormatTools.CAN_GROUP,
FormatTools.CANNOT_GROUPpublic void setFillColor(java.lang.Byte color)
IFormatReadersetFillColor in interface IFormatReadercolor - value that will be used to fill pixel byte arrayspublic java.lang.Byte getFillColor()
IFormatReadergetFillColor in interface IFormatReaderIf a fill color was not defined by the reader or
{@link #setFillColor(Byte)}, then 0 is returned.public boolean isMetadataComplete()
IFormatReaderisMetadataComplete in interface IFormatReaderpublic void setNormalized(boolean normalize)
IFormatReadersetNormalized in interface IFormatReaderpublic boolean isNormalized()
IFormatReaderisNormalized in interface IFormatReaderpublic void setOriginalMetadataPopulated(boolean populate)
IFormatReadersetOriginalMetadataPopulated in interface IFormatReaderpublic boolean isOriginalMetadataPopulated()
IFormatReaderisOriginalMetadataPopulated in interface IFormatReaderpublic java.lang.String[] getUsedFiles()
IFormatReaderIFormatHandler.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.getUsedFiles in interface IFormatReaderpublic 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 IFormatReaderpublic java.lang.String[] getSeriesUsedFiles()
IFormatReaderIFormatHandler.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.getSeriesUsedFiles in interface IFormatReaderpublic 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 IFormatReaderpublic FileInfo[] getAdvancedUsedFiles(boolean noPixels)
IFormatReadergetAdvancedUsedFiles in interface IFormatReaderpublic FileInfo[] getAdvancedSeriesUsedFiles(boolean noPixels)
IFormatReadergetAdvancedSeriesUsedFiles in interface IFormatReaderpublic java.lang.String getCurrentFile()
IFormatReadergetCurrentFile in interface IFormatReaderpublic int getIndex(int z,
int c,
int t)
IFormatReadergetIndex in interface IFormatReaderpublic int getIndex(int z,
int c,
int t,
int moduloZ,
int moduloC,
int moduloT)
IFormatReadergetIndex in interface IFormatReaderpublic int[] getZCTCoords(int index)
IFormatReadergetZCTCoords in interface IFormatReaderpublic int[] getZCTModuloCoords(int index)
IFormatReadergetZCTModuloCoords in interface IFormatReaderpublic java.lang.Object getMetadataValue(java.lang.String field)
IFormatReadergetMetadataValue in interface IFormatReaderfield - the name associated with the metadata fieldpublic java.lang.Object getSeriesMetadataValue(java.lang.String field)
IFormatReadergetSeriesMetadataValue in interface IFormatReaderfield - the name associated with the metadata fieldpublic java.util.Hashtable<java.lang.String,java.lang.Object> getGlobalMetadata()
IFormatReadergetGlobalMetadata in interface IFormatReaderpublic java.util.Hashtable<java.lang.String,java.lang.Object> getSeriesMetadata()
IFormatReadergetSeriesMetadata in interface IFormatReaderpublic java.util.List<CoreMetadata> getCoreMetadataList()
IFormatReadergetCoreMetadataList in interface IFormatReaderpublic void setMetadataFiltered(boolean filter)
IFormatReadersetMetadataFiltered in interface IFormatReaderpublic boolean isMetadataFiltered()
IFormatReaderisMetadataFiltered in interface IFormatReaderpublic void setMetadataStore(MetadataStore store)
IFormatReadersetMetadataStore in interface IFormatReaderstore - a metadata store implementation.public MetadataStore getMetadataStore()
IFormatReadernull
metadata store.getMetadataStore in interface IFormatReaderpublic java.lang.Object getMetadataStoreRoot()
IFormatReadergetMetadataStoreRoot in interface IFormatReaderpublic IFormatReader[] getUnderlyingReaders()
IFormatReadergetUnderlyingReaders in interface IFormatReaderpublic boolean isSingleFile(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReaderisSingleFile in interface IFormatReaderFormatExceptionjava.io.IOExceptionpublic int getRequiredDirectories(java.lang.String[] files)
throws FormatException,
java.io.IOException
IFormatReadergetRequiredDirectories in interface IFormatReaderFormatExceptionjava.io.IOExceptionpublic java.lang.String getDatasetStructureDescription()
IFormatReadergetDatasetStructureDescription in interface IFormatReaderpublic boolean hasCompanionFiles()
IFormatReaderhasCompanionFiles in interface IFormatReaderpublic java.lang.String[] getPossibleDomains(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReadergetPossibleDomains in interface IFormatReaderFormatExceptionjava.io.IOExceptionpublic java.lang.String[] getDomains()
IFormatReadergetDomains in interface IFormatReaderpublic int getOptimalTileWidth()
IFormatReadergetOptimalTileWidth in interface IFormatReaderpublic int getOptimalTileHeight()
IFormatReadergetOptimalTileHeight in interface IFormatReaderpublic int getTileRows(int no)
ICompressedTileReadergetTileRows in interface ICompressedTileReaderno - plane indexpublic int getTileColumns(int no)
ICompressedTileReadergetTileColumns in interface ICompressedTileReaderno - plane indexpublic int seriesToCoreIndex(int series)
IFormatReaderseriesToCoreIndex in interface IFormatReaderpublic int coreIndexToSeries(int index)
IFormatReadercoreIndexToSeries in interface IFormatReaderpublic int getResolutionCount()
IPyramidHandlergetResolutionCount in interface IPyramidHandlerpublic void setResolution(int no)
IPyramidHandlersetResolution in interface IPyramidHandlerIPyramidHandler.getResolutionCount()public int getResolution()
IPyramidHandlergetResolution in interface IPyramidHandlerIPyramidHandler.getResolutionCount()public boolean hasFlattenedResolutions()
IFormatReaderhasFlattenedResolutions in interface IFormatReaderpublic void setFlattenedResolutions(boolean flattened)
IFormatReadersetFlattenedResolutions in interface IFormatReaderpublic int getCoreIndex()
IFormatReadergetCoreIndex in interface IFormatReaderpublic void setCoreIndex(int no)
IFormatReadersetCoreIndex in interface IFormatReaderpublic boolean isThisType(java.lang.String name)
FormatHandlerisThisType in interface IFormatHandlerisThisType in class FormatHandlerpublic void setId(java.lang.String id)
throws FormatException,
java.io.IOException
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 IFormatHandlerid - a String specifying the path to the fileFormatExceptionjava.io.IOExceptionprivate void setupService()
setId(String)public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionprotected CoreMetadata getCurrentCore()
@Deprecated
protected ome.xml.model.enums.AcquisitionMode getAcquisitionMode(java.lang.String value)
throws FormatException
MetadataTools.getAcquisitionMode(String).AcquisitionMode enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.ArcType getArcType(java.lang.String value)
throws FormatException
MetadataTools.getArcType(String).ArcType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Binning getBinning(java.lang.String value)
throws FormatException
MetadataTools.getBinning(String).Binning enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Compression getCompression(java.lang.String value)
throws FormatException
MetadataTools.getCompression(String).Compression enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.ContrastMethod getContrastMethod(java.lang.String value)
throws FormatException
MetadataTools.getContrastMethod(String).ContrastMethod enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Correction getCorrection(java.lang.String value)
throws FormatException
MetadataTools.getCorrection(String).Correction enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.DetectorType getDetectorType(java.lang.String value)
throws FormatException
MetadataTools.getDetectorType(String).DetectorType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.DimensionOrder getDimensionOrder(java.lang.String value)
throws FormatException
MetadataTools.getDimensionOrder(String).DimensionOrder enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.ExperimentType getExperimentType(java.lang.String value)
throws FormatException
MetadataTools.getExperimentType(String).ExperimentType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.FilamentType getFilamentType(java.lang.String value)
throws FormatException
MetadataTools.getFilamentType(String).FilamentType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.FillRule getFillRule(java.lang.String value)
throws FormatException
MetadataTools.getFillRule(String).FillRule enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.FilterType getFilterType(java.lang.String value)
throws FormatException
MetadataTools.getFilterType(String).FilterType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.FontFamily getFontFamily(java.lang.String value)
throws FormatException
MetadataTools.getFontFamily(String).FontFamily enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.FontStyle getFontStyle(java.lang.String value)
throws FormatException
MetadataTools.getFontStyle(String).FontStyle enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.IlluminationType getIlluminationType(java.lang.String value)
throws FormatException
MetadataTools.getIlluminationType(String).IlluminationType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Immersion getImmersion(java.lang.String value)
throws FormatException
MetadataTools.getImmersion(String).Immersion enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.LaserMedium getLaserMedium(java.lang.String value)
throws FormatException
MetadataTools.getLaserMedium(String).LaserMedium enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.LaserType getLaserType(java.lang.String value)
throws FormatException
MetadataTools.getLaserType(String).LaserType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Marker getMarker(java.lang.String value)
throws FormatException
MetadataTools.getMarker(String).Marker enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Medium getMedium(java.lang.String value)
throws FormatException
MetadataTools.getMedium(String).Medium enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.MicrobeamManipulationType getMicrobeamManipulationType(java.lang.String value)
throws FormatException
MetadataTools.getMicrobeamManipulationType(String).MicrobeamManipulationType
enumeration value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.MicroscopeType getMicroscopeType(java.lang.String value)
throws FormatException
MetadataTools.getMicroscopeType(String).MicroscopeType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.NamingConvention getNamingConvention(java.lang.String value)
throws FormatException
MetadataTools.getNamingConvention(String).NamingConvention enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.PixelType getPixelType(java.lang.String value)
throws FormatException
MetadataTools.getPixelType(String).PixelType enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatException@Deprecated
protected ome.xml.model.enums.Pulse getPulse(java.lang.String value)
throws FormatException
MetadataTools.getPulse(String).Pulse enumeration
value for the given String.ome.xml.model.enums.EnumerationException - if an appropriate
enumeration value is not found.FormatExceptionprotected ome.xml.model.AffineTransform getRotationTransform(double theta)
AffineTransform corresponding to
the given angle.theta - the angle of rotation in radiansprivate boolean isOmero(java.lang.String id)
Copyright © 2025 Open Microscopy Environment