changeset 819:a68cd7ae8838

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 29 May 2019 13:39:31 +0200
parents 68f888812af4
children 270c31978df1
files Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Framework/Oracle/OrthancRestApiCommand.h Framework/Oracle/ThreadedOracle.cpp
diffstat 3 files changed, 21 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Wed May 29 08:36:13 2019 +0200
+++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Wed May 29 13:39:31 2019 +0200
@@ -42,20 +42,22 @@
       DicomVolumeImageMPRSlicer::Slice(*that.volume_, plane),
       that_(that)
     {
-      if (GetProjection() == VolumeProjection_Axial)
+      if (IsValid())
       {
-        // For coronal and sagittal projections, we take the global
-        // revision of the volume because even if a single slice changes,
-        // this means the projection will yield a different result --> 
-        // we must increase the revision as soon as any slice changes 
-        SetRevision(that_.seriesGeometry_.GetSliceRevision(GetSliceIndex()));
-      }
+        if (GetProjection() == VolumeProjection_Axial)
+        {
+          // For coronal and sagittal projections, we take the global
+          // revision of the volume because even if a single slice changes,
+          // this means the projection will yield a different result --> 
+          // we must increase the revision as soon as any slice changes 
+          SetRevision(that_.seriesGeometry_.GetSliceRevision(GetSliceIndex()));
+        }
       
-      if (that_.strategy_.get() != NULL &&
-          IsValid() &&
-          GetProjection() == VolumeProjection_Axial)
-      {
-        that_.strategy_->SetCurrent(GetSliceIndex());
+        if (that_.strategy_.get() != NULL &&
+            GetProjection() == VolumeProjection_Axial)
+        {
+          that_.strategy_->SetCurrent(GetSliceIndex());
+        }
       }
     }
   };
@@ -264,7 +266,7 @@
         std::auto_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand);
         tmp->SetHttpHeader("Accept-Encoding", "gzip");
         tmp->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
-        tmp->SetInstanceUri(instance, slice.GetExpectedPixelFormat());          
+        tmp->SetInstanceUri(instance, slice.GetExpectedPixelFormat());
         tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat());
         command.reset(tmp.release());
       }
--- a/Framework/Oracle/OrthancRestApiCommand.h	Wed May 29 08:36:13 2019 +0200
+++ b/Framework/Oracle/OrthancRestApiCommand.h	Wed May 29 13:39:31 2019 +0200
@@ -95,6 +95,11 @@
 
     void SetBody(const Json::Value& json);
 
+    void SwapBody(std::string& body)
+    {
+      body_.swap(body);
+    }
+
     void SetHttpHeader(const std::string& key,
                        const std::string& value)
     {
--- a/Framework/Oracle/ThreadedOracle.cpp	Wed May 29 08:36:13 2019 +0200
+++ b/Framework/Oracle/ThreadedOracle.cpp	Wed May 29 13:39:31 2019 +0200
@@ -248,7 +248,7 @@
     client.SetTimeout(command.GetTimeout());
 
     CopyHttpHeaders(client, command.GetHttpHeaders());
-
+    
     std::string answer;
     Orthanc::HttpClient::HttpHeaders answerHeaders;
     client.ApplyAndThrowException(answer, answerHeaders);