]> Creatis software - cpPlugins.git/blobdiff - plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx
...
[cpPlugins.git] / plugins / ImageThresholdFilters / BinaryThresholdImageFilter.cxx
index b9eb3e713550b2e6df6a566cd3162777bc46f9e9..0fddf92b30bc91468f031f836ae098256e9872fd 100644 (file)
@@ -1,27 +1,22 @@
-#include <plugins/ImageThresholdFilters/BinaryThresholdImageFilter.h>
+#include <ImageThresholdFilters/BinaryThresholdImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 
 #include <itkBinaryThresholdImageFilter.h>
-#include <itkBinaryThresholdImageFilter.hxx>
-#include <itkUnaryFunctorImageFilter.hxx>
 
 // -------------------------------------------------------------------------
 cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 BinaryThresholdImageFilter( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
-  this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" );
+  typedef cpPlugins::DataObjects::Image _TImage;
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "LowerThresholdValue" );
-  this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" );
-  this->m_Parameters.ConfigureAsUint( "InsideValue" );
-  this->m_Parameters.ConfigureAsUint( "OutsideValue" );
-
-  this->m_Parameters.SetReal( "LowerThresholdValue", 0 );
-  this->m_Parameters.SetReal( "UpperThresholdValue", 10000 );
-  this->m_Parameters.SetUint( "InsideValue", 1 );
-  this->m_Parameters.SetUint( "OutsideValue", 0 );
+  this->m_Parameters.ConfigureAsReal( "LowerThresholdValue", 0 );
+  this->m_Parameters.ConfigureAsReal( "UpperThresholdValue", 10000 );
+  this->m_Parameters.ConfigureAsUint( "InsideValue", 1 );
+  this->m_Parameters.ConfigureAsUint( "OutsideValue", 0 );
 }
 
 // -------------------------------------------------------------------------
@@ -35,8 +30,8 @@ void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-  else this->_Error( "Invalid input image." );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------