]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/RGBImageToHSVChannelsFilter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / RGBImageToHSVChannelsFilter.cxx
index 339a818f8fc358cc941332f5199e4297f8515684..166dfee3875b4b7f414a8cd4b81224b55da5f4bd 100644 (file)
@@ -1,6 +1,7 @@
 #include <cpPlugins/Plugins/RGBImageToHSVChannelsFilter.h>
 #include <cpPlugins/Interface/Image.h>
-#include <cpPlugins/Extensions/Algorithms/RGBImageToHSVChannelsFilter.h>
+#include <cpPlugins/Extensions/Algorithms/RGBImageToOtherChannelsFilter.h>
+#include <cpPlugins/Extensions/Algorithms/RGBToHSVFunction.h>
 
 #define ITK_MANUAL_INSTANTIATION
 #include <itkImage.h>
@@ -18,7 +19,6 @@
     )                                                                   \
     r = this->f< p, d >( )
 
-
 // -------------------------------------------------------------------------
 std::string cpPlugins::Plugins::RGBImageToHSVChannelsFilter::
 GetClassName( ) const
@@ -37,7 +37,7 @@ RGBImageToHSVChannelsFilter( )
   this->_MakeOutput< cpPlugins::Interface::Image >( 1 );
   this->_MakeOutput< cpPlugins::Interface::Image >( 2 );
 
-  this->m_DefaultParameters.clear( );
+  this->m_DefaultParameters.Clear( );
 }
 
 // -------------------------------------------------------------------------
@@ -89,8 +89,9 @@ _GD1( )
 {
   typedef itk::Image< itk::RGBPixel< P >, D > _TImage;
   typedef itk::Image< P, D > _TChannel;
+  typedef cpPlugins::Extensions::Algorithms::RGBToHSVFunction< P > _TFunction;
   typedef cpPlugins::Extensions::Algorithms::
-    RGBImageToHSVChannelsFilter< _TImage, _TChannel > _TFilter;
+    RGBImageToOtherChannelsFilter< _TImage, _TChannel, _TFunction > _TFilter;
 
   // Filter creation
   _TFilter* filter =
@@ -105,9 +106,9 @@ _GD1( )
   filter->SetInput( dynamic_cast< _TImage* >( this->_GetInput( 0 ) ) );
   filter->Update( );
 
-  this->_SetOutput( 0, filter->GetHueOutput( ) );
-  this->_SetOutput( 1, filter->GetSaturationOutput( ) );
-  this->_SetOutput( 2, filter->GetValueOutput( ) );
+  this->_SetOutput( 0, filter->GetChannel1( ) );
+  this->_SetOutput( 1, filter->GetChannel2( ) );
+  this->_SetOutput( 2, filter->GetChannel3( ) );
 
   return( "" );
 }