Package loci.formats.in
Class KLBReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.KLBReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
Reader for Keller Lab Block (KLB) files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long[]private intstatic final StringPrefixes indicating dimensions and projectionsprivate static final intprivate static final intprivate static final intprivate intprivate static final Stringprivate int[]private int[]private LinkedHashMap<String, String[][]> private static final intprivate static final intprivate longprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate doubleprivate longstatic final Stringstatic final Stringprivate MetadataStorestatic final Stringstatic final Stringprivate static final intprivate static final intprivate 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, LOGGER, metadataOptions, suffixesFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(boolean fileOnly) Closes the currently open file.private voidconvertPixelType(CoreMetadata ms0, int pixelType) intReturns an indication of whether the files in a multi-file dataset can be handled individually.String[]getUsedFiles(boolean noPixels) Returns an array of filenames needed to open this dataset.protected voidInitializes the given file (parsing header information, etc.).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.private ome.xml.model.primitives.PositiveFloatprivate voidreadHeader(CoreMetadata coreMeta) private intprivate longprivate voidreCalculateBlockOffsets(int no) 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, 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, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, 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
-
KLB_DATA_DIMS
private static final int KLB_DATA_DIMS- See Also:
-
KLB_METADATA_SIZE
private static final int KLB_METADATA_SIZE- See Also:
-
KLB_DEFAULT_HEADER_VERSION
private static final int KLB_DEFAULT_HEADER_VERSION- See Also:
-
UINT8_TYPE
private static final int UINT8_TYPE- See Also:
-
UINT16_TYPE
private static final int UINT16_TYPE- See Also:
-
UINT32_TYPE
private static final int UINT32_TYPE- See Also:
-
UINT64_TYPE
private static final int UINT64_TYPE- See Also:
-
INT8_TYPE
private static final int INT8_TYPE- See Also:
-
INT16_TYPE
private static final int INT16_TYPE- See Also:
-
INT32_TYPE
private static final int INT32_TYPE- See Also:
-
INT64_TYPE
private static final int INT64_TYPE- See Also:
-
FLOAT32_TYPE
private static final int FLOAT32_TYPE- See Also:
-
FLOAT64_TYPE
private static final int FLOAT64_TYPE- See Also:
-
COMPRESSION_NONE
private static final int COMPRESSION_NONE- See Also:
-
COMPRESSION_BZIP2
private static final int COMPRESSION_BZIP2- See Also:
-
COMPRESSION_ZLIB
private static final int COMPRESSION_ZLIB- See Also:
-
store
-
compressionType
private int compressionType -
numBlocks
private double numBlocks -
dims_blockSize
private int[] dims_blockSize -
dims_xyzct
private int[] dims_xyzct -
blockOffsets
private long[] blockOffsets -
headerSize
private long headerSize -
blocksPerPlane
private int blocksPerPlane -
offsetFilePointer
private long offsetFilePointer -
headerVersion
private int headerVersion -
filelist
-
channels
-
DEFAULT_SERIES
- See Also:
-
CHANNEL_PREFIX
Prefixes indicating dimensions and projections- See Also:
-
TIME_PREFIX
- See Also:
-
TIME_SUFFIX
- See Also:
-
PROJECTION_PREFIX
- See Also:
-
PROJECTION_SUFFIX
- See Also:
-
SERIES_PREFIXES
-
-
Constructor Details
-
KLBReader
public KLBReader()Constructs a new BDV reader.
-
-
Method Details
-
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
-
readHeader
- Throws:
IOExceptionFormatException
-
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 classFormatReader
-
reCalculateBlockOffsets
- Throws:
IOExceptionFormatException
-
convertPixelType
- Throws:
FormatException
-
readUInt32
- Throws:
IOException
-
readUInt64
- Throws:
IOException
-
readFloat32
- Throws:
IOException
-
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:
-
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
-