public class NativeND2Reader extends FormatReader
| Modifier and Type | Field and Description |
|---|---|
private ND2Handler |
backupHandler |
private static int |
BUFFER_SIZE |
private Map<String,Integer> |
channelColors |
private Codec |
codec
Codec to use when decompressing pixel data.
|
private int[] |
colors |
private ArrayList<Double> |
exposureTime |
private int |
fieldIndex |
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 |
static long |
ND2_MAGIC_BYTES_1 |
static long |
ND2_MAGIC_BYTES_2 |
private int |
nXFields |
private long[][] |
offsets
Array of image offsets.
|
private long |
pfsOffset |
private long |
pfsStateOffset |
private int |
positionCount |
private ArrayList<Length> |
posX |
private ArrayList<Length> |
posY |
private ArrayList<Length> |
posZ |
private Double |
refractiveIndex |
private boolean |
split |
private ArrayList<String> |
textChannelNames |
private boolean |
textData |
private ArrayList<Double> |
textEmissionWavelengths |
private double |
trueSizeX |
private double |
trueSizeY |
private Double |
trueSizeZ |
private ArrayList<Double> |
tsT |
private Boolean |
useZ |
private long |
xOffset |
private long |
yOffset |
private long |
zOffset |
core, coreIndex, datasetDescription, domains, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSIONCOMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixesCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description |
|---|
NativeND2Reader()
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.
|
private int |
getScanlinePad() |
protected void |
initFile(String id)
Initializes the given file (parsing header information, etc.).
|
boolean |
isThisType(RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
private void |
iterateIn(RandomAccessInputStream in,
Long stop)
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(String textString,
int offsetCount,
boolean useDimensions) |
private void |
populateMetadataStore(ND2Handler handler) |
static String |
sanitizeControl(String s)
Remove control and invalid characters from the given string.
|
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, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, 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, 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, reopenFile, seriesToCoreIndex, setCoreIndex, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeriescheckSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormat, getNativeDataType, getSuffixesgetMetadataOptions, getSupportedMetadataLevels, setMetadataOptionspublic static final long ND2_MAGIC_BYTES_1
public static final long ND2_MAGIC_BYTES_2
private static final int BUFFER_SIZE
private long[][] offsets
private boolean isJPEG
private Codec codec
private boolean isLossless
private int positionCount
private int fieldIndex
private long xOffset
private long yOffset
private long zOffset
private long pfsOffset
private long pfsStateOffset
private boolean split
private int lastChannel
private int[] colors
private Boolean useZ
private int nXFields
private ND2Handler backupHandler
private double trueSizeX
private double trueSizeY
private Double trueSizeZ
private boolean textData
private Double refractiveIndex
public boolean isThisType(RandomAccessInputStream stream) throws IOException
IFormatReaderisThisType in interface IFormatReaderisThisType in class FormatReaderIOExceptionpublic byte[][] get8BitLookupTable()
IFormatReaderIFormatReader.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 IFormatReaderget8BitLookupTable in class FormatReaderpublic short[][] get16BitLookupTable()
IFormatReaderIFormatReader.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 IFormatReaderget16BitLookupTable in class FormatReaderpublic byte[] openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class FormatReaderno - the image index within the file.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.IOException - if there was a problem reading the file.IFormatReader.openBytes(int, byte[], int, int, int, int)public void close(boolean fileOnly)
throws IOException
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class FormatReaderIOExceptionprotected void initFile(String id) throws FormatException, IOException
FormatReaderinitFile in class FormatReaderFormatException - if a parsing error occurs processing the file.IOException - if an I/O error occurs processing the fileprivate void iterateIn(RandomAccessInputStream in, Long stop)
in - stream of bytes from filestop - position where to stopprivate void populateMetadataStore(ND2Handler handler) throws FormatException
FormatExceptionprivate 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 IOException
IOExceptionpublic static String sanitizeControl(String s)
private int getScanlinePad()
private void parseText(String textString, int offsetCount, boolean useDimensions)
Copyright © 2016 Open Microscopy Environment