Package loci.formats
Class FileStitcher
java.lang.Object
loci.formats.ReaderWrapper
loci.formats.FileStitcher
- All Implemented Interfaces:
Closeable,AutoCloseable,loci.formats.ICompressedTileReader,loci.formats.IFormatHandler,loci.formats.IFormatReader,loci.formats.IMetadataConfigurable,loci.formats.IPyramidHandler
Logic to stitch together files with similar names.
Assumes that all files have the same characteristics (e.g., dimensions).
-
Field Summary
Fields 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(loci.formats.IFormatReader r, boolean patternIds) Constructs a FileStitcher with the given reader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()voidclose(boolean fileOnly) 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) findPattern(String id) String[]findPatterns(String id) Finds the file pattern for the given ID, based on the state of the file stitcher.short[][]byte[][]intgetAdjustedIndex(int no) Gets the local reader index for use with the given image plane.getAdvancedSeriesUsedFiles(boolean noPixels) getAdvancedUsedFiles(boolean noPixels) Gets the axis guesser object used to guess which dimensional axes are which.int[]Gets the axis type for each dimensional block.intintGets the file pattern object used to build the list of files.intintgetIndex(int z, int c, int t) intgetIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT) intGets 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) intintintString[]String[]getSeriesUsedFiles(boolean noPixels) intgetSizeC()intgetSizeT()intgetSizeX()intgetSizeY()intgetSizeZ()intintgetTileCodec(int no) getTileCodecOptions(int no, int x, int y) String[]String[]getUsedFiles(boolean noPixels) int[]getZCTCoords(int index) int[]getZCTModuloCoords(int index) protected voidInitializes the given file or file pattern.protected voidinitReader(int sno, int fno) booleanbooleanbooleanbooleanbooleanisInterleaved(int subC) booleanbooleanbooleanisRGB()booleanbooleanGets whether the reader is using file patterns for IDs.byte[]openBytes(int no) byte[]openBytes(int no, byte[] buf) byte[]openBytes(int no, byte[] buf, int x, int y, int w, int h) byte[]openBytes(int no, int x, int y, int w, int h) byte[]openCompressedBytes(int no, byte[] buf, int x, int y) byte[]openCompressedBytes(int no, int x, int y) openPlane(int no, int x, int y, int w, int h) byte[]openThumbBytes(int no) voidintseriesToCoreIndex(int series) voidsetAxisTypes(int[] axes) Sets the axis type for each dimensional block.voidsetCanChangePattern(boolean doChange) voidsetCoreIndex(int no) voidsetFlattenedResolutions(boolean flatten) voidsetGroupFiles(boolean group) voidvoidvoidvoidsetNormalized(boolean normalize) voidsetOriginalMetadataPopulated(boolean populate) voidSet the ClassList object to use when constructing any helper readers.voidsetResolution(int no) voidsetSeries(int no) 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
-
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 classloci.formats.ReaderWrapper
-
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
public loci.formats.IFormatReader getReader(int no) throws loci.formats.FormatException, IOException Gets the reader appropriate for use with the given image plane. -
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. -
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:
loci.formats.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
- Specified by:
getRequiredDirectoriesin interfaceloci.formats.IFormatReader- Overrides:
getRequiredDirectoriesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getImageCount
public int getImageCount()- Specified by:
getImageCountin interfaceloci.formats.IFormatReader- Overrides:
getImageCountin classloci.formats.ReaderWrapper
-
isRGB
public boolean isRGB()- Specified by:
isRGBin interfaceloci.formats.IFormatReader- Overrides:
isRGBin classloci.formats.ReaderWrapper
-
getSizeX
public int getSizeX()- Specified by:
getSizeXin interfaceloci.formats.IFormatReader- Overrides:
getSizeXin classloci.formats.ReaderWrapper
-
getSizeY
public int getSizeY()- Specified by:
getSizeYin interfaceloci.formats.IFormatReader- Overrides:
getSizeYin classloci.formats.ReaderWrapper
-
getSizeZ
public int getSizeZ()- Specified by:
getSizeZin interfaceloci.formats.IFormatReader- Overrides:
getSizeZin classloci.formats.ReaderWrapper
-
getSizeC
public int getSizeC()- Specified by:
getSizeCin interfaceloci.formats.IFormatReader- Overrides:
getSizeCin classloci.formats.ReaderWrapper
-
getSizeT
public int getSizeT()- Specified by:
getSizeTin interfaceloci.formats.IFormatReader- Overrides:
getSizeTin classloci.formats.ReaderWrapper
-
getPixelType
public int getPixelType()- Specified by:
getPixelTypein interfaceloci.formats.IFormatReader- Overrides:
getPixelTypein classloci.formats.ReaderWrapper
-
getBitsPerPixel
public int getBitsPerPixel()- Specified by:
getBitsPerPixelin interfaceloci.formats.IFormatReader- Overrides:
getBitsPerPixelin classloci.formats.ReaderWrapper
-
isIndexed
public boolean isIndexed()- Specified by:
isIndexedin interfaceloci.formats.IFormatReader- Overrides:
isIndexedin classloci.formats.ReaderWrapper
-
isFalseColor
public boolean isFalseColor()- Specified by:
isFalseColorin interfaceloci.formats.IFormatReader- Overrides:
isFalseColorin classloci.formats.ReaderWrapper
-
get8BitLookupTable
- Specified by:
get8BitLookupTablein interfaceloci.formats.IFormatReader- Overrides:
get8BitLookupTablein classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
get16BitLookupTable
- Specified by:
get16BitLookupTablein interfaceloci.formats.IFormatReader- Overrides:
get16BitLookupTablein classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getThumbSizeX
public int getThumbSizeX()- Specified by:
getThumbSizeXin interfaceloci.formats.IFormatReader- Overrides:
getThumbSizeXin classloci.formats.ReaderWrapper
-
getThumbSizeY
public int getThumbSizeY()- Specified by:
getThumbSizeYin interfaceloci.formats.IFormatReader- Overrides:
getThumbSizeYin classloci.formats.ReaderWrapper
-
isLittleEndian
public boolean isLittleEndian()- Specified by:
isLittleEndianin interfaceloci.formats.IFormatReader- Overrides:
isLittleEndianin classloci.formats.ReaderWrapper
-
getDimensionOrder
- Specified by:
getDimensionOrderin interfaceloci.formats.IFormatReader- Overrides:
getDimensionOrderin classloci.formats.ReaderWrapper
-
isOrderCertain
public boolean isOrderCertain()- Specified by:
isOrderCertainin interfaceloci.formats.IFormatReader- Overrides:
isOrderCertainin classloci.formats.ReaderWrapper
-
isThumbnailSeries
public boolean isThumbnailSeries()- Specified by:
isThumbnailSeriesin interfaceloci.formats.IFormatReader- Overrides:
isThumbnailSeriesin classloci.formats.ReaderWrapper
-
isInterleaved
public boolean isInterleaved()- Specified by:
isInterleavedin interfaceloci.formats.IFormatReader- Overrides:
isInterleavedin classloci.formats.ReaderWrapper
-
isInterleaved
public boolean isInterleaved(int subC) - Specified by:
isInterleavedin interfaceloci.formats.IFormatReader- Overrides:
isInterleavedin classloci.formats.ReaderWrapper
-
openBytes
- Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openBytes
- Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openBytes
public byte[] openBytes(int no, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openBytes
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
openBytesin interfaceloci.formats.IFormatReader- Overrides:
openBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openPlane
public Object openPlane(int no, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
openPlanein interfaceloci.formats.IFormatReader- Overrides:
openPlanein classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openThumbBytes
- Specified by:
openThumbBytesin interfaceloci.formats.IFormatReader- Overrides:
openThumbBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classloci.formats.ReaderWrapper- Throws:
IOException
-
close
- Specified by:
closein interfaceloci.formats.IFormatReader- Overrides:
closein classloci.formats.ReaderWrapper- Throws:
IOException
-
getSeriesCount
public int getSeriesCount()- Specified by:
getSeriesCountin interfaceloci.formats.IFormatReader- Overrides:
getSeriesCountin classloci.formats.ReaderWrapper
-
setSeries
public void setSeries(int no) - Specified by:
setSeriesin interfaceloci.formats.IFormatReader- Overrides:
setSeriesin classloci.formats.ReaderWrapper
-
getSeries
public int getSeries()- Specified by:
getSeriesin interfaceloci.formats.IFormatReader- Overrides:
getSeriesin classloci.formats.ReaderWrapper
-
setResolution
public void setResolution(int no) - Specified by:
setResolutionin interfaceloci.formats.IPyramidHandler- Overrides:
setResolutionin classloci.formats.ReaderWrapper
-
getResolution
public int getResolution()- Specified by:
getResolutionin interfaceloci.formats.IPyramidHandler- Overrides:
getResolutionin classloci.formats.ReaderWrapper
-
seriesToCoreIndex
public int seriesToCoreIndex(int series) - Specified by:
seriesToCoreIndexin interfaceloci.formats.IFormatReader- Overrides:
seriesToCoreIndexin classloci.formats.ReaderWrapper
-
coreIndexToSeries
public int coreIndexToSeries(int index) - Specified by:
coreIndexToSeriesin interfaceloci.formats.IFormatReader- Overrides:
coreIndexToSeriesin classloci.formats.ReaderWrapper
-
setCoreIndex
public void setCoreIndex(int no) - Specified by:
setCoreIndexin interfaceloci.formats.IFormatReader- Overrides:
setCoreIndexin classloci.formats.ReaderWrapper
-
getCoreIndex
public int getCoreIndex()- Specified by:
getCoreIndexin interfaceloci.formats.IFormatReader- Overrides:
getCoreIndexin classloci.formats.ReaderWrapper
-
setFlattenedResolutions
public void setFlattenedResolutions(boolean flatten) - Specified by:
setFlattenedResolutionsin interfaceloci.formats.IFormatReader- Overrides:
setFlattenedResolutionsin classloci.formats.ReaderWrapper
-
setGroupFiles
public void setGroupFiles(boolean group) - Specified by:
setGroupFilesin interfaceloci.formats.IFormatReader- Overrides:
setGroupFilesin classloci.formats.ReaderWrapper
-
isGroupFiles
public boolean isGroupFiles()- Specified by:
isGroupFilesin interfaceloci.formats.IFormatReader- Overrides:
isGroupFilesin classloci.formats.ReaderWrapper
-
setMetadataOptions
- Specified by:
setMetadataOptionsin interfaceloci.formats.IMetadataConfigurable- Overrides:
setMetadataOptionsin classloci.formats.ReaderWrapper
-
setNormalized
public void setNormalized(boolean normalize) - Specified by:
setNormalizedin interfaceloci.formats.IFormatReader- Overrides:
setNormalizedin classloci.formats.ReaderWrapper
-
setOriginalMetadataPopulated
public void setOriginalMetadataPopulated(boolean populate) - Specified by:
setOriginalMetadataPopulatedin interfaceloci.formats.IFormatReader- Overrides:
setOriginalMetadataPopulatedin classloci.formats.ReaderWrapper
-
getUsedFiles
- Specified by:
getUsedFilesin interfaceloci.formats.IFormatReader- Overrides:
getUsedFilesin classloci.formats.ReaderWrapper
-
getUsedFiles
- Specified by:
getUsedFilesin interfaceloci.formats.IFormatReader- Overrides:
getUsedFilesin classloci.formats.ReaderWrapper
-
getSeriesUsedFiles
- Specified by:
getSeriesUsedFilesin interfaceloci.formats.IFormatReader- Overrides:
getSeriesUsedFilesin classloci.formats.ReaderWrapper
-
getSeriesUsedFiles
- Specified by:
getSeriesUsedFilesin interfaceloci.formats.IFormatReader- Overrides:
getSeriesUsedFilesin classloci.formats.ReaderWrapper
-
getAdvancedUsedFiles
- Specified by:
getAdvancedUsedFilesin interfaceloci.formats.IFormatReader- Overrides:
getAdvancedUsedFilesin classloci.formats.ReaderWrapper
-
getAdvancedSeriesUsedFiles
- Specified by:
getAdvancedSeriesUsedFilesin interfaceloci.formats.IFormatReader- Overrides:
getAdvancedSeriesUsedFilesin classloci.formats.ReaderWrapper
-
getIndex
public int getIndex(int z, int c, int t) - Specified by:
getIndexin interfaceloci.formats.IFormatReader- Overrides:
getIndexin classloci.formats.ReaderWrapper
-
getIndex
public int getIndex(int z, int c, int t, int moduloZ, int moduloC, int moduloT) - Specified by:
getIndexin interfaceloci.formats.IFormatReader- Overrides:
getIndexin classloci.formats.ReaderWrapper
-
getZCTCoords
public int[] getZCTCoords(int index) - Specified by:
getZCTCoordsin interfaceloci.formats.IFormatReader- Overrides:
getZCTCoordsin classloci.formats.ReaderWrapper
-
getZCTModuloCoords
public int[] getZCTModuloCoords(int index) - Specified by:
getZCTModuloCoordsin interfaceloci.formats.IFormatReader- Overrides:
getZCTModuloCoordsin classloci.formats.ReaderWrapper
-
getSeriesMetadata
- Specified by:
getSeriesMetadatain interfaceloci.formats.IFormatReader- Overrides:
getSeriesMetadatain classloci.formats.ReaderWrapper
-
getCoreMetadataList
- Specified by:
getCoreMetadataListin interfaceloci.formats.IFormatReader- Overrides:
getCoreMetadataListin classloci.formats.ReaderWrapper
-
setMetadataStore
- Specified by:
setMetadataStorein interfaceloci.formats.IFormatReader- Overrides:
setMetadataStorein classloci.formats.ReaderWrapper
-
getMetadataStore
- Specified by:
getMetadataStorein interfaceloci.formats.IFormatReader- Overrides:
getMetadataStorein classloci.formats.ReaderWrapper
-
getMetadataStoreRoot
- Specified by:
getMetadataStoreRootin interfaceloci.formats.IFormatReader- Overrides:
getMetadataStoreRootin classloci.formats.ReaderWrapper
-
getUnderlyingReaders
- Specified by:
getUnderlyingReadersin interfaceloci.formats.IFormatReader- Overrides:
getUnderlyingReadersin classloci.formats.ReaderWrapper
-
reopenFile
- Specified by:
reopenFilein interfaceloci.formats.IFormatReader- Overrides:
reopenFilein classloci.formats.ReaderWrapper- Throws:
IOException
-
setId
- Specified by:
setIdin interfaceloci.formats.IFormatHandler- Overrides:
setIdin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openCompressedBytes
public byte[] openCompressedBytes(int no, int x, int y) throws loci.formats.FormatException, IOException - Specified by:
openCompressedBytesin interfaceloci.formats.ICompressedTileReader- Overrides:
openCompressedBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
openCompressedBytes
public byte[] openCompressedBytes(int no, byte[] buf, int x, int y) throws loci.formats.FormatException, IOException - Specified by:
openCompressedBytesin interfaceloci.formats.ICompressedTileReader- Overrides:
openCompressedBytesin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getTileCodec
public loci.formats.codec.Codec getTileCodec(int no) throws loci.formats.FormatException, IOException - Specified by:
getTileCodecin interfaceloci.formats.ICompressedTileReader- Overrides:
getTileCodecin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
getTileCodecOptions
public loci.formats.codec.CodecOptions getTileCodecOptions(int no, int x, int y) throws loci.formats.FormatException, IOException - Specified by:
getTileCodecOptionsin interfaceloci.formats.ICompressedTileReader- Overrides:
getTileCodecOptionsin classloci.formats.ReaderWrapper- Throws:
loci.formats.FormatExceptionIOException
-
initFile
Initializes the given file or file pattern. -
computeAxisLengths
Computes axis length arrays, and total axis lengths.- Throws:
loci.formats.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:
loci.formats.FormatExceptionIOException
-
initReader
protected void initReader(int sno, int fno)
-