public class ND2Reader extends SubResolutionFormatReader
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ND2Reader.ChunkMapEntry |
Modifier and Type | Field and Description |
---|---|
private ND2Handler |
backupHandler |
private static int |
BUFFER_SIZE |
private java.util.Map<java.lang.String,java.lang.Integer> |
channelColors |
private Codec |
codec
Codec to use when decompressing pixel data.
|
private int[] |
colors |
private java.util.ArrayList<java.lang.Double> |
exposureTime |
private int |
fieldIndex |
(package private) java.lang.String |
imageMetadataLVOrder |
(package private) java.lang.Boolean |
imageMetadataLVProcessed |
private boolean |
isJPEG
Whether or not the pixel data is compressed using JPEG 2000.
|
private boolean |
isLossless
Whether or not the pixel data is losslessly compressed.
|
private int |
lastChannel |
private java.lang.Double |
lensNA |
static long |
ND2_MAGIC_BYTES_1 |
static long |
ND2_MAGIC_BYTES_2 |
private int |
nXFields |
private java.lang.Double |
objectiveMag |
private java.lang.String |
objectiveModel |
private long[][] |
offsets
Array of image offsets.
|
private long |
pfsOffset |
private long |
pfsStateOffset |
private int |
positionCount |
private java.util.ArrayList<ome.units.quantity.Length> |
posX |
private java.util.ArrayList<ome.units.quantity.Length> |
posY |
private java.util.ArrayList<ome.units.quantity.Length> |
posZ |
private java.lang.Double |
refractiveIndex |
private boolean |
split |
private java.util.ArrayList<java.lang.String> |
textChannelNames |
private boolean |
textData |
private java.util.ArrayList<java.lang.Double> |
textEmissionWavelengths |
private double |
trueSizeX |
private double |
trueSizeY |
private java.lang.Double |
trueSizeZ |
private java.util.ArrayList<java.lang.Double> |
tsT |
static boolean |
USE_CHUNKMAP_DEFAULT |
static java.lang.String |
USE_CHUNKMAP_KEY |
static java.lang.String |
USE_CHUNKMAP_LEGACY_KEY
Deprecated.
|
private java.lang.Boolean |
useZ |
private long |
xOffset |
private long |
yOffset |
private long |
zOffset |
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 |
---|
ND2Reader()
Constructs a new ND2 reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
private void |
copyPixels(int x,
int y,
int w,
int h,
int bpp,
int scanlinePad,
byte[] pix,
byte[] buf,
boolean split) |
private Codec |
createCodec(boolean isJPEG) |
short[][] |
get16BitLookupTable()
Gets the 16-bit color lookup table associated with
the most recently opened image.
|
byte[][] |
get8BitLookupTable()
Gets the 8-bit color lookup table associated with
the most recently opened image.
|
protected java.util.ArrayList<java.lang.String> |
getAvailableOptions()
Returns the list of available metadata options.
|
long[][] |
getOffsets() |
private int |
getScanlinePad() |
protected void |
initFile(java.lang.String id)
Initializes the given file (parsing header information, etc.).
|
boolean |
isThisType(loci.common.RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
private java.util.ArrayList<java.lang.String> |
iterateIn(loci.common.RandomAccessInputStream in,
java.lang.Long stop)
Function for iterating through ND2 metaAttributes
|
private java.util.ArrayList<java.lang.String> |
iterateIn(loci.common.RandomAccessInputStream in,
java.lang.Long stop,
boolean minimal)
Function for iterating through ND2 metaAttributes
|
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 void |
parseText(java.lang.String textString,
int offsetCount,
boolean useDimensions) |
private void |
populateMetadataStore(ND2Handler handler) |
static java.lang.String |
sanitizeControl(java.lang.String s)
Remove control and invalid characters from the given string.
|
private void |
setDimensions(int numT,
int numZ,
int numSeries) |
void |
setOffsets(java.lang.String file,
long[][] newOffsets)
Change the underlying file path and pixel data offsets,
keeping all other metadata the same.
|
boolean |
useChunkMap() |
coreIndexToSeries, flattenHashtables, getCoreIndex, getCoreMetadataList, getCurrentCore, getResolution, getResolutionCount, getSeries, getSeriesCount, seriesToCoreIndex, setCoreIndex, setResolution, setSeries
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, fileGroupOption, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCorrection, 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, getRGBChannelCount, getRotationTransform, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, reopenFile, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, 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
public static final long ND2_MAGIC_BYTES_1
public static final long ND2_MAGIC_BYTES_2
private static final int BUFFER_SIZE
@Deprecated public static final java.lang.String USE_CHUNKMAP_LEGACY_KEY
public static final java.lang.String USE_CHUNKMAP_KEY
public static final boolean USE_CHUNKMAP_DEFAULT
private long[][] offsets
private boolean isJPEG
private Codec codec
private boolean isLossless
private java.util.ArrayList<java.lang.Double> tsT
private int positionCount
private int fieldIndex
private long xOffset
private long yOffset
private long zOffset
private long pfsOffset
private long pfsStateOffset
private java.util.ArrayList<ome.units.quantity.Length> posX
private java.util.ArrayList<ome.units.quantity.Length> posY
private java.util.ArrayList<ome.units.quantity.Length> posZ
private java.util.ArrayList<java.lang.Double> exposureTime
private java.util.Map<java.lang.String,java.lang.Integer> channelColors
private boolean split
private int lastChannel
private int[] colors
private java.lang.Boolean useZ
private int nXFields
private ND2Handler backupHandler
private double trueSizeX
private double trueSizeY
private java.lang.Double trueSizeZ
private java.util.ArrayList<java.lang.String> textChannelNames
private java.util.ArrayList<java.lang.Double> textEmissionWavelengths
private boolean textData
private java.lang.Double refractiveIndex
java.lang.Boolean imageMetadataLVProcessed
java.lang.String imageMetadataLVOrder
private transient java.lang.Double lensNA
private transient java.lang.Double objectiveMag
private transient java.lang.String objectiveModel
public boolean useChunkMap()
public boolean isThisType(loci.common.RandomAccessInputStream stream) throws java.io.IOException
IFormatReader
isThisType
in interface IFormatReader
isThisType
in class FormatReader
stream
- A RandomAccessInputStream representing the file to check.
The first byte in the stream is assumed to be the first byte
in the file.java.io.IOException
public byte[][] get8BitLookupTable()
IFormatReader
IFormatReader.isIndexed()
returns
false, then this may return null. Also, if IFormatReader.getPixelType()
returns
anything other than FormatTools.INT8
or FormatTools.UINT8
,
this method will return null.get8BitLookupTable
in interface IFormatReader
get8BitLookupTable
in class FormatReader
public short[][] get16BitLookupTable()
IFormatReader
IFormatReader.isIndexed()
returns
false, then this may return null. Also, if IFormatReader.getPixelType()
returns
anything other than FormatTools.INT16
or FormatTools.UINT16
, this method will return null.get16BitLookupTable
in interface IFormatReader
get16BitLookupTable
in class FormatReader
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)
public void close(boolean fileOnly) throws java.io.IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class SubResolutionFormatReader
java.io.IOException
protected java.util.ArrayList<java.lang.String> getAvailableOptions()
FormatReader
getAvailableOptions
in class FormatReader
protected void initFile(java.lang.String id) throws FormatException, java.io.IOException
SubResolutionFormatReader
initFile
in class SubResolutionFormatReader
FormatException
- if a parsing error occurs processing the file.java.io.IOException
- if an I/O error occurs processing the fileprivate java.util.ArrayList<java.lang.String> iterateIn(loci.common.RandomAccessInputStream in, java.lang.Long stop)
in
- stream of bytes from filestop
- position where to stopprivate java.util.ArrayList<java.lang.String> iterateIn(loci.common.RandomAccessInputStream in, java.lang.Long stop, boolean minimal)
in
- stream of bytes from filestop
- position where to stopminimal
- true if values should be read with no additional metadata parsingprivate void populateMetadataStore(ND2Handler handler) throws FormatException
FormatException
private Codec createCodec(boolean isJPEG)
private void copyPixels(int x, int y, int w, int h, int bpp, int scanlinePad, byte[] pix, byte[] buf, boolean split) throws java.io.IOException
java.io.IOException
public static java.lang.String sanitizeControl(java.lang.String s)
private int getScanlinePad()
private void parseText(java.lang.String textString, int offsetCount, boolean useDimensions)
private void setDimensions(int numT, int numZ, int numSeries)
public long[][] getOffsets()
public void setOffsets(java.lang.String file, long[][] newOffsets) throws java.io.IOException
java.io.IOException
Copyright © 2023 Open Microscopy Environment