Package loci.formats.in
Class TissueFAXSReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.TissueFAXSReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
Reader for TissueFAXS format from TissueGnostics.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate List<TissueFAXSReader.ScanRegion> private static final intprivate static final intFields inherited from class loci.formats.FormatReader
core, coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSIONFields inherited from class loci.formats.FormatHandler
COMPRESSION_SUFFIXES, currentId, format, metadataOptions, suffixesFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]applyTransformation(byte[] tile, int regionID, int level, int channel, int zIndex, int fovRow, int fovColumn) Extension point for doing something to an FOV immediately after decompression, before any stitching or cropping.voidclose(boolean fileOnly) Closes the currently open file.private voidcopyCorrectionImageToBuffer(TissueFAXSReader.ScanRegion region, loci.common.Region dest, int[] zct, byte[] buf) private voidcopyRegion(loci.common.Region srcRegion, byte[] src, loci.common.Region destRegion, byte[] dest, int tileWidth) private voidcopyRegionToBuffer(TissueFAXSReader.ScanRegion region, int level, loci.common.Region dest, int[] zct, byte[] buf) private voidIf a .tfcyto file was provided, then that is the only file that should be read.private List<TissueFAXSReader.ScanRegion> getAllRegions(int t) private CodecgetCodec(int compression) private CodecOptionsprivate intgetLevel()intReturns the optimal sub-image height for use with openBytes.intReturns the optimal sub-image width for use with openBytes.private TissueFAXSReader.ScanRegionprivate TissueFAXSReader.ScanRegiongetRegion(int t) String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.protected voidInitializes the given file (parsing header information, etc.).private booleanbyte[]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.private ConnectionopenConnection(String file) private byte[][]splitFOVs(TissueFAXSReader.ScanRegion region, byte[] tile, int scale) The largest resolution stores one field of view (FOV) per tile.Methods inherited from class loci.formats.FormatReader
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, coreIndexToSeries, fileGroupOption, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillColor, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, updateMetadataListsMethods inherited from class loci.formats.FormatHandler
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface loci.formats.ICompressedTileReader
getTileCodec, getTileCodecOptions, openCompressedBytes, openCompressedBytesMethods inherited from interface loci.formats.IFormatHandler
getFormat, getNativeDataType, getSuffixesMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
WAVE_MIN
private static final int WAVE_MIN- See Also:
-
WAVE_MAX
private static final int WAVE_MAX- See Also:
-
pixelsFiles
-
regions
-
-
Constructor Details
-
TissueFAXSReader
public TissueFAXSReader()Constructs a new TissueGnostics TissueFAXS reader.
-
-
Method Details
-
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 classFormatReader- Throws:
IOException
-
getOptimalTileWidth
public int getOptimalTileWidth()Description copied from interface:IFormatReaderReturns the optimal sub-image width for use with openBytes.- Specified by:
getOptimalTileWidthin interfaceIFormatReader- Overrides:
getOptimalTileWidthin classFormatReader
-
getOptimalTileHeight
public int getOptimalTileHeight()Description copied from interface:IFormatReaderReturns the optimal sub-image height for use with openBytes.- Specified by:
getOptimalTileHeightin interfaceIFormatReader- Overrides:
getOptimalTileHeightin classFormatReader
-
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 classFormatReader
-
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- Specified by:
openBytesin classFormatReader- 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.- See Also:
-
initFile
Description copied from class:FormatReaderInitializes the given file (parsing header information, etc.). Most subclasses should override this method to perform initialization operations such as parsing metadata.- Overrides:
initFilein classFormatReader- Throws:
FormatException- if a parsing error occurs processing the file.IOException- if an I/O error occurs processing the file
-
findDBFiles
private void findDBFiles()If a .tfcyto file was provided, then that is the only file that should be read. If an .aqproj file was provided, look for all associated .tfcyto files. -
getAllRegions
- Throws:
FormatException
-
getRegion
- Throws:
FormatException
-
getRegion
- Throws:
FormatException
-
isCorrectionImage
-
getLevel
- Throws:
FormatException
-
getCodec
- Throws:
UnsupportedCompressionException
-
getCodecOptions
-
splitFOVs
The largest resolution stores one field of view (FOV) per tile. Each sub-resolution has the same tile size as the largest resolution, so the number of FOVs stored in one tile increases as the resolutions get smaller. For example, with a tile size of 2048x2048 and a downsample factor of 4, resolution 1 will have 16 (4x4) FOVs per tile, with each FOV being 512x512. However, none of the FOV positions or overlaps are taken into account. So the first step in assembling a sub-resolution is to split each tile into its component FOVs. Then each FOV can be repositioned according to its associated stitching rectangle and overlap. This method only splits the given tile into component FOVs. This is not necessary for the largest resolution, only sub-resolutions. -
copyRegionToBuffer
private void copyRegionToBuffer(TissueFAXSReader.ScanRegion region, int level, loci.common.Region dest, int[] zct, byte[] buf) throws FormatException, IOException - Throws:
FormatExceptionIOException
-
copyRegion
private void copyRegion(loci.common.Region srcRegion, byte[] src, loci.common.Region destRegion, byte[] dest, int tileWidth) -
copyCorrectionImageToBuffer
private void copyCorrectionImageToBuffer(TissueFAXSReader.ScanRegion region, loci.common.Region dest, int[] zct, byte[] buf) throws FormatException, IOException - Throws:
FormatExceptionIOException
-
openConnection
- Throws:
IOException
-
applyTransformation
public byte[] applyTransformation(byte[] tile, int regionID, int level, int channel, int zIndex, int fovRow, int fovColumn) Extension point for doing something to an FOV immediately after decompression, before any stitching or cropping. Overriding this in a subclass could be used to apply a correction image. Currently this method is a no-op.
-