# HG changeset patch # User Benjamin Golinvaux # Date 1568038528 -7200 # Node ID 4c9b4c4de8145efe91e2f4c1dc2a7c56a8ffd21f # Parent d225bccd4d4a8b7a4e2f2696bd07921df88c3e9b Fixed bug in DicomStructureSet that prevented points from being added to polygons diff -r d225bccd4d4a -r 4c9b4c4de814 Framework/Toolbox/DicomStructureSet.cpp --- 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); diff -r d225bccd4d4a -r 4c9b4c4de814 Framework/Toolbox/DicomStructureSet.h --- 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) : diff -r d225bccd4d4a -r 4c9b4c4de814 Framework/Toolbox/DicomStructureSet2.cpp --- 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); diff -r d225bccd4d4a -r 4c9b4c4de814 Framework/Toolbox/DicomStructureSet2.h --- 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) :