]> Creatis software - cpPlugins.git/blobdiff - plugins/ImageParaMorphologyFilters/BinaryDilateParaImageFilter.cxx
...
[cpPlugins.git] / plugins / ImageParaMorphologyFilters / BinaryDilateParaImageFilter.cxx
index 3f11eaeb1044eff8ae214fc611bf95d1f6746827..17dedfdcf3df6acf8209b947946aeb771e0f1b93 100644 (file)
@@ -1,13 +1,8 @@
 #include <ImageParaMorphologyFilters/BinaryDilateParaImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 
-/* TODO
-   #include <itkBinaryDilateParaImageFilter.h>
-   #include <itkBinaryDilateParaImageFilter.hxx>
-   #include <itkBinaryThresholdImageFilter.hxx>
-   #include <itkUnaryFunctorImageFilter.hxx>
-   #include <itkParabolicErodeDilateImageFilter.hxx>
-*/
+#include <itkBinaryDilateParaImageFilter.h>
 
 // -------------------------------------------------------------------------
 cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter::
@@ -18,13 +13,9 @@ BinaryDilateParaImageFilter( )
 
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
-  this->m_Parameters.ConfigureAsReal( "Radius" );
-  this->m_Parameters.ConfigureAsBool( "Circular" );
-  this->m_Parameters.ConfigureAsBool( "UseImageSpacing" );
-
-  this->m_Parameters.SetReal( "Radius", 3 );
-  this->m_Parameters.SetBool( "Circular", true );
-  this->m_Parameters.SetBool( "UseImageSpacing", false );
+  this->m_Parameters.ConfigureAsReal( "Radius", 3 );
+  this->m_Parameters.ConfigureAsBool( "Circular", true );
+  this->m_Parameters.ConfigureAsBool( "UseImageSpacing", false );
 }
 
 // -------------------------------------------------------------------------
@@ -37,11 +28,9 @@ cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter::
 void cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-     else this->_Error( "No valid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "No valid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -49,17 +38,15 @@ template< class _TImage >
 void cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef itk::BinaryDilateParaImageFilter< _TImage > _TFilter;
-
-     auto filter = this->_CreateITK< _TFilter >( );
-     filter->SetInput( image );
-     filter->SetRadius( this->m_Parameters.GetReal( "Radius" ) );
-     filter->SetCircular( this->m_Parameters.GetBool( "Circular" ) );
-     filter->SetUseImageSpacing( this->m_Parameters.GetBool( "UseImageSpacing" ) );
-     filter->Update( );
-     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-  */
+  typedef itk::BinaryDilateParaImageFilter< _TImage > _TFilter;
+
+  auto filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetRadius( this->m_Parameters.GetReal( "Radius" ) );
+  filter->SetCircular( this->m_Parameters.GetBool( "Circular" ) );
+  filter->SetUseImageSpacing( this->m_Parameters.GetBool( "UseImageSpacing" ) );
+  filter->Update( );
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$