public class MetamorphReader extends BaseTiffReader
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
binning |
private boolean |
bizarreMultichannelAcquisition |
private boolean |
canLookForND |
private long[] |
emWavelength
The TIFF's emWavelength
|
private java.lang.Double |
exposureTime |
private boolean[] |
firstSeriesChannels |
private java.lang.Double |
gain |
private boolean |
hasAbsoluteZ |
private boolean |
hasAbsoluteZValid |
private boolean |
hasChipOffsets |
private boolean |
hasStagePositions |
private java.lang.String |
imageCreationDate
The TIFF's creation date
|
private java.lang.String |
imageName
The TIFF's name
|
private long[] |
internalStamps |
private boolean |
isHCS |
private static org.slf4j.Logger |
LOGGER
Logger for this class.
|
static java.lang.String |
LONG_DATE_FORMAT |
private static int |
METAMORPH_ID |
private int |
mmPlanes |
static java.lang.String[] |
ND_SUFFIX |
private java.lang.String |
ndFilename |
private static java.lang.String |
NDINFOFILE_VER1 |
private static java.lang.String |
NDINFOFILE_VER2 |
private int |
openFiles |
static java.lang.String |
SHORT_DATE_FORMAT |
private java.lang.Double |
sizeX |
private java.lang.Double |
sizeY |
private java.lang.String[] |
stageLabels |
private java.util.List<java.lang.String> |
stageNames |
private ome.units.quantity.Length[] |
stageX |
private ome.units.quantity.Length[] |
stageY |
private double |
stepSize |
static java.lang.String[] |
STK_SUFFIX |
private MetamorphReader[][] |
stkReaders |
private java.lang.String[][] |
stks
List of STK files in the dataset.
|
private double |
tempZ |
private static int |
UIC1TAG |
private static int |
UIC2TAG |
private static int |
UIC3TAG |
private static int |
UIC4TAG |
private boolean |
validZ |
private double[] |
wave |
private java.util.List<java.lang.String> |
waveNames |
static java.util.regex.Pattern |
WELL_COORDS |
private double[] |
zDistances |
private double |
zoom |
private double |
zStart |
DATE_FORMATScanSeparateSeries, equalStrips, ifds, lastPlane, mergeSubIFDs, noSubresolutions, seriesToIFD, subResolutionIFDs, thumbnailIFDs, tiffParser, use64BitcorecoreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSIONCOMPRESSION_SUFFIXES, currentId, format, metadataOptions, suffixesCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description |
|---|
MetamorphReader()
Constructs a new Metamorph reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
static java.lang.String |
decodeDate(int julian)
Converts a Julian date value into a human-readable string.
|
static java.lang.String |
decodeTime(int millis)
Converts a time value in milliseconds into a human-readable string.
|
int |
fileGroupOption(java.lang.String id)
Returns an indication of whether the files in a multi-file dataset can
be handled individually.
|
private java.lang.String |
getComment(int i,
int no) |
java.lang.String[] |
getDomains()
Returns the list of domains represented by the current file.
|
private java.lang.String |
getFirstComment(int i)
Returns the TIFF comment from the first IFD of the first STK file in the
given series.
|
private java.lang.String |
getKey(int id) |
private java.lang.String |
getNDVersionSuffix(loci.common.Location ndfile)
Parses the given ND file to determined the version and return
the expected file suffix
|
private java.lang.String |
getRealSTKFile(loci.common.Location l)
Check that the given STK file exists.
|
java.lang.String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
private java.util.Map.Entry<java.lang.Integer,java.lang.Integer> |
getWellCoords(java.lang.String label) |
protected void |
initFile(java.lang.String id)
Initializes the given file (parsing header information, etc.).
|
protected void |
initStandardMetadata()
Parses standard metadata.
|
static java.lang.String |
intFormat(int myint,
int digits)
Formats an integer value with leading 0s if needed.
|
static java.lang.String |
intFormatMax(int myint,
int maxint)
Formats an integer with leading 0 using maximum sequence number.
|
boolean |
isSingleFile(java.lang.String id)
Returns true if the named file is expected to be the only
file in the dataset.
|
boolean |
isThisType(loci.common.RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
boolean |
isThisType(java.lang.String name,
boolean open)
Checks if a file matches the type of this format reader.
|
private java.lang.String |
locateFirstValidFile()
Locates the first valid file in the STK arrays.
|
private java.lang.String |
makeImageName(int i)
Create an appropriate name for the given series.
|
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 |
parseUIC1Tags(long uic1offset,
int uic1count)
UIC1 entry parser
|
(package private) void |
parseUIC2Tags(long uic2offset)
Populates metadata fields with some contained in MetaMorph UIC2 Tag.
|
private void |
parseUIC4Tags(long uic4offset)
UIC4 metadata parser
UIC4 Table contains per-plane blocks of metadata
stage X/Y positions,
camera chip offsets,
stage labels...
|
(package private) void |
readAbsoluteZValid() |
private static java.lang.String |
readCString(loci.common.RandomAccessInputStream s,
int n)
Read a null-terminated string.
|
private void |
readPlaneData() |
private TiffRational |
readRational(loci.common.RandomAccessInputStream s) |
private TiffRational |
readRational(loci.common.RandomAccessInputStream s,
long offset) |
private void |
readRationals(java.lang.String[] labels) |
(package private) void |
readStageLabels() |
private void |
readStagePositions() |
private void |
setCanLookForND(boolean v) |
getExifTagName, getImageCreationDate, initMetadata, initMetadataStore, put, put, put, put, put, put, put, put, put, put, putDouble, putInt, putStringget16BitLookupTable, get8BitLookupTable, getIFDs, getOptimalTileHeight, getOptimalTileWidth, getThumbnailIFDs, getThumbSizeX, getThumbSizeY, initTiffParser, openThumbBytes, reopenFile, setResolutionLevelcoreIndexToSeries, flattenHashtables, getCoreIndex, getCoreMetadataList, getCurrentCore, getResolution, getResolutionCount, getSeries, getSeriesCount, seriesToCoreIndex, setCoreIndex, setResolution, setSeriesaddGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCorrection, 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, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getRGBChannelCount, getRotationTransform, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, readPlane, readPlane, readPlane, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, updateMetadataListscheckSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormat, getNativeDataType, getSuffixesgetMetadataOptions, getSupportedMetadataLevels, setMetadataOptionsgetTileCodec, getTileCodecOptions, openCompressedBytes, openCompressedBytesprivate static final org.slf4j.Logger LOGGER
public static final java.lang.String SHORT_DATE_FORMAT
public static final java.lang.String LONG_DATE_FORMAT
public static final java.lang.String[] ND_SUFFIX
public static final java.lang.String[] STK_SUFFIX
public static final java.util.regex.Pattern WELL_COORDS
private static final int METAMORPH_ID
private static final int UIC1TAG
private static final int UIC2TAG
private static final int UIC3TAG
private static final int UIC4TAG
private static final java.lang.String NDINFOFILE_VER1
private static final java.lang.String NDINFOFILE_VER2
private java.lang.String imageName
private java.lang.String imageCreationDate
private long[] emWavelength
private boolean isHCS
private java.lang.String[] stageLabels
private double[] wave
private java.lang.String binning
private double zoom
private double stepSize
private java.lang.Double exposureTime
private java.util.List<java.lang.String> waveNames
private java.util.List<java.lang.String> stageNames
private long[] internalStamps
private double[] zDistances
private ome.units.quantity.Length[] stageX
private ome.units.quantity.Length[] stageY
private double zStart
private java.lang.Double sizeX
private java.lang.Double sizeY
private double tempZ
private boolean validZ
private java.lang.Double gain
private int mmPlanes
private MetamorphReader[][] stkReaders
private java.lang.String[][] stks
private java.lang.String ndFilename
private boolean canLookForND
private boolean[] firstSeriesChannels
private boolean bizarreMultichannelAcquisition
private int openFiles
private boolean hasStagePositions
private boolean hasChipOffsets
private boolean hasAbsoluteZ
private boolean hasAbsoluteZValid
public java.lang.String[] getDomains()
IFormatReadergetDomains in interface IFormatReadergetDomains in class FormatReaderpublic boolean isThisType(java.lang.String name,
boolean open)
FormatReaderFormatReader.isThisType(RandomAccessInputStream).isThisType in interface IFormatReaderisThisType in class FormatReaderopen - If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.public boolean isThisType(loci.common.RandomAccessInputStream stream)
throws java.io.IOException
IFormatReaderisThisType in interface IFormatReaderisThisType in class MinimalTiffReaderstream - 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.IOExceptionpublic boolean isSingleFile(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReaderisSingleFile in interface IFormatReaderisSingleFile in class FormatReaderFormatExceptionjava.io.IOExceptionpublic int fileGroupOption(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatReaderfileGroupOption in interface IFormatReaderfileGroupOption in class FormatReaderid - 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).FormatExceptionjava.io.IOExceptionFormatTools.MUST_GROUP,
FormatTools.CAN_GROUP,
FormatTools.CANNOT_GROUPpublic java.lang.String[] getSeriesUsedFiles(boolean noPixels)
IFormatReaderIFormatHandler.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.getSeriesUsedFiles in interface IFormatReadergetSeriesUsedFiles in class FormatReaderpublic byte[] openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class MinimalTiffReaderno - 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
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class MinimalTiffReaderjava.io.IOExceptionprotected void initFile(java.lang.String id)
throws FormatException,
java.io.IOException
SubResolutionFormatReaderinitFile in class BaseTiffReaderFormatException - if a parsing error occurs processing the file.java.io.IOException - if an I/O error occurs processing the fileprotected void initStandardMetadata()
throws FormatException,
java.io.IOException
BaseTiffReaderinitStandardMetadata in class BaseTiffReaderFormatExceptionjava.io.IOExceptionprivate java.lang.String getRealSTKFile(loci.common.Location l)
private java.lang.String getFirstComment(int i)
throws java.io.IOException
java.io.IOExceptionprivate java.lang.String getComment(int i,
int no)
throws java.io.IOException
java.io.IOExceptionprivate java.lang.String makeImageName(int i)
void parseUIC2Tags(long uic2offset)
throws java.io.IOException
uic2offset - offset to UIC2 (33629) tag entries
not a regular tiff tag (6*N entries, N being the tagCount)java.io.IOExceptionprivate void parseUIC4Tags(long uic4offset)
throws java.io.IOException
uic4offset - offset of UIC4 table (not tiff-compliant)java.io.IOExceptionprivate void readStagePositions()
throws java.io.IOException
java.io.IOExceptionprivate void readRationals(java.lang.String[] labels)
throws java.io.IOException
java.io.IOExceptionvoid readStageLabels()
throws java.io.IOException
java.io.IOExceptionvoid readAbsoluteZValid()
throws java.io.IOException
java.io.IOExceptionprivate void parseUIC1Tags(long uic1offset,
int uic1count)
throws java.io.IOException
uic1offset - offset as found in the tiff tag 33628 (UIC1Tag)uic1count - number of entries in UIC1 table (not tiff-compliant)java.io.IOExceptionpublic static java.lang.String decodeDate(int julian)
public static java.lang.String decodeTime(int millis)
public static java.lang.String intFormat(int myint,
int digits)
public static java.lang.String intFormatMax(int myint,
int maxint)
myint - integer to formatmaxint - max of "myint"private java.lang.String locateFirstValidFile()
private TiffRational readRational(loci.common.RandomAccessInputStream s) throws java.io.IOException
java.io.IOExceptionprivate TiffRational readRational(loci.common.RandomAccessInputStream s, long offset) throws java.io.IOException
java.io.IOExceptionprivate void setCanLookForND(boolean v)
private void readPlaneData()
throws java.io.IOException
java.io.IOExceptionprivate java.lang.String getKey(int id)
private java.util.Map.Entry<java.lang.Integer,java.lang.Integer> getWellCoords(java.lang.String label)
private static java.lang.String readCString(loci.common.RandomAccessInputStream s,
int n)
throws java.io.IOException
java.io.IOExceptionprivate java.lang.String getNDVersionSuffix(loci.common.Location ndfile)
throws java.io.IOException
ndfile - The ND file which should be parsedjava.io.IOExceptionCopyright © 2024 Open Microscopy Environment