]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/LightCompensationFilter.hxx
Moved to version 1.0
[cpPlugins.git] / lib / cpExtensions / Algorithms / LightCompensationFilter.hxx
diff --git a/lib/cpExtensions/Algorithms/LightCompensationFilter.hxx b/lib/cpExtensions/Algorithms/LightCompensationFilter.hxx
deleted file mode 100644 (file)
index f75ffcd..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// -------------------------------------------------------------------------
-// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
-// -------------------------------------------------------------------------
-
-#ifndef __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__HXX__
-#define __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__HXX__
-
-#include <itkImageRegionIterator.h>
-#include <itkImageRegionConstIterator.h>
-#include <itkNumericTraits.h>
-
-// -------------------------------------------------------------------------
-template< class I >
-cpExtensions::Algorithms::LightCompensationFilter< I >::
-LightCompensationFilter( )
-  : Superclass( )
-{
-  this->SetNumberOfRequiredInputs( 1 );
-  this->InPlaceOff( );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-cpExtensions::Algorithms::LightCompensationFilter< I >::
-~LightCompensationFilter( )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-void cpExtensions::Algorithms::LightCompensationFilter< I >::
-BeforeThreadedGenerateData( )
-{
-  this->Superclass::BeforeThreadedGenerateData( );
-
-  I* input = const_cast< I* >( this->GetInput( ) );
-
-  typename TMeanCalculator::Pointer mc = TMeanCalculator::New( );
-  mc->Execute( input, input->GetRequestedRegion( ) );
-  this->m_Mean = mc->GetMean( );
-
-  double gm = this->m_Mean[ 0 ] + this->m_Mean[ 1 ] + this->m_Mean[ 2 ];
-  gm /= double( 3 );
-  this->m_Coefficient = this->m_Mean;
-  this->m_Coefficient.Fill( gm );
-  this->m_Coefficient[ 0 ] /= this->m_Mean[ 0 ];
-  this->m_Coefficient[ 1 ] /= this->m_Mean[ 1 ];
-  this->m_Coefficient[ 2 ] /= this->m_Mean[ 2 ];
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-void cpExtensions::Algorithms::LightCompensationFilter< I >::
-ThreadedGenerateData( const TRegion& region, itk::ThreadIdType id )
-{
-  typedef itk::NumericTraits< typename I::PixelType > _TPixelTraits;
-  typedef typename _TPixelTraits::ValueType           _TPixelChannel;
-  typedef itk::NumericTraits< _TPixelChannel >        _TChannelTraits;
-  static const double max_value = double( _TChannelTraits::max( ) );
-
-  itk::ImageRegionConstIterator< I > iIt( this->GetInput( ), region );
-  itk::ImageRegionIterator< I > oIt( this->GetOutput( ), region );
-
-  iIt.GoToBegin( );
-  oIt.GoToBegin( );
-  for( ; !iIt.IsAtEnd( ); ++iIt, ++oIt )
-  {
-    double r = double( iIt.Get( )[ 0 ] ) * this->m_Coefficient[ 0 ];
-    double g = double( iIt.Get( )[ 1 ] ) * this->m_Coefficient[ 1 ];
-    double b = double( iIt.Get( )[ 2 ] ) * this->m_Coefficient[ 2 ];
-
-    if( r > max_value ) r = max_value;
-    if( g > max_value ) g = max_value;
-    if( b > max_value ) b = max_value;
-
-    typename I::PixelType pix;
-    pix.SetRed( _TPixelChannel( r ) );
-    pix.SetGreen( _TPixelChannel( g ) );
-    pix.SetBlue( _TPixelChannel( b ) );
-
-    oIt.Set( pix );
-
-  } // rof
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-void cpExtensions::Algorithms::LightCompensationFilter< I >::
-AfterThreadedGenerateData( )
-{
-  this->Superclass::AfterThreadedGenerateData( );
-}
-
-#endif // __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__HXX__
-
-// eof - $RCSfile$