|
36 | 36 | import java.util.Objects;
|
37 | 37 | import javax.xml.parsers.ParserConfigurationException;
|
38 | 38 |
|
| 39 | +import loci.common.Constants; |
39 | 40 | import loci.common.DataTools;
|
40 | 41 | import loci.common.DateTools;
|
41 | 42 | import loci.common.Location;
|
@@ -1198,8 +1199,8 @@ private void parseImageProperties(Element root) throws FormatException {
|
1198 | 1199 | // prefer setting tStep from the TIMELAPSE axis,
|
1199 | 1200 | // but fall back to this if needed
|
1200 | 1201 | if (seriesInterval != null && tStep == null) {
|
1201 |
| - // units are seconds, so multiply to get milliseconds |
1202 |
| - tStep = DataTools.parseDouble(seriesInterval.getTextContent()) * 1000; |
| 1202 | + // units are expected to be milliseconds |
| 1203 | + tStep = DataTools.parseDouble(seriesInterval.getTextContent()); |
1203 | 1204 | }
|
1204 | 1205 | }
|
1205 | 1206 | }
|
@@ -1367,8 +1368,12 @@ private void parseAxis(Element dimensionAxis) {
|
1367 | 1368 | else if (name.equals("TIMELAPSE")) {
|
1368 | 1369 | if (m.sizeT <= 1) {
|
1369 | 1370 | m.sizeT = Integer.parseInt(size.getTextContent());
|
1370 |
| - tStart = DataTools.parseDouble(start.getTextContent()); |
1371 |
| - tStep = DataTools.parseDouble(step.getTextContent()); |
| 1371 | + // units are expected to be seconds, multiply to get milliseconds |
| 1372 | + tStart = DataTools.parseDouble(start.getTextContent()) * 1000; |
| 1373 | + double stepValue = DataTools.parseDouble(step.getTextContent()); |
| 1374 | + if (stepValue > Constants.EPSILON) { |
| 1375 | + tStep = stepValue * 1000; |
| 1376 | + } |
1372 | 1377 | }
|
1373 | 1378 | }
|
1374 | 1379 | else if (name.equals("LAMBDA")) {
|
|
0 commit comments