Package loci.formats.in
Class ICSReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.ICSReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
ICSReader is the file format reader for ICS (Image Cytometry Standard)
files. More information on ICS can be found at http://libics.sourceforge.net
TODO : remove sub-C logic once N-dimensional support is in place
see http://dev.loci.wisc.edu/trac/java/ticket/398
- Author:
- Melissa Linkert melissa at glencoesoftware.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe length of each channel axis.The type of each channel axis.private StringCurrent filename.private Stringprivate byte[]Image data.static final String[]private static final String[][]private booleanWhether or not the pixels are GZIP-compressed.private GZIPInputStreamprivate booleanprivate static final String[][]private booleanWhether or not the image is inverted along the Y axis.private StringDimensional reordering for lifetime dataprivate static final String[][]private booleanWhether or not the channels represent lifetime histogram bins.static final StringNewline characters.private longOffset to pixel data.private static String[][]private static final String[][]private intprivate static final String[][]private static final String[][]private booleanprivate booleanFlag indicating whether current file is v2.0.private static final String[][]Fields 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, LOGGER, metadataOptions, suffixesFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanVerifies that a unit matches the expected value.voidclose(boolean fileOnly) Closes the currently open file.private booleancompareTokens(String[] tokens, int tokenIndex, String[] regexes, int regexesIndex) private StringconcatenateTokens(String[] tokens, int start, int stop) intReturns an indication of whether the files in a multi-file dataset can be handled individually.(package private) String[]findKeyValue(String[] tokens, String[][] regexesArray) private String[]findKeyValueForCategory(String[] tokens, String[][] regexesArray) private String[]findKeyValueOther(String[] tokens, String[][] regexesArray) String[]Returns the list of domains represented by the current file.String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.protected voidInitializes the given file (parsing header information, etc.).booleanisInterleaved(int subC) Gets whether or not the given sub-channel is interleaved.booleanisSingleFile(String id) Returns true if the named file is expected to be the only file in the dataset.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.voidReopen any files that were closed, and which are expected to be open while the reader is open.private Double[]Splits the given string into a list ofDoubles.private String[]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, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, 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, getOptimalTileHeight, getOptimalTileWidth, 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, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, 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
-
NL
Newline characters.- See Also:
-
DATE_FORMATS
-
DOCUMENT_KEYS
-
HISTORY_KEYS
-
LAYOUT_KEYS
-
PARAMETER_KEYS
-
REPRESENTATION_KEYS
-
SENSOR_KEYS
-
VIEW_KEYS
-
OTHER_KEYS
-
currentIcsId
Current filename. -
currentIdsId
-
versionTwo
private boolean versionTwoFlag indicating whether current file is v2.0. -
data
private byte[] dataImage data. -
offset
private long offsetOffset to pixel data. -
gzip
private boolean gzipWhether or not the pixels are GZIP-compressed. -
gzipStream
-
invertY
private boolean invertYWhether or not the image is inverted along the Y axis. -
lifetime
private boolean lifetimeWhether or not the channels represent lifetime histogram bins. -
labels
Dimensional reordering for lifetime data -
channelLengths
The length of each channel axis. -
channelTypes
The type of each channel axis. -
prevImage
private int prevImage -
hasInstrumentData
private boolean hasInstrumentData -
storedRGB
private boolean storedRGB
-
-
Constructor Details
-
ICSReader
public ICSReader()Constructs a new ICSReader.
-
-
Method Details
-
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- Overrides:
isSingleFilein classFormatReader- Throws:
FormatExceptionIOException
-
getDomains
Description copied from interface:IFormatReaderReturns the list of domains represented by the current file.- Specified by:
getDomainsin interfaceIFormatReader- Overrides:
getDomainsin classFormatReader
-
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 classFormatReader
-
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- Overrides:
fileGroupOptionin classFormatReader- 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:
-
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:
-
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
-
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
-
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 classFormatReader- Throws:
IOException
-
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
-
tokenize
-
findKeyValue
-
concatenateTokens
-
findKeyValueForCategory
-
findKeyValueOther
-
compareTokens
-
splitDoubles
Splits the given string into a list ofDoubles. -
checkUnit
Verifies that a unit matches the expected value.
-