changeset 3539:f25e84cc5f87

fix ordered-slices
author Alain Mazy <alain@mazy.be>
date Tue, 15 Oct 2019 12:57:16 +0200
parents 23219b9da4d1
children 096c827cbf9e 551945086617
files OrthancServer/SliceOrdering.cpp
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/SliceOrdering.cpp	Tue Oct 15 09:53:33 2019 +0200
+++ b/OrthancServer/SliceOrdering.cpp	Tue Oct 15 12:57:16 2019 +0200
@@ -331,12 +331,11 @@
 
     sortedInstances_.clear();
 
-    // consider only the instances with a position
+    // consider only the instances with a position and correctly oriented (if they have a normal)
     for (size_t i = 0; i < instances_.size(); i++)
     {
       assert(instances_[i] != NULL);
-
-      if (instances_[i]->HasPosition())
+      if (instances_[i]->HasPosition() && (!instances_[i]->HasNormal() || IsParallelOrOpposite(instances_[i]->GetNormal(), normal_)))
       {
         sortedInstances_.push_back(instances_[i]);
       }