]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageInteractorStyle.cxx
Segmentation and WindowLevel interaction updated
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageInteractorStyle.cxx
index ab3fee37ca5406985b43cb651b2b7c521002d90c..b784808ede8fbff1b1a0ff37e3402a7018724748 100644 (file)
@@ -402,8 +402,8 @@ WindowLevel( )
       this->WindowLevelCurrentPosition[ 1 ]
       ) / double( size[ 1 ] );
 
-    double w = this->WindowLevelInitial[ 0 ] * ( double( 1 ) + sw );
-    double l = this->WindowLevelInitial[ 1 ] * ( double( 1 ) + sl );
+    double w = this->WindowLevelInitial[ 0 ] + ( sw * 1000.0 );
+    double l = this->WindowLevelInitial[ 1 ] + ( sl * 1000.0 );
     double minw = this->m_MPRActors->GetMinWindow( 0 );
     double maxw = this->m_MPRActors->GetMaxWindow( 0 );
     double minl = this->m_MPRActors->GetMinLevel( 0 );
@@ -414,8 +414,7 @@ WindowLevel( )
     if( l < minl ) l = minl;
     if( maxl < l ) l = maxl;
 
-    this->m_MPRActors->SetWindow( 0, w );
-    this->m_MPRActors->SetLevel( 0, l );
+    this->m_MPRActors->SetWindowLevel( 0, w, l );
     this->Interactor->Render( );
     this->_RenderAssociateInteractors( );
   }