]> Creatis software - cpPlugins.git/blobdiff - plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx
...
[cpPlugins.git] / plugins / ImageDistanceMaps / SignedMaurerDistanceMapImageFilter.cxx
index 89b52f7ca8a86694ee8437059bb1cf33064e8f84..237e15a07847d5bafb386c972e3eb38f1c2816e5 100644 (file)
@@ -14,10 +14,10 @@ SignedMaurerDistanceMapImageFilter( )
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "BackgroundValue" );
-  this->m_Parameters.ConfigureAsBool( "InsideIsPositive" );
-  this->m_Parameters.ConfigureAsBool( "SquaredDistance" );
-  this->m_Parameters.ConfigureAsBool( "UseImageSpacing" );
+  this->m_Parameters.ConfigureAsReal( "BackgroundValue", 0 );
+  this->m_Parameters.ConfigureAsBool( "InsideIsPositive", true );
+  this->m_Parameters.ConfigureAsBool( "SquaredDistance", false );
+  this->m_Parameters.ConfigureAsBool( "UseImageSpacing", true );
 
   std::vector< std::string > choices;
 #ifdef cpPlugins_CONFIG_REAL_TYPES_float
@@ -27,11 +27,6 @@ SignedMaurerDistanceMapImageFilter( )
   choices.push_back( "double" );
 #endif // cpPlugins_CONFIG_REAL_TYPES_double
   this->m_Parameters.ConfigureAsChoices( "OutputResolution", choices );
-
-  this->m_Parameters.SetReal( "BackgroundValue", 0 );
-  this->m_Parameters.SetBool( "InsideIsPositive", true );
-  this->m_Parameters.SetBool( "SquaredDistance", false );
-  this->m_Parameters.SetBool( "UseImageSpacing", true );
 }
 
 // -------------------------------------------------------------------------
@@ -45,7 +40,7 @@ void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_Image_VisualDims_1( o, _GD0 )
+  cpPlugins_Demangle_Image_ScalarPixels_VisualDims_1( o, _GD0 )
     this->_Error( "Invalid input image dimension." );
 }
 
@@ -53,30 +48,21 @@ _GenerateData( )
 template< class _TImage >
 void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
 _GD0( _TImage* image )
-{
-  cpPlugins_Demangle_Image_ScalarPixels_1( image, _GD1, _TImage::ImageDimension )
-    this->_Error( "Invalid input image pixel type." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TImage >
-void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
-_GD1( _TImage* image )
 {
   std::string out_res =
     this->m_Parameters.GetSelectedChoice( "OutputResolution" );
 #ifdef cpPlugins_CONFIG_REAL_TYPES_float
-  if( out_res == "float" ) this->_GD2< _TImage, float >( image );
+  if( out_res == "float" ) this->_GD1< _TImage, float >( image );
 #endif // cpPlugins_CONFIG_REAL_TYPES_float
 #ifdef cpPlugins_CONFIG_REAL_TYPES_double
-  if( out_res == "double" ) this->_GD2< _TImage, double >( image );
+  if( out_res == "double" ) this->_GD1< _TImage, double >( image );
 #endif // cpPlugins_CONFIG_REAL_TYPES_double
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage, class _TScalar >
 void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
-_GD2( _TImage* image )
+_GD1( _TImage* image )
 {
   typedef itk::Image< _TScalar, _TImage::ImageDimension >  _TDMap;
   typedef