From 2ebb04c5c0501594d8f83d54ac35aa8f7eef0745 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Wed, 6 Nov 2024 21:09:49 -0600 Subject: [PATCH] Operetta/Phenix: calculate physical Z size in micrometers Fixes #4240. --- .../formats-gpl/src/loci/formats/in/OperettaReader.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/formats-gpl/src/loci/formats/in/OperettaReader.java b/components/formats-gpl/src/loci/formats/in/OperettaReader.java index f6b89db3df4..e719b2a0142 100644 --- a/components/formats-gpl/src/loci/formats/in/OperettaReader.java +++ b/components/formats-gpl/src/loci/formats/in/OperettaReader.java @@ -729,11 +729,10 @@ else if (!checkSuffix(pathName, "tiff") && FormatTools.getPhysicalSizeY(first.resolutionY), i); if (getSizeZ() > 1 && last != null) { - Unit firstZUnit = first.positionZ.unit(); - double firstZ = first.positionZ.value().doubleValue(); - double lastZ = last.positionZ.value(firstZUnit).doubleValue(); + double firstZ = first.positionZ.value(UNITS.MICROMETER).doubleValue(); + double lastZ = last.positionZ.value(UNITS.MICROMETER).doubleValue(); double averageStep = (lastZ - firstZ) / (getSizeZ() - 1); - store.setPixelsPhysicalSizeZ(FormatTools.getPhysicalSizeZ(averageStep, firstZUnit), i); + store.setPixelsPhysicalSizeZ(FormatTools.getPhysicalSizeZ(averageStep, UNITS.MICROMETER), i); } } }