]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/QT/ImageWidget.cxx
Medialness filters updated.
[cpPlugins.git] / lib / cpExtensions / QT / ImageWidget.cxx
index 7804fe76b213e5342915e416513cb47de64d5cf5..09788440c1bc6fd38931c32f166401932c0ccea1 100644 (file)
@@ -247,12 +247,26 @@ GetImageInterpolation( ) const
 void cpExtensions::QT::ImageWidget::
 SetScalarRange( double r[ 2 ] )
 {
+  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
+  if( actor != NULL )
+  {
+    actor->ConfigureWindowLevel( r[ 0 ], r[ 1 ] );
+    this->Render( );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::ImageWidget::
 SetWindowLevel( double wl[ 2 ] )
 {
+  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
+  if( actor != NULL )
+  {
+    actor->SetWindowLevel( wl[ 0 ], wl[ 1 ] );
+    this->Render( );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -272,6 +286,20 @@ SetImageOpacity( double o )
 void cpExtensions::QT::ImageWidget::
 SetImageInterpolation( unsigned char i )
 {
+  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
+  if( actor != NULL )
+  {
+    int int_type = 0;
+    switch( i )
+    {
+    case 'L': int_type = VTK_LINEAR_INTERPOLATION; break;
+    case 'C': int_type = VTK_CUBIC_INTERPOLATION; break;
+    default : int_type = VTK_NEAREST_INTERPOLATION; break;
+    } // hctiws
+    actor->GetProperty( )->SetInterpolationType( int_type );
+    this->Render( );
+
+  } // fi
 }
 
 #endif // cpExtensions_QT4