]> Creatis software - clitk.git/commitdiff
Fixed displayed slice number. Now 0-based and accurate...
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 6 Mar 2014 15:56:45 +0000 (16:56 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 6 Mar 2014 15:56:45 +0000 (16:56 +0100)
vv/vvMainWindow.cxx
vv/vvSlicer.cxx

index d2c732f707baee8022495499f8973304d38994ce..af39d3e15fb1eda8910f965b8d31566d16f93bd2 100644 (file)
@@ -1473,6 +1473,7 @@ void vvMainWindow::InitSlicers()
     mSlicerManagers.back()->SetSlicerWindow(1,NEViewWidget->GetRenderWindow());
     mSlicerManagers.back()->SetSlicerWindow(2,SOViewWidget->GetRenderWindow());
     mSlicerManagers.back()->SetSlicerWindow(3,SEViewWidget->GetRenderWindow());
+    mSlicerManagers.back()->Render(); // SR: displayed #slice is wrong without this
   }
 }
 
index cd65e2fdd722221e3414d39a56d3aa7685490044..dd585636c5a76227817ec14cc8ded56fd548f132 100644 (file)
@@ -1170,7 +1170,6 @@ void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
   this->SetupInteractor(rw->GetInteractor());
   ca->SetImageActor(this->GetImageActor());
   ca->SetWindowLevel(this->GetWindowLevel());
-  ca->SetText(2, "<slice>");
   ca->SetText(3, "<window>\n<level>");
 
   double bounds[6];
@@ -1448,6 +1447,10 @@ void vvSlicer::Render()
                              << std::endl;
     }
     ca->SetText(1,worldPos.str().c_str());
+
+    std::stringstream slicePos;
+    slicePos << "Slice: " << this->GetSlice();
+    ca->SetText(2, slicePos.str().c_str());
   }
 
   if (pdmA->GetVisibility()) {