diff Framework/Deprecated/Loaders/OrthancSeriesVolumeProgressiveLoader.h @ 1327:4f8db2d202c8 broker

OrthancSeriesProgressiveLoader now has two modes that can be selected at object creation : - progressive (will first load jpeg50, then jpeg90 then PAM) - non-progressive (will directly load PAM (uncompressed)) Please note that the slice loading order remains dynamic and depending upon the slice that the client code wishes to extract from the volume.
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 25 Mar 2020 14:34:27 +0100
parents 7702ad9b7011
children
line wrap: on
line diff
--- a/Framework/Deprecated/Loaders/OrthancSeriesVolumeProgressiveLoader.h	Tue Mar 24 21:32:35 2020 +0100
+++ b/Framework/Deprecated/Loaders/OrthancSeriesVolumeProgressiveLoader.h	Wed Mar 25 14:34:27 2020 +0100
@@ -38,9 +38,6 @@
 
 #include <boost/shared_ptr.hpp>
 
-#define USE_SINGLE_QUALITY 1
-
-
 namespace OrthancStone
 {
   class ILoadersContext;
@@ -59,15 +56,10 @@
     public IGeometryProvider
   {
   private:
-#if USE_SINGLE_QUALITY
-    static const unsigned int SINGLE_QUALITY = 0;
-#else
-    static const unsigned int LOW_QUALITY = 0;
-    static const unsigned int MIDDLE_QUALITY = 1;
-    static const unsigned int BEST_QUALITY = 2;
-#endif
-
-    
+    static const unsigned int QUALITY_00 = 0;
+    static const unsigned int QUALITY_01 = 1;
+    static const unsigned int QUALITY_02 = 2;
+        
     class ExtractedSlice;
     
     /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */
@@ -119,32 +111,34 @@
 
     void LoadBestQualitySliceContent(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message);
 
-#if USE_SINGLE_QUALITY
-#else
     void LoadJpegSliceContent(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message);
-#endif
 
-    OrthancStone::ILoadersContext&                loadersContext_;
+    OrthancStone::ILoadersContext&  loadersContext_;
     bool                                          active_;
+    bool                                          progressiveQuality_;
     unsigned int                                  simultaneousDownloads_;
     SeriesGeometry                                seriesGeometry_;
-    boost::shared_ptr<OrthancStone::DicomVolumeImage>           volume_;
+    boost::shared_ptr<OrthancStone::DicomVolumeImage> volume_;
     std::unique_ptr<OrthancStone::IFetchingItemsSorter::IFactory> sorter_;
-    std::unique_ptr<OrthancStone::IFetchingStrategy>              strategy_;
-    std::vector<unsigned int>                     slicesQuality_;
-    bool                                          volumeImageReadyInHighQuality_;
-
-
+    std::unique_ptr<OrthancStone::IFetchingStrategy> strategy_;
+    std::vector<unsigned int>     slicesQuality_;
+    bool                          volumeImageReadyInHighQuality_;
+    
     OrthancSeriesVolumeProgressiveLoader(
       OrthancStone::ILoadersContext& loadersContext,
-      const boost::shared_ptr<OrthancStone::DicomVolumeImage>& volume);
+      boost::shared_ptr<OrthancStone::DicomVolumeImage> volume,
+      bool progressiveQuality);
   
   public:
     ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeImageReadyInHighQuality, OrthancSeriesVolumeProgressiveLoader);
 
+    /**
+    See doc for the progressiveQuality_ field
+    */
     static boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> Create(
       OrthancStone::ILoadersContext& context,
-      const boost::shared_ptr<OrthancStone::DicomVolumeImage>& volume);
+      boost::shared_ptr<OrthancStone::DicomVolumeImage> volume,
+      bool progressiveQuality = false);
 
     virtual ~OrthancSeriesVolumeProgressiveLoader();