Package loci.formats
Class ReaderWrapper
java.lang.Object
loci.formats.ReaderWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
- Direct Known Subclasses:
BufferedImageReader,ChannelFiller,ChannelMerger,ChannelSeparator,DimensionSwapper,FileStitcher,ImageProcessorReader,Memoizer,MinMaxCalculator,TileStitcher,VirtualReader
Abstract superclass of reader logic that wraps other readers.
All methods are simply delegated to the wrapped reader.
-
Field Summary
FieldsFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a reader wrapper around a new image reader.Constructs a reader wrapper around the given reader. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidclose(boolean fileOnly) Closes the currently open file.intcoreIndexToSeries(int index) Returns the series corresponding to the specified core index.duplicate(Class<? extends IFormatReader> imageReaderClass) Performs a deep copy of the reader, including nested wrapped readers.private ReaderWrapperduplicateRecurse(Class<? extends IFormatReader> imageReaderClass) intReturns an indication of whether the files in a multi-file dataset can be handled individually.short[][]Gets the 16-bit color lookup table associated with the most recently opened image.byte[][]Gets the 8-bit color lookup table associated with the most recently opened image.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.intGets the number of valid bits per pixel.intReturn the index into CoreMetadata of the current resolution/series.Obtains the core metadata values for the current file.Returns the current file.Returns a short description of the dataset structure.Gets a five-character string representing the dimension order in which planes will be returned.String[]Returns the list of domains represented by the current file.intGets the effective size of the C dimension, guaranteeing that getEffectiveSizeC() * getSizeZ() * getSizeT() == getImageCount() regardless of the result of isRGB().Return the fill value for undefined pixels.Gets the name of this file format.Obtains the hashtable containing the metadata field/value pairs from the current file.intDetermines the number of image planes in the current file.intgetIndex(int z, int c, int t) Gets the rasterized index corresponding to the given Z, C and T coordinates (real sizes).intgetIndex(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).Retrieves the current metadata store for this reader.Retrieves the current metadata store's root object.getMetadataValue(String field) Obtains the specified metadata field's value for the current file.Class<?> Returns the native data type of image planes for this reader, as returned byIFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.savePlane(int, java.lang.Object).intReturns the optimal sub-image height for use with openBytes.intReturns the optimal sub-image width for use with openBytes.intGets the pixel type.String[]Returns a list of scientific domains in which this format is used.Gets the wrapped reader.intgetRequiredDirectories(String[] files) Returns the number of parent directories that are important when processing the given list of files.intGet the current resolution level.intReturn the number of resolutions for the current series.intGets the number of channels returned with each call to openBytes.intGets the currently active series.intGets the number of series in this file.Obtains the hashtable containing metadata field/value pairs from the current series in the current file.getSeriesMetadataValue(String field) Obtains the specified metadata field's value for the current series in the current file.String[]Returns an array of filenames needed to open the current series.String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.intgetSizeC()Gets the size of the C dimension.intgetSizeT()Gets the size of the T dimension.intgetSizeX()Gets the size of the X dimension.intgetSizeY()Gets the size of the Y dimension.intgetSizeZ()Gets the size of the Z dimension.String[]Gets the default file suffixes for this file format.intGet the size of the X dimension for the thumbnail.intGet the size of the Y dimension for the thumbnail.getTileCodec(int no) Retrieve a codec that can be used to decompress compressed tiles.getTileCodecOptions(int no, int x, int y) Retrieve codec options that can be used to decompressed the specified tile.intgetTileColumns(int no) Get the number of columns of tiles in the specified plane in the current series.intgetTileRows(int no) Get the number of rows of tiles in the specified plane in the current series.Retrieves all underlying readers.String[]Returns an array of filenames needed to open this dataset.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.booleanReturns true if this format supports multi-file datasets.booleanReturn whether or not resolution flattening is enabled.booleanReturns false ifIFormatReader.isIndexed()is false, or ifIFormatReader.isIndexed()is true and the lookup table represents "real" color data.booleanReturns true if we should group files in multi-file formats.booleanGets whether the image planes are indexed color.booleanGets whether or not the channels are interleaved.booleanisInterleaved(int subC) Gets whether or not the given sub-channel is interleaved.booleanGets whether the data is in little-endian format.booleanReturns true if this format's metadata is completely parsed.booleanReturns true if ugly metadata (entries with unprintable characters, and extremely large entries) are discarded from the metadata table.booleanReturns true if we should normalize float data.booleanGets whether the dimension order and sizes are known, or merely guesses.booleanReturns true if we should save proprietary metadata in the MetadataStore.booleanisRGB()Checks if the image planes in the file have more than one channel perIFormatReader.openBytes(int)call.booleanisSingleFile(String id) Returns true if the named file is expected to be the only file in the dataset.booleanisThisType(byte[] block) Checks if the given block is a valid header for this file format.booleanisThisType(String name) Checks if the given string is a valid filename for this file format.booleanisThisType(String name, boolean open) Checks if the given file is a valid instance of this file format.booleanisThisType(loci.common.RandomAccessInputStream stream) Checks if the given stream is a valid stream for this file format.booleanGets 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).byte[]openCompressedBytes(int no, byte[] buf, int x, int y) Retrieve the specified tile without performing any decompression.byte[]openCompressedBytes(int no, int x, int y) Retrieve the specified tile without performing any decompression.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.voidReopen any files that were closed, and which are expected to be open while the reader is open.intseriesToCoreIndex(int series) Returns the first core index corresponding to the specified series.voidsetCoreIndex(int no) Set the current resolution/series (ignores subresolutions).voidsetFillColor(Byte color) Set the fill value for undefined pixels.voidsetFlattenedResolutions(boolean flattened) Set whether or not to flatten resolutions into individual series.voidsetGroupFiles(boolean group) Specifies whether or not to force grouping in multi-file formats.voidSets the current file name.voidsetMetadataFiltered(boolean filter) Specifies whether ugly metadata (entries with unprintable characters, and extremely large entries) should be discarded from the metadata table.voidsetMetadataOptions(MetadataOptions options) voidsetMetadataStore(MetadataStore store) Sets the default metadata store for this reader.voidsetNormalized(boolean normalize) Specifies whether or not to normalize float data.voidsetOriginalMetadataPopulated(boolean populate) Specifies whether or not to save proprietary metadata in the MetadataStore.voidsetResolution(int no) Set the resolution level.voidsetSeries(int no) Activates the specified series.unwrap()Unwraps nested wrapped readers until the core reader (i.e., not aReaderWrapperorImageReader) is found.unwrap(Class<? extends IFormatReader> readerClass, String id) Unwraps nested wrapped readers until the given reader class is found.Unwraps nested wrapped readers until the core reader (i.e., not aReaderWrapperorImageReader) is found.
-
Field Details
-
reader
FormatReader used to read the file.
-
-
Constructor Details
-
ReaderWrapper
public ReaderWrapper()Constructs a reader wrapper around a new image reader. -
ReaderWrapper
Constructs a reader wrapper around the given reader.
-
-
Method Details
-
getReader
Gets the wrapped reader. -
unwrap
Unwraps nested wrapped readers until the core reader (i.e., not aReaderWrapperorImageReader) is found.- Throws:
FormatExceptionIOException
-
unwrap
Unwraps nested wrapped readers until the core reader (i.e., not aReaderWrapperorImageReader) is found.- Parameters:
id- Id to use as a basis when unwrapping any nestedImageReaders. If null, the current id is used.- Throws:
FormatExceptionIOException
-
unwrap
public IFormatReader unwrap(Class<? extends IFormatReader> readerClass, String id) throws FormatException, IOException Unwraps nested wrapped readers until the given reader class is found.- Parameters:
readerClass- Class of the desired nested reader. If null, the core reader (i.e., deepest wrapped reader) will be returned.id- Id to use as a basis when unwrapping any nestedImageReaders. If null, the current id is used.- Throws:
FormatExceptionIOException
-
duplicate
public ReaderWrapper duplicate(Class<? extends IFormatReader> imageReaderClass) throws FormatException Performs a deep copy of the reader, including nested wrapped readers. Most of the reader state is preserved as well, including:- Parameters:
imageReaderClass- If non-null, anyImageReaders in the reader stack will be replaced with instances of the given class.- Throws:
FormatException- If something goes wrong during the duplication.
-
getSupportedMetadataLevels
- Specified by:
getSupportedMetadataLevelsin interfaceIMetadataConfigurable
-
getMetadataOptions
- Specified by:
getMetadataOptionsin interfaceIMetadataConfigurable
-
setMetadataOptions
- Specified by:
setMetadataOptionsin interfaceIMetadataConfigurable
-
isThisType
Description copied from interface:IFormatReaderChecks if the given file is a valid instance of this file format.- Specified by:
isThisTypein interfaceIFormatReader- Parameters:
open- If true, and the file extension is insufficient to determine the file type, the file may be opened for further analysis, or other relatively expensive file system operations (such as file existence tests and directory listings) may be performed. If false, file system access is not allowed.
-
isThisType
public boolean isThisType(byte[] block) Description copied from interface:IFormatReaderChecks if the given block is a valid header for this file format.- Specified by:
isThisTypein interfaceIFormatReader- See Also:
-
isThisType
Description copied from interface:IFormatReaderChecks if the given stream is a valid stream for this file format. The number of bytes read is format-dependent.- Specified by:
isThisTypein interfaceIFormatReader- Parameters:
stream- A RandomAccessInputStream representing the file to check. The first byte in the stream is assumed to be the first byte in the file.- Returns:
- true if the file represented by the stream can be read by this reader; false otherwise.
- Throws:
IOException
-
getImageCount
public int getImageCount()Description copied from interface:IFormatReaderDetermines the number of image planes in the current file.- Specified by:
getImageCountin interfaceIFormatReader
-
isRGB
public boolean isRGB()Description copied from interface:IFormatReaderChecks if the image planes in the file have more than one channel perIFormatReader.openBytes(int)call. This method returns true if and only ifIFormatReader.getRGBChannelCount()returns a value greater than 1.- Specified by:
isRGBin interfaceIFormatReader
-
getSizeX
public int getSizeX()Description copied from interface:IFormatReaderGets the size of the X dimension.- Specified by:
getSizeXin interfaceIFormatReader
-
getSizeY
public int getSizeY()Description copied from interface:IFormatReaderGets the size of the Y dimension.- Specified by:
getSizeYin interfaceIFormatReader
-
getSizeZ
public int getSizeZ()Description copied from interface:IFormatReaderGets the size of the Z dimension.- Specified by:
getSizeZin interfaceIFormatReader
-
getSizeC
public int getSizeC()Description copied from interface:IFormatReaderGets the size of the C dimension.- Specified by:
getSizeCin interfaceIFormatReader
-
getSizeT
public int getSizeT()Description copied from interface:IFormatReaderGets the size of the T dimension.- Specified by:
getSizeTin interfaceIFormatReader
-
getPixelType
public int getPixelType()Description copied from interface:IFormatReaderGets the pixel type.- Specified by:
getPixelTypein interfaceIFormatReader- Returns:
- the pixel type as an enumeration from
FormatToolsstatic pixel types such asFormatTools.INT8.
-
getBitsPerPixel
public int getBitsPerPixel()Description copied from interface:IFormatReaderGets the number of valid bits per pixel. The number of valid bits per pixel is always less than or equal to the number of bits per pixel that correspond toIFormatReader.getPixelType().- Specified by:
getBitsPerPixelin interfaceIFormatReader
-
getEffectiveSizeC
public int getEffectiveSizeC()Description copied from interface:IFormatReaderGets the effective size of the C dimension, guaranteeing that getEffectiveSizeC() * getSizeZ() * getSizeT() == getImageCount() regardless of the result of isRGB().- Specified by:
getEffectiveSizeCin interfaceIFormatReader
-
getRGBChannelCount
public int getRGBChannelCount()Description copied from interface:IFormatReaderGets the number of channels returned with each call to openBytes. The most common case where this value is greater than 1 is for interleaved RGB data, such as a 24-bit color image plane. However, it is possible for this value to be greater than 1 for non-interleaved data, such as an RGB TIFF with Planar rather than Chunky configuration.- Specified by:
getRGBChannelCountin interfaceIFormatReader
-
isIndexed
public boolean isIndexed()Description copied from interface:IFormatReaderGets whether the image planes are indexed color. This value has no impact onIFormatReader.getSizeC(),IFormatReader.getEffectiveSizeC()orIFormatReader.getRGBChannelCount().- Specified by:
isIndexedin interfaceIFormatReader
-
isFalseColor
public boolean isFalseColor()Description copied from interface:IFormatReaderReturns false ifIFormatReader.isIndexed()is false, or ifIFormatReader.isIndexed()is true and the lookup table represents "real" color data. Returns true ifIFormatReader.isIndexed()is true and the lookup table is only present to aid in visualization.- Specified by:
isFalseColorin interfaceIFormatReader
-
get8BitLookupTable
Description copied from interface:IFormatReaderGets the 8-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or ifIFormatReader.isIndexed()returns false, then this may return null. Also, ifIFormatReader.getPixelType()returns anything other thanFormatTools.INT8orFormatTools.UINT8, this method will return null.- Specified by:
get8BitLookupTablein interfaceIFormatReader- Throws:
FormatExceptionIOException
-
get16BitLookupTable
Description copied from interface:IFormatReaderGets the 16-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or ifIFormatReader.isIndexed()returns false, then this may return null. Also, ifIFormatReader.getPixelType()returns anything other thanFormatTools.INT16orFormatTools.UINT16, this method will return null.- Specified by:
get16BitLookupTablein interfaceIFormatReader- Throws:
FormatExceptionIOException
-
getModuloZ
- Specified by:
getModuloZin interfaceIFormatReader
-
getModuloC
- Specified by:
getModuloCin interfaceIFormatReader
-
getModuloT
- Specified by:
getModuloTin interfaceIFormatReader
-
getThumbSizeX
public int getThumbSizeX()Description copied from interface:IFormatReaderGet the size of the X dimension for the thumbnail.- Specified by:
getThumbSizeXin interfaceIFormatReader
-
getThumbSizeY
public int getThumbSizeY()Description copied from interface:IFormatReaderGet the size of the Y dimension for the thumbnail.- Specified by:
getThumbSizeYin interfaceIFormatReader
-
isLittleEndian
public boolean isLittleEndian()Description copied from interface:IFormatReaderGets whether the data is in little-endian format.- Specified by:
isLittleEndianin interfaceIFormatReader
-
getDimensionOrder
Description copied from interface:IFormatReaderGets a five-character string representing the dimension order in which planes will be returned. Valid orders are:- XYCTZ
- XYCZT
- XYTCZ
- XYTZC
- XYZCT
- XYZTC
IFormatReader.isInterleaved()method will return true.- Specified by:
getDimensionOrderin interfaceIFormatReader
-
isOrderCertain
public boolean isOrderCertain()Description copied from interface:IFormatReaderGets whether the dimension order and sizes are known, or merely guesses.- Specified by:
isOrderCertainin interfaceIFormatReader
-
isThumbnailSeries
public boolean isThumbnailSeries()Description copied from interface:IFormatReaderGets whether the current series is a lower resolution copy of a different series.- Specified by:
isThumbnailSeriesin interfaceIFormatReader
-
isInterleaved
public boolean isInterleaved()Description copied from interface:IFormatReaderGets whether or not the channels are interleaved. This method exists because X and Y must appear first in the dimension order. For interleaved data,IFormatReader.getDimensionOrder()returns XYCTZ or XYCZT, and this method returns true. Note that this flag returns whether or not the data returned byIFormatReader.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.- Specified by:
isInterleavedin interfaceIFormatReader
-
isInterleaved
public boolean isInterleaved(int subC) Description copied from interface:IFormatReaderGets whether or not the given sub-channel is interleaved. This method exists because some data with multiple rasterized sub-dimensions within C have one sub-dimension interleaved, and the other not—e.g.,SDTReaderhandles spectral-lifetime data with interleaved lifetime bins and non-interleaved spectral channels.- Specified by:
isInterleavedin interfaceIFormatReader
-
openBytes
Description copied from interface:IFormatReaderObtains the specified image plane from the current file as a byte array.- Specified by:
openBytesin interfaceIFormatReader- Throws:
FormatExceptionIOException- See Also:
-
openBytes
Description copied from interface:IFormatReaderObtains a sub-image of the specified image plane, whose upper-left corner is given by (x, y).- Specified by:
openBytesin interfaceIFormatReader- Throws:
FormatExceptionIOException
-
openBytes
Description copied from interface:IFormatReaderObtains the specified image plane from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel * RGB channel count).- Specified by:
openBytesin interfaceIFormatReader- Parameters:
no- the plane index within the current series.buf- a pre-allocated buffer.- Returns:
- the pre-allocated buffer
buffor convenience. - Throws:
FormatException- if there was a problem parsing the metadata of the file.IOException- if there was a problem reading the file.
-
openBytes
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException Description copied from interface:IFormatReaderObtains a sub-image of the specified image plane into a pre-allocated byte array.- Specified by:
openBytesin interfaceIFormatReader- Parameters:
no- the plane index within the current series.buf- a pre-allocated buffer.x- X coordinate of the upper-left corner of the sub-imagey- Y coordinate of the upper-left corner of the sub-imagew- width of the sub-imageh- height of the sub-image- Returns:
- the pre-allocated buffer
buffor convenience. - Throws:
FormatException- if there was a problem parsing the metadata of the file.IOException- if there was a problem reading the file.
-
openPlane
Description copied from interface:IFormatReaderObtains the specified image plane (or sub-image thereof) in the reader's native data structure. For most readers this is a byte array; however, some readers call external APIs that work with other types such asBufferedImage. The openPlane method exists to maintain generality and efficiency while avoiding pollution of the API with AWT-specific logic.- Specified by:
openPlanein interfaceIFormatReader- Throws:
FormatExceptionIOException- See Also:
-
openThumbBytes
Description copied from interface:IFormatReaderObtains a thumbnail for the specified image plane from the current file, as a byte array.- Specified by:
openThumbBytesin interfaceIFormatReader- Throws:
FormatExceptionIOException
-
getTileRows
public int getTileRows(int no) Description copied from interface:ICompressedTileReaderGet the number of rows of tiles in the specified plane in the current series.- Specified by:
getTileRowsin interfaceICompressedTileReader- Parameters:
no- plane index- Returns:
- tile row count
-
getTileColumns
public int getTileColumns(int no) Description copied from interface:ICompressedTileReaderGet the number of columns of tiles in the specified plane in the current series.- Specified by:
getTileColumnsin interfaceICompressedTileReader- Parameters:
no- plane index- Returns:
- tile column count
-
openCompressedBytes
Description copied from interface:ICompressedTileReaderRetrieve the specified tile without performing any decompression.- Specified by:
openCompressedBytesin interfaceICompressedTileReader- Parameters:
no- plane indexx- tile X index (indexed from 0, @see getTileColumns(int))y- tile Y index (indexed from 0, @see getTileRows(int))- Returns:
- compressed tile bytes
- Throws:
FormatExceptionIOException
-
openCompressedBytes
public byte[] openCompressedBytes(int no, byte[] buf, int x, int y) throws FormatException, IOException Description copied from interface:ICompressedTileReaderRetrieve the specified tile without performing any decompression.- Specified by:
openCompressedBytesin interfaceICompressedTileReader- Parameters:
no- plane indexbuf- pre-allocated buffer in which to store compressed bytesx- tile X index (indexed from 0, @see getTileColumns(int))y- tile Y index (indexed from 0, @see getTileRows(int))- Returns:
- compressed tile bytes
- Throws:
FormatExceptionIOException
-
getTileCodec
Description copied from interface:ICompressedTileReaderRetrieve a codec that can be used to decompress compressed tiles.- Specified by:
getTileCodecin interfaceICompressedTileReader- Parameters:
no- plane index- Returns:
- codec that can be used for compressed tiles in the specified plane
- Throws:
FormatExceptionIOException- See Also:
-
getTileCodecOptions
Description copied from interface:ICompressedTileReaderRetrieve codec options that can be used to decompressed the specified tile.- Specified by:
getTileCodecOptionsin interfaceICompressedTileReader- Parameters:
no- plane indexx- tile X index (indexed from 0, @see getTileColumns(int))y- tile Y index (indexed from 0, @see getTileRows(int))- Returns:
- codec options
- Throws:
FormatExceptionIOException- See Also:
-
close
Description copied from interface:IFormatReaderCloses the currently open file. If the flag is set, this is all that happens; if unset, it is equivalent to callingCloseable.close().- Specified by:
closein interfaceIFormatReader- Throws:
IOException
-
getSeriesCount
public int getSeriesCount()Description copied from interface:IFormatReaderGets the number of series in this file.- Specified by:
getSeriesCountin interfaceIFormatReader
-
setSeries
public void setSeries(int no) Description copied from interface:IFormatReaderActivates the specified series. This also resets the resolution to 0.- Specified by:
setSeriesin interfaceIFormatReader
-
getSeries
public int getSeries()Description copied from interface:IFormatReaderGets the currently active series.- Specified by:
getSeriesin interfaceIFormatReader
-
setGroupFiles
public void setGroupFiles(boolean group) Description copied from interface:IFormatReaderSpecifies whether or not to force grouping in multi-file formats.- Specified by:
setGroupFilesin interfaceIFormatReader- See Also:
-
isGroupFiles
public boolean isGroupFiles()Description copied from interface:IFormatReaderReturns true if we should group files in multi-file formats.- Specified by:
isGroupFilesin interfaceIFormatReader- See Also:
-
fileGroupOption
Description copied from interface:IFormatReaderReturns an indication of whether the files in a multi-file dataset can be handled individually. This method is only useful for formats and datasets which contain multiple files.- Specified by:
fileGroupOptionin interfaceIFormatReader- Parameters:
id- a file in the multi-file dataset- Returns:
- an int indicating that we cannot, must, or might group the files.
A return value of
FormatTools.MUST_GROUPindicates that the files cannot be handled separately; the reader will always detect and read all files in the dataset.FormatTools.CAN_GROUPindicates that the files may be handled separately, but file grouping must then be disabled viaIFormatReader.setGroupFiles(boolean).FormatTools.CANNOT_GROUPindicates that the files must be handled separately; the reader will not attempt to read all files in the dataset (this is rare). - Throws:
FormatExceptionIOException- See Also:
-
setFillColor
Description copied from interface:IFormatReaderSet the fill value for undefined pixels. This can be used to override the default fill value defined in a reader. The default implementation in IFormatReader is a no-op.- Specified by:
setFillColorin interfaceIFormatReader- Parameters:
color- value that will be used to fill pixel byte arrays
-
getFillColor
Description copied from interface:IFormatReaderReturn the fill value for undefined pixels. The default implementation in IFormatReader always returns 0.- Specified by:
getFillColorin interfaceIFormatReader- See Also:
-
isMetadataComplete
public boolean isMetadataComplete()Description copied from interface:IFormatReaderReturns true if this format's metadata is completely parsed.- Specified by:
isMetadataCompletein interfaceIFormatReader
-
setNormalized
public void setNormalized(boolean normalize) Description copied from interface:IFormatReaderSpecifies whether or not to normalize float data.- Specified by:
setNormalizedin interfaceIFormatReader
-
isNormalized
public boolean isNormalized()Description copied from interface:IFormatReaderReturns true if we should normalize float data.- Specified by:
isNormalizedin interfaceIFormatReader
-
setOriginalMetadataPopulated
public void setOriginalMetadataPopulated(boolean populate) Description copied from interface:IFormatReaderSpecifies whether or not to save proprietary metadata in the MetadataStore.- Specified by:
setOriginalMetadataPopulatedin interfaceIFormatReader
-
isOriginalMetadataPopulated
public boolean isOriginalMetadataPopulated()Description copied from interface:IFormatReaderReturns true if we should save proprietary metadata in the MetadataStore.- Specified by:
isOriginalMetadataPopulatedin interfaceIFormatReader
-
getUsedFiles
Description copied from interface:IFormatReaderReturns an array of filenames needed to open this dataset. The first element in the array is expected to be the path passed toIFormatHandler.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.- Specified by:
getUsedFilesin interfaceIFormatReader
-
getUsedFiles
Description copied from interface:IFormatReaderReturns an array of filenames needed to open this dataset. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned. The first element in the array is expected to be the path passed toIFormatHandler.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.- Specified by:
getUsedFilesin interfaceIFormatReader
-
getSeriesUsedFiles
Description copied from interface:IFormatReaderReturns an array of filenames needed to open the current series. The first element in the array is expected to be the path passed toIFormatHandler.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.- Specified by:
getSeriesUsedFilesin interfaceIFormatReader
-
getSeriesUsedFiles
Description copied from interface:IFormatReaderReturns an array of filenames needed to open the current series. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned. The first element in the array is expected to be the path passed toIFormatHandler.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.- Specified by:
getSeriesUsedFilesin interfaceIFormatReader
-
getAdvancedUsedFiles
Description copied from interface:IFormatReaderReturns an array of FileInfo objects representing the files needed to open this dataset. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned.- Specified by:
getAdvancedUsedFilesin interfaceIFormatReader
-
getAdvancedSeriesUsedFiles
Description copied from interface:IFormatReaderReturns an array of FileInfo objects representing the files needed to open the current series. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned.- Specified by:
getAdvancedSeriesUsedFilesin interfaceIFormatReader
-
getCurrentFile
Description copied from interface:IFormatReaderReturns the current file.- Specified by:
getCurrentFilein interfaceIFormatReader
-
getIndex
public int getIndex(int z, int c, int t) Description copied from interface:IFormatReaderGets the rasterized index corresponding to the given Z, C and T coordinates (real sizes).- Specified by:
getIndexin interfaceIFormatReader
-
getIndex
public int getIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT) Description copied from interface:IFormatReaderGets the rasterized index corresponding to the given Z, C, T, moduloZ, moduloC and moduloT coordinates (effective sizes). Note that the Z, C and T coordinates take the modulo dimension sizes into account. The effective size for each of these dimensions is limited to the total size of the dimension divided by the modulo size.- Specified by:
getIndexin interfaceIFormatReader
-
getZCTCoords
public int[] getZCTCoords(int index) Description copied from interface:IFormatReaderGets the Z, C and T coordinates (real sizes) corresponding to the given rasterized index value.- Specified by:
getZCTCoordsin interfaceIFormatReader
-
getZCTModuloCoords
public int[] getZCTModuloCoords(int index) Description copied from interface:IFormatReaderGets the Z, C, T, moduloZ, moduloC and moduloT coordinates (effective sizes) corresponding to the given rasterized index value. Note that the Z, C and T coordinates are not the same as those returned by getZCTCoords(int) because the size of the modulo dimensions is taken into account. The effective size for each of these dimensions is limited to the total size of the dimension divided by the modulo size.- Specified by:
getZCTModuloCoordsin interfaceIFormatReader
-
getMetadataValue
Description copied from interface:IFormatReaderObtains the specified metadata field's value for the current file.- Specified by:
getMetadataValuein interfaceIFormatReader- Parameters:
field- the name associated with the metadata field- Returns:
- the value, or null if the field doesn't exist
-
getSeriesMetadataValue
Description copied from interface:IFormatReaderObtains the specified metadata field's value for the current series in the current file.- Specified by:
getSeriesMetadataValuein interfaceIFormatReader- Parameters:
field- the name associated with the metadata field- Returns:
- the value, or null if the field doesn't exist
-
getGlobalMetadata
Description copied from interface:IFormatReaderObtains the hashtable containing the metadata field/value pairs from the current file.- Specified by:
getGlobalMetadatain interfaceIFormatReader- Returns:
- the hashtable containing all non-series-specific metadata from the file
-
getSeriesMetadata
Description copied from interface:IFormatReaderObtains the hashtable containing metadata field/value pairs from the current series in the current file.- Specified by:
getSeriesMetadatain interfaceIFormatReader
-
getCoreMetadataList
Description copied from interface:IFormatReaderObtains the core metadata values for the current file.- Specified by:
getCoreMetadataListin interfaceIFormatReader
-
setMetadataFiltered
public void setMetadataFiltered(boolean filter) Description copied from interface:IFormatReaderSpecifies whether ugly metadata (entries with unprintable characters, and extremely large entries) should be discarded from the metadata table.- Specified by:
setMetadataFilteredin interfaceIFormatReader
-
isMetadataFiltered
public boolean isMetadataFiltered()Description copied from interface:IFormatReaderReturns true if ugly metadata (entries with unprintable characters, and extremely large entries) are discarded from the metadata table.- Specified by:
isMetadataFilteredin interfaceIFormatReader
-
setMetadataStore
Description copied from interface:IFormatReaderSets the default metadata store for this reader.- Specified by:
setMetadataStorein interfaceIFormatReader- Parameters:
store- a metadata store implementation.
-
getMetadataStore
Description copied from interface:IFormatReaderRetrieves the current metadata store for this reader. You can be assured that this method will never return anullmetadata store.- Specified by:
getMetadataStorein interfaceIFormatReader- Returns:
- A metadata store implementation.
-
getMetadataStoreRoot
Description copied from interface:IFormatReaderRetrieves the current metadata store's root object. It is guaranteed that all file parsing has been performed by the reader prior to retrieval. Requests for a full populated root object should be made using this method.- Specified by:
getMetadataStoreRootin interfaceIFormatReader- Returns:
- Current metadata store's root object fully populated.
-
getUnderlyingReaders
Description copied from interface:IFormatReaderRetrieves all underlying readers. Returns null if there are no underlying readers.- Specified by:
getUnderlyingReadersin interfaceIFormatReader
-
isSingleFile
Description copied from interface:IFormatReaderReturns true if the named file is expected to be the only file in the dataset. For single-file formats, always returns true.- Specified by:
isSingleFilein interfaceIFormatReader- Throws:
FormatExceptionIOException
-
getRequiredDirectories
Description copied from interface:IFormatReaderReturns the number of parent directories that are important when processing the given list of files. The number of directories is relative to the common parent. For example, given a list with these two files: /path/to/file/foo /path/to/file/that/is/related A return value of 0 indicates that "/path/to/file/" is irrelevant. A return value of 1 indicates that "/path/to/" is irrelevant. Return values less than 0 are invalid. All listed files are assumed to belong to datasets of the same format.- Specified by:
getRequiredDirectoriesin interfaceIFormatReader- Throws:
FormatExceptionIOException
-
getDatasetStructureDescription
Description copied from interface:IFormatReaderReturns a short description of the dataset structure.- Specified by:
getDatasetStructureDescriptionin interfaceIFormatReader
-
hasCompanionFiles
public boolean hasCompanionFiles()Description copied from interface:IFormatReaderReturns true if this format supports multi-file datasets.- Specified by:
hasCompanionFilesin interfaceIFormatReader
-
getPossibleDomains
Description copied from interface:IFormatReaderReturns a list of scientific domains in which this format is used.- Specified by:
getPossibleDomainsin interfaceIFormatReader- Throws:
FormatExceptionIOException
-
getDomains
Description copied from interface:IFormatReaderReturns the list of domains represented by the current file.- Specified by:
getDomainsin interfaceIFormatReader
-
getOptimalTileWidth
public int getOptimalTileWidth()Description copied from interface:IFormatReaderReturns the optimal sub-image width for use with openBytes.- Specified by:
getOptimalTileWidthin interfaceIFormatReader
-
getOptimalTileHeight
public int getOptimalTileHeight()Description copied from interface:IFormatReaderReturns the optimal sub-image height for use with openBytes.- Specified by:
getOptimalTileHeightin interfaceIFormatReader
-
getCoreIndex
public int getCoreIndex()Description copied from interface:IFormatReaderReturn the index into CoreMetadata of the current resolution/series.- Specified by:
getCoreIndexin interfaceIFormatReader
-
setCoreIndex
public void setCoreIndex(int no) Description copied from interface:IFormatReaderSet the current resolution/series (ignores subresolutions). Equivalent to setSeries, but with flattened resolutions always set to false.- Specified by:
setCoreIndexin interfaceIFormatReader
-
seriesToCoreIndex
public int seriesToCoreIndex(int series) Description copied from interface:IFormatReaderReturns the first core index corresponding to the specified series.- Specified by:
seriesToCoreIndexin interfaceIFormatReader
-
coreIndexToSeries
public int coreIndexToSeries(int index) Description copied from interface:IFormatReaderReturns the series corresponding to the specified core index.- Specified by:
coreIndexToSeriesin interfaceIFormatReader
-
getResolutionCount
public int getResolutionCount()Description copied from interface:IPyramidHandlerReturn the number of resolutions for the current series. Resolutions are stored in descending order, so the largest resolution is first and the smallest resolution is last.- Specified by:
getResolutionCountin interfaceIPyramidHandler
-
setResolution
public void setResolution(int no) Description copied from interface:IPyramidHandlerSet the resolution level.- Specified by:
setResolutionin interfaceIPyramidHandler- See Also:
-
getResolution
public int getResolution()Description copied from interface:IPyramidHandlerGet the current resolution level.- Specified by:
getResolutionin interfaceIPyramidHandler- See Also:
-
hasFlattenedResolutions
public boolean hasFlattenedResolutions()Description copied from interface:IFormatReaderReturn whether or not resolution flattening is enabled.- Specified by:
hasFlattenedResolutionsin interfaceIFormatReader
-
setFlattenedResolutions
public void setFlattenedResolutions(boolean flattened) Description copied from interface:IFormatReaderSet whether or not to flatten resolutions into individual series.- Specified by:
setFlattenedResolutionsin interfaceIFormatReader
-
isThisType
Description copied from interface:IFormatHandlerChecks if the given string is a valid filename for this file format.- Specified by:
isThisTypein interfaceIFormatHandler
-
getFormat
Description copied from interface:IFormatHandlerGets the name of this file format.- Specified by:
getFormatin interfaceIFormatHandler
-
getSuffixes
Description copied from interface:IFormatHandlerGets the default file suffixes for this file format.- Specified by:
getSuffixesin interfaceIFormatHandler
-
getNativeDataType
Description copied from interface:IFormatHandlerReturns the native data type of image planes for this reader, as returned byIFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.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 asBufferedImage.- Specified by:
getNativeDataTypein interfaceIFormatHandler
-
setId
Description copied from interface:IFormatHandlerSets the current file name.- Specified by:
setIdin interfaceIFormatHandler- Throws:
FormatExceptionIOException
-
reopenFile
Description copied from interface:IFormatReaderReopen any files that were closed, and which are expected to be open while the reader is open. This assumes thatIFormatHandler.setId(java.lang.String)has been called, but close(false) has not been called.- Specified by:
reopenFilein interfaceIFormatReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
duplicateRecurse
private ReaderWrapper duplicateRecurse(Class<? extends IFormatReader> imageReaderClass) throws FormatException - Throws:
FormatException
-