changeset 103:d5396fcd80bb refactoring

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 30 Nov 2015 12:04:23 +0100
parents 21123729ac71
children 83d4afba88ff
files Plugin/DecodedImageAdapter.cpp
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/DecodedImageAdapter.cpp	Mon Nov 30 11:02:50 2015 +0100
+++ b/Plugin/DecodedImageAdapter.cpp	Mon Nov 30 12:04:23 2015 +0100
@@ -33,6 +33,7 @@
 #include <json/writer.h>
 #include <boost/regex.hpp>
 
+
 namespace OrthancPlugins
 {
   bool DecodedImageAdapter::ParseUri(CompressionType& type,
@@ -168,7 +169,7 @@
     {
       try
       {
-        return boost::lexical_cast<float>(tmp);
+        return boost::lexical_cast<float>(Orthanc::Toolbox::StripSpaces(tmp));
       }
       catch (boost::bad_lexical_cast&)
       {
@@ -231,7 +232,7 @@
     }
 
     float slope = GetFloatTag(tags, "0028,1053", 1.0f);
-    float intercept = GetFloatTag(tags, "0028,1052", 1.0f);
+    float intercept = GetFloatTag(tags, "0028,1052", 0.0f);
 
     result["slope"] = slope;
     result["intercept"] = intercept;
@@ -251,8 +252,8 @@
       {
         try
         {
-          result["columnPixelSpacing"] = boost::lexical_cast<float>(tokens[1]);
-          result["rowPixelSpacing"] = boost::lexical_cast<float>(tokens[0]);
+          result["columnPixelSpacing"] = boost::lexical_cast<float>(Orthanc::Toolbox::StripSpaces(tokens[1]));
+          result["rowPixelSpacing"] = boost::lexical_cast<float>(Orthanc::Toolbox::StripSpaces(tokens[0]));
           ok = true;
         }
         catch (boost::bad_lexical_cast&)