]> Creatis software - cpPlugins.git/blobdiff - plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx
...
[cpPlugins.git] / plugins / ImageThresholdFilters / BinaryThresholdImageFilter.cxx
index b9eb3e713550b2e6df6a566cd3162777bc46f9e9..12537737b1f1c581a6389aca2646c4a9a4d63ba5 100644 (file)
@@ -1,17 +1,16 @@
-#include <plugins/ImageThresholdFilters/BinaryThresholdImageFilter.h>
+#include <ImageThresholdFilters/BinaryThresholdImageFilter.h>
 #include <cpPlugins/DataObjects/Image.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" );
@@ -34,9 +33,11 @@ cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
-  auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-  else this->_Error( "Invalid input image." );
+  /* TODO
+     auto o = this->GetInputData( "Input" );
+     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
+     else this->_Error( "Invalid input image." );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -44,28 +45,30 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GD0( _TImage* image )
 {
-  typedef unsigned char _TBin;
-  typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage;
-  typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter;
-  typedef typename _TImage::PixelType _TPixel;
+  /* TODO
+     typedef unsigned char _TBin;
+     typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage;
+     typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter;
+     typedef typename _TImage::PixelType _TPixel;
 
-  // Get parameters
-  _TPixel lt = _TPixel( this->m_Parameters.GetReal( "LowerThresholdValue" ) );
-  _TPixel ut = _TPixel( this->m_Parameters.GetReal( "UpperThresholdValue" ) );
-  _TBin iv  = _TBin( this->m_Parameters.GetUint( "InsideValue" ) );
-  _TBin ov = _TBin( this->m_Parameters.GetUint( "OutsideValue" ) );
+     // Get parameters
+     _TPixel lt = _TPixel( this->m_Parameters.GetReal( "LowerThresholdValue" ) );
+     _TPixel ut = _TPixel( this->m_Parameters.GetReal( "UpperThresholdValue" ) );
+     _TBin iv  = _TBin( this->m_Parameters.GetUint( "InsideValue" ) );
+     _TBin ov = _TBin( this->m_Parameters.GetUint( "OutsideValue" ) );
 
-  // Configure filter
-  _TFilter* filter = this->_CreateITK< _TFilter >( );
-  filter->SetInput( image );
-  filter->SetLowerThreshold( lt );
-  filter->SetUpperThreshold( ut );
-  filter->SetInsideValue( iv );
-  filter->SetOutsideValue( ov );
-  filter->Update( );
+     // Configure filter
+     _TFilter* filter = this->_CreateITK< _TFilter >( );
+     filter->SetInput( image );
+     filter->SetLowerThreshold( lt );
+     filter->SetUpperThreshold( ut );
+     filter->SetInsideValue( iv );
+     filter->SetOutsideValue( ov );
+     filter->Update( );
 
-  // Connect output
-  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+     // Connect output
+     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+  */
 }
 
 // eof - $RCSfile$