diff Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 819:a68cd7ae8838

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 29 May 2019 13:39:31 +0200
parents 68f888812af4
children 2b4b6b86520a
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());
       }