X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FBinaryThresholdImageFilter.cxx;h=10704aac29d1681c8abf57d9bd31b68d396ff5dd;hb=a4bc3b8e36e91e45f37a3b7eecb5789c635aa5c0;hp=ea7c965184579ad6a01033ce59d1f29d36c2dbac;hpb=72853b99e3ec514e82859f47b390be4dc2958d0b;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx b/lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx index ea7c965..10704aa 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx @@ -8,8 +8,6 @@ cpPlugins::BasicFilters::BinaryThresholdImageFilter:: BinaryThresholdImageFilter( ) : Superclass( ) { - this->m_ClassName = "cpPlugins::BasicFilters::BinaryThresholdImageFilter"; - this->m_ClassCategory = "ImageToImageFilter"; this->SetNumberOfInputs( 1 ); this->SetNumberOfOutputs( 1 ); this->_MakeOutput< cpPlugins::Interface::Image >( 0 ); @@ -45,15 +43,9 @@ _GenerateData( ) itk::DataObject* itk_image = NULL; std::string r = ""; - cpPlugins_Image_Input_Demangle_Dimension_AllScalarTypes( - 2, image, itk_image, r, _DemangleOutput - ); - else cpPlugins_Image_Input_Demangle_Dimension_AllScalarTypes( - 3, image, itk_image, r, _DemangleOutput - ); - else cpPlugins_Image_Input_Demangle_Dimension_AllScalarTypes( - 4, image, itk_image, r, _DemangleOutput - ); + cpPlugins_Image_Demangle_AllScalarTypes( 2, image, itk_image, r, _GD0 ); + else cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 ); + else cpPlugins_Image_Demangle_AllScalarTypes( 4, image, itk_image, r, _GD0 ); else r = "BinaryThresholdImageFilter: Input image type not supported."; return( r ); } @@ -61,7 +53,7 @@ _GenerateData( ) // ------------------------------------------------------------------------- template< class I > std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter:: -_DemangleOutput( itk::DataObject* image ) +_GD0( itk::DataObject* image ) { return( this->_RealGD< I, itk::Image< unsigned char, I::ImageDimension > >( @@ -88,13 +80,7 @@ _RealGD( itk::DataObject* image ) _OP out_val = _OP( this->m_Parameters.GetValueAsReal( "OutsideValue" ) ); // Configure filter - _F* filter = dynamic_cast< _F* >( this->m_RealProcessObject.GetPointer( ) ); - if( filter == NULL ) - { - this->m_RealProcessObject = _F::New( ); - filter = dynamic_cast< _F* >( this->m_RealProcessObject.GetPointer( ) ); - - } // fi + _F* filter = this->_CreateITK< _F >( ); filter->SetInput( dynamic_cast< I* >( image ) ); filter->SetLowerThreshold( lower_val ); filter->SetUpperThreshold( upper_val ); @@ -107,7 +93,7 @@ _RealGD( itk::DataObject* image ) this->GetOutput< cpPlugins::Interface::Image >( 0 ); if( out != NULL ) { - out->SetITKImage< O >( filter->GetOutput( ) ); + out->SetITK< O >( filter->GetOutput( ) ); return( "" ); } else