X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FWindowLevelImageActor.cxx;fp=lib%2FcpExtensions%2FVisualization%2FWindowLevelImageActor.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=c7cbbd43ee53ff8d5e62cf7c0166936aae9f9b2b;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/WindowLevelImageActor.cxx b/lib/cpExtensions/Visualization/WindowLevelImageActor.cxx deleted file mode 100644 index c7cbbd4..0000000 --- a/lib/cpExtensions/Visualization/WindowLevelImageActor.cxx +++ /dev/null @@ -1,200 +0,0 @@ -#include -#include - -#include -#include - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::WindowLevelImageActor:: -Self* cpExtensions::Visualization::WindowLevelImageActor:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -vtkImageData* cpExtensions::Visualization::WindowLevelImageActor:: -GetImage( ) -{ - return( this->m_Mapper->GetInput( ) ); -} - -// ------------------------------------------------------------------------- -const vtkImageData* cpExtensions::Visualization::WindowLevelImageActor:: -GetImage( ) const -{ - return( this->m_Mapper->GetInput( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetImage( vtkImageData* image ) -{ - this->m_Mapper->SetInputData( image ); - this->ResetRange( ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::WindowLevelImageActor:: -GetLevel( ) const -{ - Self* self = const_cast< Self* >( this ); - return( self->GetProperty( )->GetColorLevel( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::WindowLevelImageActor:: -GetWindow( ) const -{ - Self* self = const_cast< Self* >( this ); - return( self->GetProperty( )->GetColorWindow( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -GetWindowLevel( double wl[ 2 ] ) const -{ - Self* self = const_cast< Self* >( this ); - wl[ 0 ] = self->GetProperty( )->GetColorWindow( ); - wl[ 1 ] = self->GetProperty( )->GetColorLevel( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -ResetWindowLevel( ) -{ - this->SetWindowLevel( - ( this->m_Range[ 1 ] - this->m_Range[ 0 ] ), - ( this->m_Range[ 1 ] + this->m_Range[ 0 ] ) / double( 2 ) - ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetLevel( double l ) -{ - double ol = this->GetProperty( )->GetColorLevel( ); - if( l != ol && this->m_Range[ 0 ] <= l && l <= this->m_Range[ 1 ] ) - { - this->GetProperty( )->SetColorLevel( l ); - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetWindow( double w ) -{ - double mw = this->m_Range[ 1 ] - this->m_Range[ 0 ]; - double ow = this->GetProperty( )->GetColorWindow( ); - if( w != ow && double( 0 ) <= w && w <= mw ) - { - this->GetProperty( )->SetColorWindow( w ); - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetWindowLevel( double w, double l ) -{ - this->SetWindow( w ); - this->SetLevel( l ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetWindowLevel( double wl[ 2 ] ) -{ - this->SetWindow( wl[ 0 ] ); - this->SetLevel( wl[ 1 ] ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::WindowLevelImageActor:: -GetMinimum( ) const -{ - return( this->m_Range[ 0 ] ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::WindowLevelImageActor:: -GetMaximum( ) const -{ - return( this->m_Range[ 0 ] ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -GetRange( double r[ 2 ] ) const -{ - r[ 0 ] = this->m_Range[ 0 ]; - r[ 1 ] = this->m_Range[ 1 ]; -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -ResetRange( ) -{ - this->GetImage( )->GetScalarRange( this->m_Range ); - this->ResetWindowLevel( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetMinimum( double a ) -{ - if( this->m_Range[ 0 ] != a ) - { - this->m_Range[ 0 ] = a; - this->ResetWindowLevel( ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetMaximum( double b ) -{ - if( this->m_Range[ 1 ] != b ) - { - this->m_Range[ 1 ] = b; - this->ResetWindowLevel( ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetRange( double a, double b ) -{ - this->SetMinimum( a ); - this->SetMaximum( b ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::WindowLevelImageActor:: -SetRange( double r[ 2 ] ) -{ - this->SetMinimum( r[ 0 ] ); - this->SetMaximum( r[ 1 ] ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::WindowLevelImageActor:: -WindowLevelImageActor( ) - : Superclass( ) -{ - this->m_Range[ 0 ] = this->m_Range[ 1 ] = double( 0 ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::WindowLevelImageActor:: -~WindowLevelImageActor( ) -{ -} - -// eof - $RCSfile$