public class KLBReader extends FormatReader
Modifier and Type | Field and Description |
---|---|
private long[] |
blockOffsets |
private int |
blocksPerPlane |
static java.lang.String |
CHANNEL_PREFIX
Prefixes indicating dimensions and projections
|
private java.util.ArrayList<java.lang.Integer> |
channels |
private static int |
COMPRESSION_BZIP2 |
private static int |
COMPRESSION_NONE |
private static int |
COMPRESSION_ZLIB |
private int |
compressionType |
private static java.lang.String |
DEFAULT_SERIES |
private int[] |
dims_blockSize |
private int[] |
dims_xyzct |
private java.util.LinkedHashMap<java.lang.String,java.lang.String[][]> |
filelist |
private static int |
FLOAT32_TYPE |
private static int |
FLOAT64_TYPE |
private long |
headerSize |
private int |
headerVersion |
private static int |
INT16_TYPE |
private static int |
INT32_TYPE |
private static int |
INT64_TYPE |
private static int |
INT8_TYPE |
private static int |
KLB_DATA_DIMS |
private static int |
KLB_DEFAULT_HEADER_VERSION |
private static int |
KLB_METADATA_SIZE |
private double |
numBlocks |
private long |
offsetFilePointer |
static java.lang.String |
PROJECTION_PREFIX |
static java.lang.String |
PROJECTION_SUFFIX |
static java.util.Set<java.lang.String> |
SERIES_PREFIXES |
private MetadataStore |
store |
static java.lang.String |
TIME_PREFIX |
static java.lang.String |
TIME_SUFFIX |
private static int |
UINT16_TYPE |
private static int |
UINT32_TYPE |
private static int |
UINT64_TYPE |
private static int |
UINT8_TYPE |
core, coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
KLBReader()
Constructs a new BDV reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
private void |
convertPixelType(CoreMetadata ms0,
int pixelType) |
int |
fileGroupOption(java.lang.String id)
Returns an indication of whether the files in a multi-file dataset can
be handled individually.
|
java.lang.String[] |
getUsedFiles(boolean noPixels)
Returns an array of filenames needed to open this dataset.
|
protected void |
initFile(java.lang.String id)
Initializes 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.PositiveFloat |
readFloat32() |
private void |
readHeader(CoreMetadata coreMeta) |
private int |
readUInt32() |
private long |
readUInt64() |
private void |
reCalculateBlockOffsets(int no) |
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, 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, updateMetadataLists
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
private static final int KLB_DATA_DIMS
private static final int KLB_METADATA_SIZE
private static final int KLB_DEFAULT_HEADER_VERSION
private static final int UINT8_TYPE
private static final int UINT16_TYPE
private static final int UINT32_TYPE
private static final int UINT64_TYPE
private static final int INT8_TYPE
private static final int INT16_TYPE
private static final int INT32_TYPE
private static final int INT64_TYPE
private static final int FLOAT32_TYPE
private static final int FLOAT64_TYPE
private static final int COMPRESSION_NONE
private static final int COMPRESSION_BZIP2
private static final int COMPRESSION_ZLIB
private MetadataStore store
private int compressionType
private double numBlocks
private int[] dims_blockSize
private int[] dims_xyzct
private long[] blockOffsets
private long headerSize
private int blocksPerPlane
private long offsetFilePointer
private int headerVersion
private java.util.LinkedHashMap<java.lang.String,java.lang.String[][]> filelist
private java.util.ArrayList<java.lang.Integer> channels
private static final java.lang.String DEFAULT_SERIES
public static final java.lang.String CHANNEL_PREFIX
public static final java.lang.String TIME_PREFIX
public static final java.lang.String TIME_SUFFIX
public static final java.lang.String PROJECTION_PREFIX
public static final java.lang.String PROJECTION_SUFFIX
public static final java.util.Set<java.lang.String> SERIES_PREFIXES
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
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-imagebuf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.java.io.IOException
- if there was a problem reading the file.IFormatReader.openBytes(int, byte[], int, int, int, int)
protected void initFile(java.lang.String id) throws FormatException, java.io.IOException
FormatReader
initFile
in class FormatReader
FormatException
- if a parsing error occurs processing the file.java.io.IOException
- if an I/O error occurs processing the fileprivate void readHeader(CoreMetadata coreMeta) throws java.io.IOException, FormatException
java.io.IOException
FormatException
public java.lang.String[] getUsedFiles(boolean noPixels)
IFormatReader
IFormatHandler.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.getUsedFiles
in interface IFormatReader
getUsedFiles
in class FormatReader
private void reCalculateBlockOffsets(int no) throws java.io.IOException, FormatException
java.io.IOException
FormatException
private void convertPixelType(CoreMetadata ms0, int pixelType) throws FormatException
FormatException
private int readUInt32() throws java.io.IOException
java.io.IOException
private long readUInt64() throws java.io.IOException
java.io.IOException
private ome.xml.model.primitives.PositiveFloat readFloat32() throws java.io.IOException
java.io.IOException
public int fileGroupOption(java.lang.String id) throws FormatException, java.io.IOException
IFormatReader
fileGroupOption
in interface IFormatReader
fileGroupOption
in class FormatReader
id
- a file in the multi-file datasetFormatTools.MUST_GROUP
indicates that the
files cannot be handled separately; the reader will always detect and
read all files in the dataset. FormatTools.CAN_GROUP
indicates
that the files may be handled separately, but file grouping must then
be disabled via IFormatReader.setGroupFiles(boolean)
.
FormatTools.CANNOT_GROUP
indicates that the files must be handled
separately; the reader will not attempt to read all files in the dataset
(this is rare).FormatException
java.io.IOException
FormatTools.MUST_GROUP
,
FormatTools.CAN_GROUP
,
FormatTools.CANNOT_GROUP
public void close(boolean fileOnly) throws java.io.IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class FormatReader
java.io.IOException
Copyright © 2023 Open Microscopy Environment