]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx
Widget integration (step 3/6). WARNING: IT DOES NOT COMPILE YET
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / OtsuThresholdImageFilter.cxx
index 6e0d36fa29b72d8ee354129fbf3c45f82df53f0d..de924a67b9da78b90c68a2de89ef1984a8cf2a84 100644 (file)
@@ -43,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 = "OtsuThresholdImageFilter: Input image type not supported.";
   return( r );
 }
@@ -59,7 +53,7 @@ _GenerateData( )
 // -------------------------------------------------------------------------
 template< class I >
 std::string cpPlugins::BasicFilters::OtsuThresholdImageFilter::
-_DemangleOutput( itk::DataObject* image )
+_GD0( itk::DataObject* image )
 {
   return(
     this->_RealGD< I, itk::Image< unsigned char, I::ImageDimension > >(
@@ -83,13 +77,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->SetNumberOfHistogramBins( bins );
   filter->SetInsideValue( in_val );
@@ -101,7 +89,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