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 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_FORMATS
equalStrips, ifds, lastPlane, noSubresolutions, seriesToIFD, subResolutionIFDs, thumbnailIFDs, tiffParser, use64Bit
core, coreIndex, datasetDescription, domains, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION
COMPRESSION_SUFFIXES, currentId, format, metadataOptions, suffixes
CAN_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 int indicating that we cannot, must, or might group the files
in a given dataset.
|
private java.lang.String |
getComment(int i,
int no) |
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 |
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 this is a single-file format.
|
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, putInt, putString
get16BitLookupTable, get8BitLookupTable, getIFDs, getOptimalTileHeight, getOptimalTileWidth, getThumbnailIFDs, getThumbSizeX, getThumbSizeY, initTiffParser, openThumbBytes, reopenFile, setResolutionLevel
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, 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, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, 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, seriesToCoreIndex, setCoreIndex, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries
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 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 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 boolean isThisType(java.lang.String name, boolean open)
FormatReader
FormatReader.isThisType(RandomAccessInputStream)
.isThisType
in interface IFormatReader
isThisType
in class FormatReader
open
- 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
IFormatReader
isThisType
in interface IFormatReader
isThisType
in class MinimalTiffReader
java.io.IOException
public boolean isSingleFile(java.lang.String id) throws FormatException, java.io.IOException
IFormatReader
isSingleFile
in interface IFormatReader
isSingleFile
in class FormatReader
FormatException
java.io.IOException
public int fileGroupOption(java.lang.String id) throws FormatException, java.io.IOException
IFormatReader
fileGroupOption
in interface IFormatReader
fileGroupOption
in class FormatReader
FormatException
java.io.IOException
public java.lang.String[] getSeriesUsedFiles(boolean noPixels)
IFormatReader
getSeriesUsedFiles
in interface IFormatReader
getSeriesUsedFiles
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 MinimalTiffReader
no
- 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.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 MinimalTiffReader
java.io.IOException
protected void initFile(java.lang.String id) throws FormatException, java.io.IOException
FormatReader
initFile
in class BaseTiffReader
FormatException
- 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
BaseTiffReader
initStandardMetadata
in class BaseTiffReader
FormatException
java.io.IOException
private java.lang.String getRealSTKFile(loci.common.Location l)
private java.lang.String getFirstComment(int i) throws java.io.IOException
java.io.IOException
private java.lang.String getComment(int i, int no) throws java.io.IOException
java.io.IOException
private 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.IOException
private void parseUIC4Tags(long uic4offset) throws java.io.IOException
uic4offset
- offset of UIC4 table (not tiff-compliant)java.io.IOException
private void readStagePositions() throws java.io.IOException
java.io.IOException
private void readRationals(java.lang.String[] labels) throws java.io.IOException
java.io.IOException
void readStageLabels() throws java.io.IOException
java.io.IOException
void readAbsoluteZValid() throws java.io.IOException
java.io.IOException
private 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.IOException
public 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.IOException
private TiffRational readRational(loci.common.RandomAccessInputStream s, long offset) throws java.io.IOException
java.io.IOException
private void setCanLookForND(boolean v)
private void readPlaneData() throws java.io.IOException
java.io.IOException
private 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.IOException
Copyright © 2017 Open Microscopy Environment