public class PrairieReader extends FormatReader
| Modifier and Type | Field and Description |
|---|---|
static String[] |
CFG_SUFFIX |
private Location |
cfgFile
The associated XML files.
|
private int[] |
channels
List of active channels.
|
private static String |
DATE_FORMAT |
static String[] |
ENV_SUFFIX |
private Location |
envFile
The associated XML files.
|
private boolean[] |
framesAreTime
Whether a series uses
Frames as time points rather than focal
planes (i.e., sizeZ and sizeT values inverted). |
private PrairieMetadata |
meta
Format-specific metadata.
|
static String[] |
PRAIRIE_SUFFIXES |
private static int |
PRAIRIE_TAG_1 |
private static int |
PRAIRIE_TAG_2 |
private static int |
PRAIRIE_TAG_3 |
private ArrayList<PrairieMetadata.Sequence> |
sequences
List of Prairie metadata
Sequences, ordered by cycle. |
private boolean |
singleTiffMode
Flag indicating that the reader is operating in a mode where grouping of
files is disallowed.
|
private TiffReader |
tiff
Helper reader for opening images.
|
static String[] |
XML_SUFFIX |
private Location |
xmlFile
The associated XML files.
|
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 |
|---|
PrairieReader()
Constructs a new Prairie TIFF reader.
|
| Modifier and Type | Method and Description |
|---|---|
private byte[] |
blank(byte[] buf)
Blanks out and returns the given buffer.
|
void |
close(boolean fileOnly)
Closes the currently open file.
|
private int |
computeSizeT(int sequenceCount)
Scans the parsed metadata to determine the number of actual time points
versus the number of actual stage positions.
|
private static boolean |
equal(Length xPos,
Length xInitial)
Determines whether the two
Length values are equal. |
int |
fileGroupOption(String id)
Returns an int indicating that we cannot, must, or might group the files
in a given dataset.
|
private Location |
find(String[] suffix)
Finds the first file with one of the given suffixes.
|
private void |
findMetadataFiles() |
private int |
frameIndex(PrairieMetadata.Sequence sequence,
int z,
int t,
int s)
Gets the frame index associated with the given (Z, T) position of the
specified series.
|
int |
getOptimalTileHeight()
Returns the optimal sub-image height for use with openBytes.
|
int |
getOptimalTileWidth()
Returns the optimal sub-image width for use with openBytes.
|
private String |
getPath(PrairieMetadata.PFile file)
Gets the absolute path to the filename of the given
PrairieMetadata.PFile. |
String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
protected void |
initFile(String id)
Initializes the given file (parsing header information, etc.).
|
private boolean |
isMinimumMetadata()
Gets whether to populate only the minimum required metadata.
|
boolean |
isSingleFile(String id)
Returns true if this is a single-file format.
|
boolean |
isThisType(RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
boolean |
isThisType(String name,
boolean open)
Checks if a file matches the type of this format reader.
|
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 Document |
parseDOM(Location file)
Parses a
Document from the data in the given file. |
private void |
parsePrairieMetadata()
This step parses the Prairie metadata files into the Prairie-specific
metadata structure,
meta. |
private PositiveFloat |
pf(Double value,
String name)
|
private void |
populateCoreMetadata()
This step populates the
CoreMetadata by extracting relevant values
from the parsed meta structure. |
private void |
populateOMEMetadata()
This step populates the OME
MetadataStore by extracting relevant
values from the parsed meta structure. |
private void |
populateOriginalMetadata()
This steps populates the original metadata table (the tables returned by
FormatReader.getGlobalMetadata() and FormatReader.getSeriesMetadata()). |
private boolean |
positionsMatch(int sizeT,
int sizeP)
Verifies that stage coordinates match for all (P, Z) across time.
|
private PrairieMetadata.Sequence |
sequence(int s)
Gets the first sequence associated with the given series.
|
private PrairieMetadata.Sequence |
sequence(int t,
int s)
Gets the sequence associated with the given series and time point.
|
private PrairieMetadata.Sequence |
sequence(int t,
int p,
int sizeP)
Gets the sequence associated with the given time point and stage position.
|
private void |
warnFile(PrairieMetadata.Sequence sequence,
int index,
int channel)
Emits a warning about a missing
<File>. |
private void |
warnFilename(PrairieMetadata.Sequence sequence,
int index,
int channel)
Emits a warning about a
<File>'s missing filename. |
private void |
warnFrame(PrairieMetadata.Sequence sequence,
int index)
Emits a warning about a missing
<Frame>. |
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, 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, getThumbSizeX, getThumbSizeY, 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, 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 String[] CFG_SUFFIX
public static final String[] ENV_SUFFIX
public static final String[] XML_SUFFIX
public static final String[] PRAIRIE_SUFFIXES
private static final int PRAIRIE_TAG_1
private static final int PRAIRIE_TAG_2
private static final int PRAIRIE_TAG_3
private static final String DATE_FORMAT
private TiffReader tiff
private Location xmlFile
private Location cfgFile
private Location envFile
private PrairieMetadata meta
private ArrayList<PrairieMetadata.Sequence> sequences
Sequences, ordered by cycle.private int[] channels
private boolean[] framesAreTime
Frames as time points rather than focal
planes (i.e., sizeZ and sizeT values inverted).
This situation occurs when the series's first Sequence is labeled
as a "TSeries" (i.e., PrairieMetadata.Sequence.isTimeSeries() returns true), but
there is only one Sequence.
The array length equals the number of series; i.e., it is a parallel array
to FormatReader.core.
private boolean singleTiffMode
FormatReader.setId(java.lang.String) while FormatReader.isGroupFiles() is false.public boolean isSingleFile(String id) throws FormatException, IOException
IFormatReaderisSingleFile in interface IFormatReaderisSingleFile in class FormatReaderFormatExceptionIOExceptionpublic boolean isThisType(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(RandomAccessInputStream stream) throws IOException
IFormatReaderisThisType in interface IFormatReaderisThisType in class FormatReaderIOExceptionpublic int fileGroupOption(String id) throws FormatException, IOException
IFormatReaderfileGroupOption in interface IFormatReaderfileGroupOption in class FormatReaderFormatExceptionIOExceptionpublic String[] getSeriesUsedFiles(boolean noPixels)
IFormatReadergetSeriesUsedFiles in interface IFormatReadergetSeriesUsedFiles in class FormatReaderpublic int getOptimalTileWidth()
IFormatReadergetOptimalTileWidth in interface IFormatReadergetOptimalTileWidth in class FormatReaderpublic int getOptimalTileHeight()
IFormatReadergetOptimalTileHeight in interface IFormatReadergetOptimalTileHeight 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.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 findMetadataFiles()
private void parsePrairieMetadata()
throws FormatException,
IOException
meta.FormatExceptionIOExceptionprivate void populateCoreMetadata()
throws FormatException,
IOException
CoreMetadata by extracting relevant values
from the parsed meta structure.FormatExceptionIOExceptionprivate void populateOriginalMetadata()
FormatReader.getGlobalMetadata() and FormatReader.getSeriesMetadata()).private void populateOMEMetadata()
throws FormatException
MetadataStore by extracting relevant
values from the parsed meta structure.FormatExceptionprivate boolean isMinimumMetadata()
private Document parseDOM(Location file) throws ParserConfigurationException, SAXException, IOException
Document from the data in the given file.private void warnFrame(PrairieMetadata.Sequence sequence, int index)
<Frame>.private void warnFile(PrairieMetadata.Sequence sequence, int index, int channel)
<File>.private void warnFilename(PrairieMetadata.Sequence sequence, int index, int channel)
<File>'s missing filename.private String getPath(PrairieMetadata.PFile file)
PrairieMetadata.PFile.private byte[] blank(byte[] buf)
private PositiveFloat pf(Double value, String name)
private int computeSizeT(int sequenceCount)
private boolean positionsMatch(int sizeT,
int sizeP)
private PrairieMetadata.Sequence sequence(int s)
s - The series (i.e., stage position).Sequence.private PrairieMetadata.Sequence sequence(int t, int s)
t - The time point.s - The series (i.e., stage position).Sequence.private PrairieMetadata.Sequence sequence(int t, int p, int sizeP)
t - The time point.p - The stage position.sizeP - The number of stage positions.Sequence.private int frameIndex(PrairieMetadata.Sequence sequence, int z, int t, int s)
sequence - The sequence from which to extract the frame.z - The focal plane.t - The time point.s - The series (i.e., stage position).PrairieMetadata.Sequence.getFrame(int).Copyright © 2016 Open Microscopy Environment