diff Framework/Volumes/ImageBuffer3D.cpp @ 105:e0ddd8cad909 wasm

cleaning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Jun 2017 12:33:24 +0200
parents 4a541cd4fa83
children 53025eecbc95
line wrap: on
line diff
--- 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)