X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FImageBooleanFilters%2FAndImageFilter.cxx;h=27194ae2eac408417345efc110d6f5c7685326d7;hb=683fd9cb190ab6835d4c8b58eb2823dd8fbe0b8e;hp=130791977fbdb0e48a4999869fd732a4bf8c20d4;hpb=6bd5a267c827df95f0c1c8f8c0af0f918bf2b31c;p=cpPlugins.git diff --git a/plugins/ImageBooleanFilters/AndImageFilter.cxx b/plugins/ImageBooleanFilters/AndImageFilter.cxx index 1307919..27194ae 100644 --- a/plugins/ImageBooleanFilters/AndImageFilter.cxx +++ b/plugins/ImageBooleanFilters/AndImageFilter.cxx @@ -1,17 +1,19 @@ -#include +#include #include +#include #include -#include // ------------------------------------------------------------------------- cpPluginsImageBooleanFilters::AndImageFilter:: AndImageFilter( ) : Superclass( ) { - this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input0", true, false ); - this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input1", true, false ); - this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" ); + typedef cpPlugins::DataObjects::Image _TImage; + + this->_ConfigureInput< _TImage >( "Input1", true, false ); + this->_ConfigureInput< _TImage >( "Input2", true, false ); + this->_ConfigureOutput< _TImage >( "Output" ); } // ------------------------------------------------------------------------- @@ -24,26 +26,26 @@ cpPluginsImageBooleanFilters::AndImageFilter:: void cpPluginsImageBooleanFilters::AndImageFilter:: _GenerateData( ) { - auto o = this->GetInputData( "Input0" ); - cpPlugins_Demangle_ImageIntegers_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); + auto o = this->GetInputData( "Input1" ); + cpPlugins_Demangle_Image_IntPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- template< class _TImage > void cpPluginsImageBooleanFilters::AndImageFilter:: -_GD0( _TImage* image0 ) +_GD0( _TImage* image1 ) { typedef itk::AndImageFilter< _TImage, _TImage > _TFilter; - auto image1 = this->GetInputData< _TImage >( "Input1" ); - if( image1 == NULL ) + auto image2 = this->GetInputData< _TImage >( "Input2" ); + if( image2 == NULL ) this->_Error( "Incompatible second input image." ); // Configure filter auto filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( 0, image0 ); - filter->SetInput( 1, image1 ); + filter->SetInput1( image1 ); + filter->SetInput2( image2 ); filter->Update( ); // Connect output