Skip to content

Commit

Permalink
Merge pull request #4253 from melissalinkert/operetta-physical-z-size
Browse files Browse the repository at this point in the history
Operetta/Phenix: calculate physical Z size in micrometers
  • Loading branch information
sbesson authored Nov 8, 2024
2 parents 808ffe5 + 2ebb04c commit 6a548c9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -729,11 +729,10 @@ else if (!checkSuffix(pathName, "tiff") &&
FormatTools.getPhysicalSizeY(first.resolutionY), i);

if (getSizeZ() > 1 && last != null) {
Unit<Length> 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);
}
}
}
Expand Down

0 comments on commit 6a548c9

Please sign in to comment.