X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FRGBImageToOtherChannelsFilter.cxx;h=13e6732abc1bd7410ffd31e00ccbc321b3294613;hb=d6f15d4cb764982e2b09060a9c0f38636891590c;hp=5282f602b4f44f439e55216dc88dd27286d5cc52;hpb=f2f39f66027a98bd8dac50bade5618e0136bbefa;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx b/lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx index 5282f60..13e6732 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx @@ -13,12 +13,13 @@ RGBImageToOtherChannelsFilter( ) { typedef cpPlugins::Interface::Parameters TParameters; - this->SetNumberOfInputs( 1 ); - this->SetNumberOfOutputs( 1 ); - this->_MakeOutput< cpPlugins::Interface::Image >( 0 ); + this->_AddInput( "Input" ); + this->_MakeOutput< cpPlugins::Interface::Image >( "Output" ); - this->m_DefaultParameters.Configure( TParameters::String, "OutChannel" ); - this->m_Parameters = this->m_DefaultParameters; + std::vector< std::string > choices; + choices.push_back( "HSV" ); + choices.push_back( "YPbPr" ); + this->m_Parameters->ConfigureAsChoices( "OutChannel", choices ); } // ------------------------------------------------------------------------- @@ -32,7 +33,7 @@ std::string cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter:: _GenerateData( ) { cpPlugins::Interface::Image* image = - this->GetInput< cpPlugins::Interface::Image >( 0 ); + this->GetInput< cpPlugins::Interface::Image >( "Input" ); if( image == NULL ) return( "RGBImageToOtherChannelsFilter: No input image." ); @@ -52,7 +53,7 @@ _GD0( itk::DataObject* image ) { typedef typename I::PixelType _P; - std::string outc = this->m_Parameters.GetValueAsString( "OutChannel" ); + std::string outc = this->m_Parameters->GetSelectedChoice( "OutChannel" ); std::string r = ""; using namespace cpExtensions::Algorithms; @@ -86,7 +87,7 @@ _RealGD( itk::DataObject* image ) // Connect output cpPlugins::Interface::Image* out = - this->GetOutput< cpPlugins::Interface::Image >( 0 ); + this->GetOutput< cpPlugins::Interface::Image >( "Output" ); if( out != NULL ) { out->SetITK< _O >( filter->GetOutput( ) );