]> Creatis software - cpPlugins.git/commitdiff
Some minor visualization bugs.
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 13 Sep 2016 01:52:58 +0000 (20:52 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 13 Sep 2016 01:52:58 +0000 (20:52 -0500)
lib/cpExtensions/Algorithms/GradientImageFunctionBase.hxx
lib/cpExtensions/QT/MPR3DWidget.cxx
lib/cpExtensions/Visualization/MPR3DActors.cxx
lib/cpExtensions/Visualization/MPR3DActors.h

index 95681bd390525855af50fe8e4784e664eba28add..a858650ea2da60e6f9129ee1c8af537abd25d2c8 100644 (file)
@@ -36,7 +36,7 @@ EvaluateAtIndex( const TIndex& i ) const
   if( eval )
     return( this->_Evaluate( i ) );
   else
-    return( TOutput( 0 ) );
+    return( TOutput( -1 ) );
 }
 
 // -------------------------------------------------------------------------
index 3d5d50882ce915c98eb9b9c3b3c02af980f3fa39..f0331c0d287ae404d232d61ed1753dafc2bd30f9 100644 (file)
@@ -121,24 +121,32 @@ SetSlicesNumbers( int x, int y, int z )
 void cpExtensions::QT::MPR3DWidget::
 SetScalarRange( double r[ 2 ] )
 {
+  this->m_Actors->SetScalarRange( r );
+  this->Render( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::MPR3DWidget::
 SetWindowLevel( double wl[ 2 ] )
 {
+  this->m_Actors->SetWindowLevel( wl );
+  this->Render( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::MPR3DWidget::
 SetImageOpacity( double o )
 {
+  this->m_Actors->SetImageOpacity( o );
+  this->Render( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::MPR3DWidget::
 SetImageInterpolation( unsigned char i )
 {
+  this->m_Actors->SetImageInterpolation( i );
+  this->Render( );
 }
 
 #endif // cpExtensions_QT4
index 1c0d325854a77f56bd5c0488fbca2f2fee591094..a63e272990cfade8cdb488a5eae13b85f2bf5df0 100644 (file)
@@ -3,6 +3,7 @@
 #include <cpExtensions/Visualization/LUTImageActor.h>
 #include <cpExtensions/Visualization/WindowLevelImageActor.h>
 #include <vtkActor.h>
+#include <vtkImageProperty.h>
 #include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
@@ -127,6 +128,49 @@ AddMesh( vtkPolyData* mesh )
   return( actor.GetActor( ) );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPR3DActors::
+SetScalarRange( double r[ 2 ] )
+{
+  this->m_Slices[ 0 ]->
+    GetWindowLevelImageActor( )->ConfigureWindowLevel( r[ 0 ], r[ 1 ] );
+  this->m_Slices[ 1 ]->
+    GetWindowLevelImageActor( )->ConfigureWindowLevel( r[ 0 ], r[ 1 ] );
+  this->m_Slices[ 2 ]->
+    GetWindowLevelImageActor( )->ConfigureWindowLevel( r[ 0 ], r[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPR3DActors::
+SetWindowLevel( double wl[ 2 ] )
+{
+  this->m_Slices[ 0 ]->
+    GetWindowLevelImageActor( )->SetWindowLevel( wl[ 0 ], wl[ 1 ] );
+  this->m_Slices[ 1 ]->
+    GetWindowLevelImageActor( )->SetWindowLevel( wl[ 0 ], wl[ 1 ] );
+  this->m_Slices[ 2 ]->
+    GetWindowLevelImageActor( )->SetWindowLevel( wl[ 0 ], wl[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPR3DActors::
+SetImageOpacity( double o )
+{
+  this->m_Slices[ 0 ]->GetWindowLevelImageActor( )->
+    GetProperty( )->SetOpacity( o );
+  this->m_Slices[ 1 ]->GetWindowLevelImageActor( )->
+    GetProperty( )->SetOpacity( o );
+  this->m_Slices[ 2 ]->GetWindowLevelImageActor( )->
+    GetProperty( )->SetOpacity( o );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPR3DActors::
+SetImageInterpolation( unsigned char i )
+{
+  // TODO
+}
+
 // -------------------------------------------------------------------------
 cpExtensions::Visualization::MPR3DActors::
 MPR3DActors( )
index bc02490bee92da8463372c7f8bacce37fcb4a632..07c41babbc0e2eff395e91342a0128737015e793 100644 (file)
@@ -57,6 +57,11 @@ namespace cpExtensions
 
       virtual vtkActor* AddMesh( vtkPolyData* mesh );
 
+      void SetScalarRange( double r[ 2 ] );
+      void SetWindowLevel( double wl[ 2 ] );
+      void SetImageOpacity( double o );
+      void SetImageInterpolation( unsigned char i );
+
     protected:
       MPR3DActors( );
       virtual ~MPR3DActors( );