diff Framework/Toolbox/CoordinateSystem3D.cpp @ 122:e3433dabfb8d wasm

refactoring DicomStructureSet
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Oct 2017 17:25:08 +0200
parents 2eca030792aa
children e2fe9352f240
line wrap: on
line diff
--- a/Framework/Toolbox/CoordinateSystem3D.cpp	Wed Oct 04 17:53:47 2017 +0200
+++ b/Framework/Toolbox/CoordinateSystem3D.cpp	Fri Oct 06 17:25:08 2017 +0200
@@ -121,7 +121,23 @@
     {
       SetupCanonical();
     }
-  }   
+  }
+
+
+  CoordinateSystem3D::CoordinateSystem3D(const Orthanc::DicomMap& dicom)
+  {
+    std::string a, b;
+
+    if (dicom.CopyToString(a, Orthanc::DICOM_TAG_IMAGE_POSITION_PATIENT, false) &&
+        dicom.CopyToString(b, Orthanc::DICOM_TAG_IMAGE_ORIENTATION_PATIENT, false))
+    {
+      Setup(a, b);
+    }
+    else
+    {
+      SetupCanonical();
+    }    
+  }
 
 
   Vector CoordinateSystem3D::MapSliceToWorldCoordinates(double x,