diff --git a/components/formats-gpl/src/loci/formats/in/OIRReader.java b/components/formats-gpl/src/loci/formats/in/OIRReader.java index 447ae76aa70..cf175479402 100644 --- a/components/formats-gpl/src/loci/formats/in/OIRReader.java +++ b/components/formats-gpl/src/loci/formats/in/OIRReader.java @@ -92,6 +92,7 @@ public class OIRReader extends FormatReader { private transient Double zStart; private transient Double zStep; + private transient Double tStart; private transient Double tStep; private transient HashMap timestampAdjustments = new HashMap(); @@ -277,6 +278,7 @@ public void close(boolean fileOnly) throws IOException { minT = Integer.MAX_VALUE; zStart = null; zStep = null; + tStart = null; tStep = null; } } @@ -603,6 +605,9 @@ else if (!checkSuffix(id, "oir")) { for (int i=0; i= frame) { deltaT += (timestampAdjustments.get(frame) - tStep); @@ -1189,8 +1194,12 @@ private void parseImageProperties(Element root) throws FormatException { Element speed = getFirstChild(getFirstChild(scanner, "lsmimage:param"), "lsmparam:speed"); speed = getFirstChild(speed, "commonparam:speedInformation"); Element seriesInterval = getFirstChild(speed, "commonparam:seriesInterval"); - if (seriesInterval != null) { - tStep = DataTools.parseDouble(seriesInterval.getTextContent()); + + // prefer setting tStep from the TIMELAPSE axis, + // but fall back to this if needed + if (seriesInterval != null && tStep == null) { + // units are seconds, so multiply to get milliseconds + tStep = DataTools.parseDouble(seriesInterval.getTextContent()) * 1000; } } } @@ -1358,6 +1367,8 @@ private void parseAxis(Element dimensionAxis) { else if (name.equals("TIMELAPSE")) { if (m.sizeT <= 1) { m.sizeT = Integer.parseInt(size.getTextContent()); + tStart = DataTools.parseDouble(start.getTextContent()); + tStep = DataTools.parseDouble(step.getTextContent()); } } else if (name.equals("LAMBDA")) {