#include #include #include // ------------------------------------------------------------------------- cpPluginsImageFilters::OrImageFilter:: OrImageFilter( ) : Superclass( ) { this->_AddInput( "Input0" ); this->_AddInput( "Input1" ); this->_AddOutput< cpPlugins::Image >( "Output" ); } // ------------------------------------------------------------------------- cpPluginsImageFilters::OrImageFilter:: ~OrImageFilter( ) { } // ------------------------------------------------------------------------- std::string cpPluginsImageFilters::OrImageFilter:: _GenerateData( ) { auto image = this->GetInputData( "Input0" )->GetITK< itk::DataObject >( ); std::string cpPlugin_Image_Demangle_Pixel_AllInts( r, _GD0, image, 2 ); if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllInts( r, _GD0, image, 3 ); if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllInts( r, _GD0, image, 1 ); if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllInts( r, _GD0, image, 4 ); return( r ); } // ------------------------------------------------------------------------- template< class _TImage > std::string cpPluginsImageFilters::OrImageFilter:: _GD0( _TImage* image0 ) { typedef itk::OrImageFilter< _TImage, _TImage > _TFilter; if( image0 != NULL ) { auto image1 = this->GetInputData( "Input1" )->GetITK< _TImage >( ); if( image1 != NULL ) { // Configure filter auto filter = this->_CreateITK< _TFilter >( ); filter->SetInput( 0, image0 ); filter->SetInput( 1, image1 ); filter->Update( ); // Connect output this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); return( "" ); } else return( "ImageFilters::OrImageFilter: No valid second input image." ); } else return( "ImageFilters::OrImageFilter: No valid first input image." ); } // eof - $RCSfile$