]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.cxx
Modified overlay image actor to use a blending which takes the maximum per color...
[clitk.git] / vv / vvSlicer.cxx
index b0cc72182fac99fad643da1cea6277e1e0f637a9..1de1738c030f39925a49c96fe740945d07bea407 100644 (file)
@@ -34,6 +34,7 @@
 #include <vtkImageMapToWindowLevelColors.h>
 #include <vtkImageData.h>
 #include <vtkImageActor.h>
+#include <vvBlendImageActor.h>
 #include <vtkToolkits.h>
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
@@ -88,6 +89,7 @@ vvSlicer::vvSlicer()
   mSubSampling = 5;
   mScale = 1;
   mVFLog = 0;
+  mVFWidth = 1;
 
   std::string text = "F1 = sagital; F2 = coronal; F3 = axial\n";
   text += "F5 = horizontal flip; F6 = vertical flip\n\n";
@@ -154,7 +156,7 @@ vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper() {
 
 
 //------------------------------------------------------------------------------
-vtkImageActor* vvSlicer::GetOverlayActor() {
+vvBlendImageActor* vvSlicer::GetOverlayActor() {
   return mOverlayActor.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -322,7 +324,7 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay)
 
       if (!mOverlayActor)
         {
-          mOverlayActor = vtkImageActor::New();
+          mOverlayActor = vvBlendImageActor::New();
           mOverlayActor->SetInput(mOverlayMapper->GetOutput());
           mOverlayActor->SetPickable(0);
           mOverlayActor->SetVisibility(false);
@@ -443,6 +445,7 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
         mVFActor = vtkActor::New();
       mVFActor->SetMapper(mVFMapper);
       mVFActor->SetPickable(0);
+      mVFActor->GetProperty()->SetLineWidth(mVFWidth);
       this->UpdateDisplayExtent();
       this->GetRenderer()->AddActor(mVFActor);
 
@@ -565,6 +568,17 @@ void vvSlicer::SetVFScale(int scale)
 }
 //------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
+void vvSlicer::SetVFWidth(int width)
+{
+  mVFWidth = width;
+  if (mVFActor)
+    mVFActor->GetProperty()->SetLineWidth(mVFWidth);
+  UpdateDisplayExtent();
+  Render();
+}
+//------------------------------------------------------------------------------
+
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVFLog(int log)
@@ -1242,8 +1256,8 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
 //----------------------------------------------------------------------------
 void vvSlicer::Render()
 {
-  //  DD("Render");
-  //DD(SliceOrientation);
+  //  DD("vvSlicer::Render");
+  // DD(SliceOrientation);
   if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion)
     {
       legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());