changeset 363:54ae0577f5bb am-2

fix anisotropic pixel spacing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Oct 2018 18:55:52 +0100
parents 12cec26d08ce
children aad2f9293089
files Applications/Samples/SingleFrameEditorApplication.h Framework/Toolbox/GeometryToolbox.cpp
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/SingleFrameEditorApplication.h	Tue Oct 30 18:30:48 2018 +0100
+++ b/Applications/Samples/SingleFrameEditorApplication.h	Tue Oct 30 18:55:52 2018 +0100
@@ -2787,8 +2787,9 @@
         (widget.IsInvert() ? "MONOCHROME1" : "MONOCHROME2");
 
 
+      // WARNING: The order of PixelSpacing is Y/X
       char buf[32];
-      sprintf(buf, "%0.08f\\%0.08f", pixelSpacingX, pixelSpacingY);
+      sprintf(buf, "%0.08f\\%0.08f", pixelSpacingY, pixelSpacingX);
       
       json["Tags"][Orthanc::DICOM_TAG_PIXEL_SPACING.Format()] = buf;
 
--- a/Framework/Toolbox/GeometryToolbox.cpp	Tue Oct 30 18:30:48 2018 +0100
+++ b/Framework/Toolbox/GeometryToolbox.cpp	Tue Oct 30 18:55:52 2018 +0100
@@ -260,8 +260,9 @@
         }
         else
         {
-          spacingX = v[0];
-          spacingY = v[1];
+          // WARNING: X/Y are swapped (Y comes first)
+          spacingX = v[1];
+          spacingY = v[0];
         }
       }
       else