diff Framework/Volumes/ImageBuffer3D.cpp @ 735:c3bbb130abc4

removing dependencies in ImageBuffer3D
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 16:15:06 +0200
parents be3671662eec
children 32eaf4929b08
line wrap: on
line diff
--- a/Framework/Volumes/ImageBuffer3D.cpp	Tue May 21 15:20:04 2019 +0200
+++ b/Framework/Volumes/ImageBuffer3D.cpp	Tue May 21 16:15:06 2019 +0200
@@ -21,8 +21,6 @@
 
 #include "ImageBuffer3D.h"
 
-#include "../Toolbox/GeometryToolbox.h"
-
 #include <Core/Images/ImageProcessing.h>
 #include <Core/Logging.h>
 #include <Core/OrthancException.h>
@@ -118,8 +116,6 @@
     computeRange_(computeRange),
     hasRange_(false)
   {
-    geometry_.SetSize(width, height, depth);
-
     LOG(INFO) << "Created a 3D image of size " << width << "x" << height
               << "x" << depth << " in " << Orthanc::EnumerationToString(format)
               << " (" << (GetEstimatedMemorySize() / (1024ll * 1024ll)) << "MB)";
@@ -132,63 +128,6 @@
   }
 
 
-
-
-  ParallelSlices* ImageBuffer3D::GetGeometry(VolumeProjection projection) const
-  {
-    const Vector dimensions = geometry_.GetVoxelDimensions(VolumeProjection_Axial);
-    const CoordinateSystem3D& axial = geometry_.GetAxialGeometry();
-    
-    std::auto_ptr<ParallelSlices> result(new ParallelSlices);
-
-    switch (projection)
-    {
-      case VolumeProjection_Axial:
-        for (unsigned int z = 0; z < depth_; z++)
-        {
-          Vector origin = axial.GetOrigin();
-          origin += static_cast<double>(z) * dimensions[2] * axial.GetNormal();
-
-          result->AddSlice(origin,
-                           axial.GetAxisX(),
-                           axial.GetAxisY());
-        }
-        break;
-
-      case VolumeProjection_Coronal:
-        for (unsigned int y = 0; y < height_; y++)
-        {
-          Vector origin = axial.GetOrigin();
-          origin += static_cast<double>(y) * dimensions[1] * axial.GetAxisY();
-          origin += static_cast<double>(depth_ - 1) * dimensions[2] * axial.GetNormal();
-
-          result->AddSlice(origin,
-                           axial.GetAxisX(),
-                           -axial.GetNormal());
-        }
-        break;
-
-      case VolumeProjection_Sagittal:
-        for (unsigned int x = 0; x < width_; x++)
-        {
-          Vector origin = axial.GetOrigin();
-          origin += static_cast<double>(x) * dimensions[0] * axial.GetAxisX();
-          origin += static_cast<double>(depth_ - 1) * dimensions[2] * axial.GetNormal();
-
-          result->AddSlice(origin,
-                           axial.GetAxisY(),
-                           -axial.GetNormal());
-        }
-        break;
-
-      default:
-        throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
-    }
-
-    return result.release();
-  }
-
-
   uint64_t ImageBuffer3D::GetEstimatedMemorySize() const
   {
     return image_.GetPitch() * image_.GetHeight() * Orthanc::GetBytesPerPixel(format_);