diff OrthancStone/Sources/Toolbox/DicomStructureSet.cpp @ 1905:e318b524ad3f

use UnionOfRectangles algorithm to render RT-STRUCT
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 31 Jan 2022 18:50:35 +0100
parents 738814c24574
children affde38b84de
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/DicomStructureSet.cpp	Mon Jan 31 18:22:57 2022 +0100
+++ b/OrthancStone/Sources/Toolbox/DicomStructureSet.cpp	Mon Jan 31 18:50:35 2022 +0100
@@ -900,7 +900,7 @@
       {
         double x1, y1, x2, y2;
 
-        if (polygon->Project(x1, y1, x2, y2, slice))
+        if (polygon->Project(x1, y1, x2, y2, slice, GetEstimatedNormal(), GetEstimatedSliceThickness()))
         {
           projected.push_back(CreateRectangle(x1, y1, x2, y2));
         }
@@ -921,10 +921,8 @@
         }
       }  
 
-#elif 0
+#elif 1
 
-      // TODO - Fix possible infinite loop in UnionOfRectangles
-      
       std::list<Extent2D> rectangles;
       
       for (Polygons::const_iterator polygon = structure.polygons_.begin();
@@ -932,7 +930,7 @@
       {
         double x1, y1, x2, y2;
 
-        if (polygon->Project(x1, y1, x2, y2, slice))
+        if (polygon->Project(x1, y1, x2, y2, slice, GetEstimatedNormal(), GetEstimatedSliceThickness()))
         {
           rectangles.push_back(Extent2D(x1, y1, x2, y2));
         }