changeset 988:4c9b4c4de814 toa2019090901

Fixed bug in DicomStructureSet that prevented points from being added to polygons
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 09 Sep 2019 16:15:28 +0200
parents d225bccd4d4a
children 9f8aaafc372a
files Framework/Toolbox/DicomStructureSet.cpp Framework/Toolbox/DicomStructureSet.h Framework/Toolbox/DicomStructureSet2.cpp Framework/Toolbox/DicomStructureSet2.h
diffstat 4 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Toolbox/DicomStructureSet.cpp	Mon Sep 09 15:18:24 2019 +0200
+++ b/Framework/Toolbox/DicomStructureSet.cpp	Mon Sep 09 16:15:28 2019 +0200
@@ -149,7 +149,7 @@
     }
   }
 
-  bool DicomStructureSet::Polygon::IsPointOnSlice(const Vector& v) const
+  bool DicomStructureSet::Polygon::IsPointOnSliceIfAny(const Vector& v) const
   {
     if (hasSlice_)
     {
@@ -171,7 +171,7 @@
     }
     else
     {
-      return false;
+      return true;
     }
   }
 
@@ -179,7 +179,7 @@
   {
 #if 1
     // BGO 2019-09-03
-    if (IsPointOnSlice(v))
+    if (IsPointOnSliceIfAny(v))
     {
       points_.push_back(v);
     }
@@ -217,7 +217,7 @@
         
         for (Points::const_iterator it = points_.begin(); it != points_.end(); ++it)
         {
-          if (IsPointOnSlice(*it))
+          if (IsPointOnSliceIfAny(*it))
           {
             double x, y;
             geometry.ProjectPoint(x, y, *it);
--- a/Framework/Toolbox/DicomStructureSet.h	Mon Sep 09 15:18:24 2019 +0200
+++ b/Framework/Toolbox/DicomStructureSet.h	Mon Sep 09 16:15:28 2019 +0200
@@ -73,7 +73,7 @@
       Extent2D            extent_;
 
       void CheckPointIsOnSlice(const Vector& v) const;
-      bool IsPointOnSlice(const Vector& v) const;
+      bool IsPointOnSliceIfAny(const Vector& v) const;
 
     public:
       Polygon(const std::string& sopInstanceUid) :
--- a/Framework/Toolbox/DicomStructureSet2.cpp	Mon Sep 09 15:18:24 2019 +0200
+++ b/Framework/Toolbox/DicomStructureSet2.cpp	Mon Sep 09 16:15:28 2019 +0200
@@ -149,7 +149,7 @@
     }
   }
 
-  bool DicomStructureSet2::Polygon::IsPointOnSlice(const Vector& v) const
+  bool DicomStructureSet2::Polygon::IsPointOnSliceIfAny(const Vector& v) const
   {
     if (hasSlice_)
     {
@@ -179,7 +179,7 @@
   {
 #if 1
     // BGO 2019-09-03
-    if (IsPointOnSlice(v))
+    if (IsPointOnSliceIfAny(v))
     {
       points_.push_back(v);
     }
@@ -217,7 +217,7 @@
         
         for (Points::const_iterator it = points_.begin(); it != points_.end(); ++it)
         {
-          if (IsPointOnSlice(*it))
+          if (IsPointOnSliceIfAny(*it))
           {
             double x, y;
             geometry.ProjectPoint(x, y, *it);
--- a/Framework/Toolbox/DicomStructureSet2.h	Mon Sep 09 15:18:24 2019 +0200
+++ b/Framework/Toolbox/DicomStructureSet2.h	Mon Sep 09 16:15:28 2019 +0200
@@ -73,7 +73,7 @@
       Extent2D            extent_;
 
       void CheckPointIsOnSlice(const Vector& v) const;
-      bool IsPointOnSlice(const Vector& v) const;
+      bool IsPointOnSliceIfAny(const Vector& v) const;
 
     public:
       Polygon(const std::string& sopInstanceUid) :