X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FRGBImageToOtherChannelsFilter.cxx;h=f06cda81fff5b0c477b35c6ea3e9a9606c3dfe3b;hb=0d184ef7119178103610ad9e9fab83760cb89e06;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..f06cda8 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->_AddOutput< 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 ); } // ------------------------------------------------------------------------- @@ -31,8 +32,7 @@ cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter:: std::string cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter:: _GenerateData( ) { - cpPlugins::Interface::Image* image = - this->GetInput< cpPlugins::Interface::Image >( 0 ); + auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" ); if( image == NULL ) return( "RGBImageToOtherChannelsFilter: No input image." ); @@ -52,7 +52,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; @@ -85,8 +85,7 @@ _RealGD( itk::DataObject* image ) filter->Update( ); // Connect output - cpPlugins::Interface::Image* out = - this->GetOutput< cpPlugins::Interface::Image >( 0 ); + auto out = this->GetOutputData< cpPlugins::Interface::Image >( "Output" ); if( out != NULL ) { out->SetITK< _O >( filter->GetOutput( ) );