Skip to content

Commit

Permalink
Prairie: add better checks for time series data
Browse files Browse the repository at this point in the history
See #8579.
  • Loading branch information
melissalinkert committed Apr 19, 2012
1 parent 4d81baa commit 6c37c93
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/bio-formats/src/loci/formats/in/PrairieReader.java
Expand Up @@ -106,6 +106,8 @@ public class PrairieReader extends FormatReader {

private Double zoom;

private boolean timeSeries = false;

// -- Constructor --

/** Constructs a new Prairie TIFF reader. */
Expand Down Expand Up @@ -257,6 +259,7 @@ public void close(boolean fileOnly) throws IOException {
zoom = null;
waitTime = null;
relativeTimes.clear();
timeSeries = false;
}
}

Expand Down Expand Up @@ -306,6 +309,11 @@ else if (checkSuffix(id, CFG_SUFFIX)) {
if (checkSuffix(id, XML_SUFFIX)) {
core[0].sizeT = getImageCount() / (getSizeZ() * getSizeC());

if (timeSeries && getSizeT() == 1 && getSizeZ() > 1) {
core[0].sizeT = getSizeZ();
core[0].sizeZ = 1;
}

files = new String[f.size()];
f.copyInto(files);
if (tiff == null) {
Expand Down Expand Up @@ -488,6 +496,10 @@ public void startElement(String uri, String localName, String qName,
if (qName.equals("PVScan")) {
date = attributes.getValue("date");
}
else if (qName.equals("Sequence")) {
String type = attributes.getValue("type");
timeSeries = "TSeries Timed Element".equals(type);
}
else if (qName.equals("Frame")) {
String index = attributes.getValue("index");
if (index != null) {
Expand Down

1 comment on commit 6c37c93

@melissalinkert
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test, run the automated tests on the 'prairie' directory as described in http://trac.openmicroscopy.org.uk/ome/wiki/BioFormats-CommitTesting

Please sign in to comment.