]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
Widget integration (step 3/6). WARNING: IT DOES NOT COMPILE YET
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / BinaryThresholdImageFilter.cxx
index ea7c965184579ad6a01033ce59d1f29d36c2dbac..1a257a68ef346a0f46962f676c5537b7c2fccf5f 100644 (file)
@@ -45,15 +45,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 +55,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 +82,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 +95,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