changeset 105:e0ddd8cad909 wasm

cleaning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Jun 2017 12:33:24 +0200
parents eccd64f8e297
children 6a7c702a7531
files Applications/Samples/SingleVolumeApplication.h Framework/Volumes/ImageBuffer3D.cpp Framework/Volumes/ImageBuffer3D.h
diffstat 3 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/SingleVolumeApplication.h	Thu Jun 01 10:33:49 2017 +0200
+++ b/Applications/Samples/SingleVolumeApplication.h	Thu Jun 01 12:33:24 2017 +0200
@@ -100,10 +100,7 @@
         std::auto_ptr<OrthancVolumeImage> volume(new OrthancVolumeImage(context.GetWebService()));
         volume->ScheduleLoadSeries(series);
 
-        {
-          std::auto_ptr<VolumeImageSource> source(new VolumeImageSource(*volume));
-          widget->AddLayer(source.release());
-        }
+        widget->AddLayer(new VolumeImageSource(*volume));
 
         context.AddInteractor(new VolumeImageInteractor(*volume, *widget, projection));
         context.AddVolume(volume.release());
@@ -114,18 +111,10 @@
         std::auto_ptr<OrthancVolumeImage> pet(new OrthancVolumeImage(context.GetWebService()));
         pet->ScheduleLoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e");
 
+        widget->AddLayer(new VolumeImageSource(*ct));
+        widget->AddLayer(new VolumeImageSource(*pet));
+        
         context.AddInteractor(new VolumeImageInteractor(*pet, *widget, projection));
-
-        {
-          std::auto_ptr<VolumeImageSource> source(new VolumeImageSource(*ct));
-          widget->AddLayer(source.release());
-        }
-
-        {
-          std::auto_ptr<VolumeImageSource> source(new VolumeImageSource(*pet));
-          widget->AddLayer(source.release());
-        }
-
         context.AddVolume(ct.release());
         context.AddVolume(pet.release());
 
--- a/Framework/Volumes/ImageBuffer3D.cpp	Thu Jun 01 10:33:49 2017 +0200
+++ b/Framework/Volumes/ImageBuffer3D.cpp	Thu Jun 01 12:33:24 2017 +0200
@@ -22,6 +22,7 @@
 #include "ImageBuffer3D.h"
 
 #include "../../Resources/Orthanc/Core/Images/ImageProcessing.h"
+#include "../../Resources/Orthanc/Core/Logging.h"
 #include "../../Resources/Orthanc/Core/OrthancException.h"
 
 #include <string.h>
@@ -119,6 +120,9 @@
     depth_(depth)
   {
     GeometryToolbox::AssignVector(voxelDimensions_, 1, 1, 1);
+
+    LOG(INFO) << "Created an image of "
+              << (GetEstimatedMemorySize() / (1024ll * 1024ll)) << "MB";
   }
 
 
@@ -255,6 +259,12 @@
   }
     
 
+  uint64_t ImageBuffer3D::GetEstimatedMemorySize() const
+  {
+    return image_.GetPitch() * image_.GetHeight() * Orthanc::GetBytesPerPixel(format_);
+  }
+
+
   ImageBuffer3D::SliceReader::SliceReader(ImageBuffer3D& that,
                                           VolumeProjection projection,
                                           unsigned int slice)
--- a/Framework/Volumes/ImageBuffer3D.h	Thu Jun 01 10:33:49 2017 +0200
+++ b/Framework/Volumes/ImageBuffer3D.h	Thu Jun 01 12:33:24 2017 +0200
@@ -92,6 +92,8 @@
 
     ParallelSlices* GetGeometry(VolumeProjection projection);
     
+    uint64_t GetEstimatedMemorySize() const;
+
 
     class SliceReader : public boost::noncopyable
     {