RGBImageToOtherChannelsFilter( )
: Superclass( )
{
- typedef cpPlugins::Interface::Parameters TParameters;
-
this->_AddInput( "Input" );
- this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+ this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
std::vector< std::string > choices;
choices.push_back( "HSV" );
std::string cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter::
_GenerateData( )
{
- cpPlugins::Interface::Image* image =
- this->GetInput< cpPlugins::Interface::Image >( "Input" );
- if( image == NULL )
- return( "RGBImageToOtherChannelsFilter: No input image." );
-
+ auto image = this->GetInputData( "Input" );
itk::DataObject* itk_image = NULL;
std::string r = "";
cpPlugins_Image_Demangle_AllRGBTypes( 2, image, itk_image, r, _GD0 );
filter->Update( );
// Connect output
- cpPlugins::Interface::Image* out =
- this->GetOutput< cpPlugins::Interface::Image >( "Output" );
- if( out != NULL )
- {
- out->SetITK< _O >( filter->GetOutput( ) );
- return( "" );
- }
- else
- return( "RGBImageToOtherChannelsFilter: output not correctly created." );
-
+ auto out = this->GetOutputData( "Output" );
+ out->SetITK( filter->GetOutput( ) );
return( "" );
}