Package loci.formats
Class FileStitcher
java.lang.Object
loci.formats.ReaderWrapper
loci.formats.FileStitcher
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
Logic to stitch together files with similar names.
Assumes that all files have the same characteristics (e.g., dimensions).
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassList<IFormatReader> private ArrayList<CoreMetadata> Core metadata.private intThe number of the current series.private booleanprivate FileStitcher.ExternalSeries[]private booleanprivate int[][]Component lengths for each axis type.private int[][]Component lengths for each axis type.private int[][]Component lengths for each axis type.private static final org.slf4j.Loggerprivate static final intprivate booleanprivate booleanWhether string ids given should be treated as file patterns rather than single file paths.private intThe number of the current series (non flat).private int[]Dimensional axis lengths per file.private int[]Dimensional axis lengths per file.private int[]Dimensional axis lengths per file.private MetadataStoreFields inherited from class loci.formats.ReaderWrapper
readerFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a FileStitcher around a new image reader.FileStitcher(boolean patternIds) Constructs a FileStitcher around a new image reader.Constructs a FileStitcher with the given reader.FileStitcher(IFormatReader r, boolean patternIds) Constructs a FileStitcher with the given reader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()voidclose(boolean fileOnly) Closes the currently open file.protected voidComputes axis length arrays, and total axis lengths.protected int[]computeIndices(int no) Gets the file index, and image index into that file, corresponding to the given global image index.intcoreIndexToSeries(int index) Returns the series corresponding to the specified core index.findPattern(String id) String[]findPatterns(String id) Finds the file pattern for the given ID, based on the state of the file stitcher.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.intgetAdjustedIndex(int no) Gets the local reader index for use with the given image plane.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.Gets the axis guesser object used to guess which dimensional axes are which.int[]Gets the axis type for each dimensional block.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.Gets a five-character string representing the dimension order in which planes will be returned.private intprivate intgetExternalSeries(int currentSeries) Gets the file pattern object used to build the list of files.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.intGets the pixel type.Gets the wrapped reader prototype.getReader(int no) Gets the reader appropriate for use with the given image plane.getReader(int series, int no) Gets the reader that should be used with the given series and image plane.intgetRequiredDirectories(String[] files) Returns the number of parent directories that are important when processing the given list of files.intGet the current resolution level.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.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.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.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.protected voidInitializes the given file or file pattern.protected voidinitReader(int sno, int fno) 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.booleanGets whether the dimension order and sizes are known, or merely guesses.booleanisRGB()Checks if the image planes in the file have more than one channel perIFormatReader.openBytes(int)call.booleanGets whether the current series is a lower resolution copy of a different series.booleanGets whether the reader is using file patterns for IDs.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.voidsetAxisTypes(int[] axes) Sets the axis type for each dimensional block.voidsetCanChangePattern(boolean doChange) voidsetCoreIndex(int no) Set the current resolution/series (ignores subresolutions).voidsetFlattenedResolutions(boolean flatten) 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.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.voidsetReaderClassList(ClassList<IFormatReader> classList) Set the ClassList object to use when constructing any helper readers.voidsetResolution(int no) Set the resolution level.voidsetSeries(int no) Activates the specified series.voidsetUsingPatternIds(boolean patternIds) Sets whether the reader is using file patterns for IDs.Methods inherited from class loci.formats.ReaderWrapper
duplicate, fileGroupOption, getCurrentFile, getDatasetStructureDescription, getDomains, getEffectiveSizeC, getFillColor, getFormat, getGlobalMetadata, getMetadataOptions, getMetadataValue, getModuloC, getModuloT, getModuloZ, getNativeDataType, getOptimalTileHeight, getOptimalTileWidth, getPossibleDomains, getResolutionCount, getRGBChannelCount, getSeriesMetadataValue, getSuffixes, getSupportedMetadataLevels, getTileColumns, getTileRows, hasCompanionFiles, hasFlattenedResolutions, isMetadataComplete, isMetadataFiltered, isNormalized, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, setFillColor, setMetadataFiltered, unwrap, unwrap, unwrap
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_READERS
private static final int MAX_READERS- See Also:
-
patternIds
private boolean patternIdsWhether string ids given should be treated as file patterns rather than single file paths. -
doNotChangePattern
private boolean doNotChangePattern -
sizeZ
private int[] sizeZDimensional axis lengths per file. -
sizeC
private int[] sizeCDimensional axis lengths per file. -
sizeT
private int[] sizeTDimensional axis lengths per file. -
lenZ
private int[][] lenZComponent lengths for each axis type. -
lenC
private int[][] lenCComponent lengths for each axis type. -
lenT
private int[][] lenTComponent lengths for each axis type. -
core
Core metadata. -
coreIndex
private int coreIndexThe number of the current series. -
series
private int seriesThe number of the current series (non flat). -
noStitch
private boolean noStitch -
group
private boolean group -
store
-
externals
-
classList
-
-
Constructor Details
-
FileStitcher
public FileStitcher()Constructs a FileStitcher around a new image reader. -
FileStitcher
public FileStitcher(boolean patternIds) Constructs a FileStitcher around a new image reader.- Parameters:
patternIds- Whether string ids given should be treated as file patterns rather than single file paths.
-
FileStitcher
Constructs a FileStitcher with the given reader.- Parameters:
r- The reader to use for reading stitched files.
-
FileStitcher
Constructs a FileStitcher with the given reader.- Parameters:
r- The reader to use for reading stitched files.patternIds- Whether string ids given should be treated as file patterns rather than single file paths.
-
-
Method Details
-
setReaderClassList
Set the ClassList object to use when constructing any helper readers. -
getReader
Gets the wrapped reader prototype.- Overrides:
getReaderin classReaderWrapper
-
setUsingPatternIds
public void setUsingPatternIds(boolean patternIds) Sets whether the reader is using file patterns for IDs. -
isUsingPatternIds
public boolean isUsingPatternIds()Gets whether the reader is using file patterns for IDs. -
setCanChangePattern
public void setCanChangePattern(boolean doChange) -
canChangePattern
public boolean canChangePattern() -
getReader
Gets the reader appropriate for use with the given image plane.- Throws:
FormatExceptionIOException
-
getReader
Gets the reader that should be used with the given series and image plane. -
getAdjustedIndex
Gets the local reader index for use with the given image plane.- Throws:
FormatExceptionIOException
-
getAxisTypes
public int[] getAxisTypes()Gets the axis type for each dimensional block.- Returns:
- An array containing values from the enumeration:
- AxisGuesser.Z_AXIS: focal planes
- AxisGuesser.T_AXIS: time points
- AxisGuesser.C_AXIS: channels
- AxisGuesser.S_AXIS: series
-
setAxisTypes
Sets the axis type for each dimensional block.- Parameters:
axes- An array containing values from the enumeration:- AxisGuesser.Z_AXIS: focal planes
- AxisGuesser.T_AXIS: time points
- AxisGuesser.C_AXIS: channels
- AxisGuesser.S_AXIS: series
- Throws:
FormatException
-
getFilePattern
Gets the file pattern object used to build the list of files. -
getAxisGuesser
Gets the axis guesser object used to guess which dimensional axes are which. -
findPattern
-
findPatterns
Finds the file pattern for the given ID, based on the state of the file stitcher. Takes both ID map entries and the patternIds flag into account. -
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- Overrides:
getRequiredDirectoriesin classReaderWrapper- Throws:
FormatExceptionIOException
-
getImageCount
public int getImageCount()Description copied from interface:IFormatReaderDetermines the number of image planes in the current file.- Specified by:
getImageCountin interfaceIFormatReader- Overrides:
getImageCountin classReaderWrapper
-
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- Overrides:
isRGBin classReaderWrapper
-
getSizeX
public int getSizeX()Description copied from interface:IFormatReaderGets the size of the X dimension.- Specified by:
getSizeXin interfaceIFormatReader- Overrides:
getSizeXin classReaderWrapper
-
getSizeY
public int getSizeY()Description copied from interface:IFormatReaderGets the size of the Y dimension.- Specified by:
getSizeYin interfaceIFormatReader- Overrides:
getSizeYin classReaderWrapper
-
getSizeZ
public int getSizeZ()Description copied from interface:IFormatReaderGets the size of the Z dimension.- Specified by:
getSizeZin interfaceIFormatReader- Overrides:
getSizeZin classReaderWrapper
-
getSizeC
public int getSizeC()Description copied from interface:IFormatReaderGets the size of the C dimension.- Specified by:
getSizeCin interfaceIFormatReader- Overrides:
getSizeCin classReaderWrapper
-
getSizeT
public int getSizeT()Description copied from interface:IFormatReaderGets the size of the T dimension.- Specified by:
getSizeTin interfaceIFormatReader- Overrides:
getSizeTin classReaderWrapper
-
getPixelType
public int getPixelType()Description copied from interface:IFormatReaderGets the pixel type.- Specified by:
getPixelTypein interfaceIFormatReader- Overrides:
getPixelTypein classReaderWrapper- 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- Overrides:
getBitsPerPixelin classReaderWrapper
-
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- Overrides:
isIndexedin classReaderWrapper
-
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- Overrides:
isFalseColorin classReaderWrapper
-
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- Overrides:
get8BitLookupTablein classReaderWrapper- 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- Overrides:
get16BitLookupTablein classReaderWrapper- Throws:
FormatExceptionIOException
-
getThumbSizeX
public int getThumbSizeX()Description copied from interface:IFormatReaderGet the size of the X dimension for the thumbnail.- Specified by:
getThumbSizeXin interfaceIFormatReader- Overrides:
getThumbSizeXin classReaderWrapper
-
getThumbSizeY
public int getThumbSizeY()Description copied from interface:IFormatReaderGet the size of the Y dimension for the thumbnail.- Specified by:
getThumbSizeYin interfaceIFormatReader- Overrides:
getThumbSizeYin classReaderWrapper
-
isLittleEndian
public boolean isLittleEndian()Description copied from interface:IFormatReaderGets whether the data is in little-endian format.- Specified by:
isLittleEndianin interfaceIFormatReader- Overrides:
isLittleEndianin classReaderWrapper
-
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- Overrides:
getDimensionOrderin classReaderWrapper
-
isOrderCertain
public boolean isOrderCertain()Description copied from interface:IFormatReaderGets whether the dimension order and sizes are known, or merely guesses.- Specified by:
isOrderCertainin interfaceIFormatReader- Overrides:
isOrderCertainin classReaderWrapper
-
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- Overrides:
isThumbnailSeriesin classReaderWrapper
-
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- Overrides:
isInterleavedin classReaderWrapper
-
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- Overrides:
isInterleavedin classReaderWrapper
-
openBytes
Description copied from interface:IFormatReaderObtains the specified image plane from the current file as a byte array.- Specified by:
openBytesin interfaceIFormatReader- Overrides:
openBytesin classReaderWrapper- Throws:
FormatExceptionIOException- See Also:
-
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- Overrides:
openBytesin classReaderWrapper- 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
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- Overrides:
openBytesin classReaderWrapper- Throws:
FormatExceptionIOException
-
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- Overrides:
openBytesin classReaderWrapper- 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- Overrides:
openPlanein classReaderWrapper- 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- Overrides:
openThumbBytesin classReaderWrapper- Throws:
FormatExceptionIOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classReaderWrapper- Throws:
IOException
-
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- Overrides:
closein classReaderWrapper- Throws:
IOException
-
getSeriesCount
public int getSeriesCount()Description copied from interface:IFormatReaderGets the number of series in this file.- Specified by:
getSeriesCountin interfaceIFormatReader- Overrides:
getSeriesCountin classReaderWrapper
-
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- Overrides:
setSeriesin classReaderWrapper
-
getSeries
public int getSeries()Description copied from interface:IFormatReaderGets the currently active series.- Specified by:
getSeriesin interfaceIFormatReader- Overrides:
getSeriesin classReaderWrapper
-
setResolution
public void setResolution(int no) Description copied from interface:IPyramidHandlerSet the resolution level.- Specified by:
setResolutionin interfaceIPyramidHandler- Overrides:
setResolutionin classReaderWrapper- See Also:
-
getResolution
public int getResolution()Description copied from interface:IPyramidHandlerGet the current resolution level.- Specified by:
getResolutionin interfaceIPyramidHandler- Overrides:
getResolutionin classReaderWrapper- See Also:
-
seriesToCoreIndex
public int seriesToCoreIndex(int series) Description copied from interface:IFormatReaderReturns the first core index corresponding to the specified series.- Specified by:
seriesToCoreIndexin interfaceIFormatReader- Overrides:
seriesToCoreIndexin classReaderWrapper
-
coreIndexToSeries
public int coreIndexToSeries(int index) Description copied from interface:IFormatReaderReturns the series corresponding to the specified core index.- Specified by:
coreIndexToSeriesin interfaceIFormatReader- Overrides:
coreIndexToSeriesin classReaderWrapper
-
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- Overrides:
setCoreIndexin classReaderWrapper
-
getCoreIndex
public int getCoreIndex()Description copied from interface:IFormatReaderReturn the index into CoreMetadata of the current resolution/series.- Specified by:
getCoreIndexin interfaceIFormatReader- Overrides:
getCoreIndexin classReaderWrapper
-
setFlattenedResolutions
public void setFlattenedResolutions(boolean flatten) Description copied from interface:IFormatReaderSet whether or not to flatten resolutions into individual series.- Specified by:
setFlattenedResolutionsin interfaceIFormatReader- Overrides:
setFlattenedResolutionsin classReaderWrapper
-
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- Overrides:
setGroupFilesin classReaderWrapper- 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- Overrides:
isGroupFilesin classReaderWrapper- See Also:
-
setMetadataOptions
- Specified by:
setMetadataOptionsin interfaceIMetadataConfigurable- Overrides:
setMetadataOptionsin classReaderWrapper
-
setNormalized
public void setNormalized(boolean normalize) Description copied from interface:IFormatReaderSpecifies whether or not to normalize float data.- Specified by:
setNormalizedin interfaceIFormatReader- Overrides:
setNormalizedin classReaderWrapper
-
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- Overrides:
setOriginalMetadataPopulatedin classReaderWrapper
-
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- Overrides:
getUsedFilesin classReaderWrapper
-
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- Overrides:
getUsedFilesin classReaderWrapper
-
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- Overrides:
getSeriesUsedFilesin classReaderWrapper
-
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- Overrides:
getSeriesUsedFilesin classReaderWrapper
-
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- Overrides:
getAdvancedUsedFilesin classReaderWrapper
-
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- Overrides:
getAdvancedSeriesUsedFilesin classReaderWrapper
-
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- Overrides:
getIndexin classReaderWrapper
-
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- Overrides:
getIndexin classReaderWrapper
-
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- Overrides:
getZCTCoordsin classReaderWrapper
-
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- Overrides:
getZCTModuloCoordsin classReaderWrapper
-
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- Overrides:
getSeriesMetadatain classReaderWrapper
-
getCoreMetadataList
Description copied from interface:IFormatReaderObtains the core metadata values for the current file.- Specified by:
getCoreMetadataListin interfaceIFormatReader- Overrides:
getCoreMetadataListin classReaderWrapper
-
setMetadataStore
Description copied from interface:IFormatReaderSets the default metadata store for this reader.- Specified by:
setMetadataStorein interfaceIFormatReader- Overrides:
setMetadataStorein classReaderWrapper- 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- Overrides:
getMetadataStorein classReaderWrapper- 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- Overrides:
getMetadataStoreRootin classReaderWrapper- 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- Overrides:
getUnderlyingReadersin classReaderWrapper
-
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- Overrides:
reopenFilein classReaderWrapper- Throws:
IOException
-
setId
Description copied from interface:IFormatHandlerSets the current file name.- Specified by:
setIdin interfaceIFormatHandler- Overrides:
setIdin classReaderWrapper- Throws:
FormatExceptionIOException
-
openCompressedBytes
Description copied from interface:ICompressedTileReaderRetrieve the specified tile without performing any decompression.- Specified by:
openCompressedBytesin interfaceICompressedTileReader- Overrides:
openCompressedBytesin classReaderWrapper- 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- Overrides:
openCompressedBytesin classReaderWrapper- 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- Overrides:
getTileCodecin classReaderWrapper- 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- Overrides:
getTileCodecOptionsin classReaderWrapper- 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:
-
initFile
Initializes the given file or file pattern.- Throws:
FormatExceptionIOException
-
getExternalSeries
private int getExternalSeries() -
getExternalSeries
private int getExternalSeries(int currentSeries) -
computeAxisLengths
Computes axis length arrays, and total axis lengths.- Throws:
FormatException
-
computeIndices
Gets the file index, and image index into that file, corresponding to the given global image index.- Returns:
- An array of size 2, dimensioned {file index, image index}.
- Throws:
FormatExceptionIOException
-
initReader
protected void initReader(int sno, int fno)
-