]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 1 Nov 2016 22:14:52 +0000 (17:14 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 1 Nov 2016 22:14:52 +0000 (17:14 -0500)
42 files changed:
lib/Instances/BaseObjects.i
lib/Instances/CMakeLists.txt
lib/Instances/ImageComplexFilters.i [new file with mode: 0644]
lib/cpExtensions/Algorithms/GradientImageFunctionBase.h
lib/cpPlugins/BaseObjects/Parameters.cxx
lib/cpPlugins/BaseObjects/Parameters.h
lib/cpPlugins/BaseObjects/Widget.cxx
lib/cpPlugins/DataObjects/Image.d
lib/cpPlugins/QT/OpenFileDialog.cxx [new file with mode: 0644]
lib/cpPlugins/QT/OpenFileDialog.h [new file with mode: 0644]
lib/cpPlugins/QT/SaveFileDialog.cxx [new file with mode: 0644]
lib/cpPlugins/QT/SaveFileDialog.h [new file with mode: 0644]
plugins/AnisotropicDiffusion/CurvatureAnisotropicDiffusionImageFilter.cxx
plugins/CMakeLists.txt
plugins/GenericFilters/PolyLineParametricPathToSimple3DCurve.cxx
plugins/IO/ImageReader.cxx
plugins/IO/ImageReaderQDialog.h [deleted file]
plugins/IO/ImageWriter.cxx
plugins/IO/ImageWriterQDialog.h [deleted file]
plugins/IO/MeshWriter.cxx
plugins/IO/MeshWriter.h
plugins/ImageArithmeticFilters/PowImageFilter.cxx
plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx
plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx
plugins/ImageGenericFilters/RescaleIntensityImageFilter.cxx
plugins/ImageGradientFilters/FluxImageFilter.cxx
plugins/ImageGradientFilters/GulsunTekImageFilter.cxx
plugins/ImageGradientFilters/GulsunTekImageFilter.h
plugins/ImageGradientFilters/ImageGradientFilters.i [new file with mode: 0644]
plugins/ImageGradientFilters/MFluxImageFilter.cxx
plugins/ImageGradientFilters/MultiScaleGaussianImageFilter.cxx
plugins/ImageMeshFilters/RasterMeshFilter.cxx
plugins/ImageParaMorphologyFilters/BinaryDilateParaImageFilter.cxx
plugins/ImageParaMorphologyFilters/BinaryErodeParaImageFilter.cxx
plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i [new file with mode: 0644]
plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx
plugins/ImageThresholdFilters/ImageThresholdFilters.i
plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.cxx
plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx
plugins/MeshSources/CylinderSource.cxx
plugins/MeshSources/SphereSource.cxx
plugins/Widgets/SplineWidget.cxx

index 384aad50b346213b815c21aaf922df70c1d884b2..88d6266f5c8debf845b665f87aa10b45567ffba3 100644 (file)
@@ -24,7 +24,7 @@ instances itk::SymmetricEigenAnalysis< itk::Matrix< #real_types#, #process_dims#
 
 instances itk::SimpleDataObjectDecorator< #scalar_pixels# >
 
-define my_vectors=Vector;Point
+define my_vectors=FixedArray;Vector;Point
 
 minstances #_export_# std::ostream& itk::operator<< < #real_types#, #process_dims# >( std::ostream& a, itk::#my_vectors#< #real_types#, #process_dims# > const& b )
 
index aaa936e4fa0bfc4396b4fddfe02381b0f5f03858..8ede413fdaaec1ddf2753fa7052dfbd9d0bf670d 100644 (file)
@@ -5,6 +5,7 @@ SET(
   ImageIterators
   ImageNeighborhoodIterators
   ImageFiltersBases
+  ImageComplexFilters
   BoundingBoxes
   Meshes
   )
@@ -28,6 +29,7 @@ TARGET_LINK_LIBRARIES(cpInstances_SimpleImages cpInstances_BaseObjects)
 TARGET_LINK_LIBRARIES(cpInstances_ImageIterators cpInstances_SimpleImages)
 TARGET_LINK_LIBRARIES(cpInstances_ImageNeighborhoodIterators cpInstances_SimpleImages)
 TARGET_LINK_LIBRARIES(cpInstances_ImageFiltersBases cpInstances_SimpleImages)
+TARGET_LINK_LIBRARIES(cpInstances_ImageComplexFilters cpInstances_ImageFiltersBases cpInstances_ImageIterators)
 TARGET_LINK_LIBRARIES(cpInstances_BoundingBoxes cpInstances_BaseObjects)
 TARGET_LINK_LIBRARIES(cpInstances_Meshes cpInstances_BoundingBoxes)
 
diff --git a/lib/Instances/ImageComplexFilters.i b/lib/Instances/ImageComplexFilters.i
new file mode 100644 (file)
index 0000000..167c0f5
--- /dev/null
@@ -0,0 +1,15 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+cinclude itkCovariantVector.h
+
+tinclude itkImageToImageFilter:h|hxx
+tinclude itkInPlaceImageFilter:h|hxx
+tinclude itkRecursiveSeparableImageFilter:h|hxx
+
+instances itk::ImageToImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
+instances itk::ImageToImageFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::RecursiveSeparableImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+
+instances itk::InPlaceImageFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
+
+** eof - $RCSfile$
index f6d3e5cef804e1faa4da31c444fb15fc5b0b213b..73504954b9870664b98f460d9a048c3d56a5b6c1 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__
 #define __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__
 
+#include <cpExtensions/Config.h>
+#include <itkImage.h>
 #include <itkImageFunction.h>
 
 namespace cpExtensions
index e77c2cc16475cd0d77e68d320544ad8919130e34..d55278661dc18c0c6d1b77ce2b8635607b5c8c49 100644 (file)
@@ -349,12 +349,24 @@ GetRawParameters( ) const
 // -------------------------------------------------------------------------
 #define cpPlugins_BaseObjects_Parameters_Configure_Code( Y )            \
   void cpPlugins::BaseObjects::Parameters::                             \
-  ConfigureAs##Y( const std::string& name )                             \
-  { this->_Configure< Y >( name ); }                                    \
+  ConfigureAs##Y( const std::string& name, const T##Y& init )           \
+  {                                                                     \
+    this->_Configure< Y >( name );                                      \
+    this->Set##Y( name, init );                                         \
+  }                                                                     \
   bool cpPlugins::BaseObjects::Parameters::                             \
   Has##Y( const std::string& name ) const                               \
   { return( this->_Has< Y >( name ) ); }
 
+// -------------------------------------------------------------------------
+#define cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Y )        \
+  void cpPlugins::BaseObjects::Parameters::                             \
+  ConfigureAs##Y##List( const std::string& name )                       \
+  { this->_Configure< Y##List >( name ); }                              \
+  bool cpPlugins::BaseObjects::Parameters::                             \
+  Has##Y##List( const std::string& name ) const                         \
+  { return( this->_Has< Y##List >( name ) ); }
+
 // -------------------------------------------------------------------------
 #define cpPlugins_BaseObjects_Parameters_GetSet_Code( Y )               \
   cpPlugins::BaseObjects::Parameters::T##Y                              \
@@ -390,15 +402,16 @@ cpPlugins_BaseObjects_Parameters_Configure_Code( Real );
 cpPlugins_BaseObjects_Parameters_Configure_Code( OpenFileName );
 cpPlugins_BaseObjects_Parameters_Configure_Code( SaveFileName );
 cpPlugins_BaseObjects_Parameters_Configure_Code( PathName );
-cpPlugins_BaseObjects_Parameters_Configure_Code( StringList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( BoolList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( IntList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( UintList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( RealList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( OpenFileNameList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( SaveFileNameList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( PathNameList );
-cpPlugins_BaseObjects_Parameters_Configure_Code( Choices );
+
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( String );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Bool );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Int );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Uint );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Real );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( OpenFileName );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( SaveFileName );
+cpPlugins_BaseObjects_Parameters_ConfigureList_Code( PathName );
+
 cpPlugins_BaseObjects_Parameters_GetSet_Code( Bool );
 cpPlugins_BaseObjects_Parameters_GetSet_Code( Int );
 cpPlugins_BaseObjects_Parameters_GetSet_Code( Uint );
@@ -406,15 +419,92 @@ cpPlugins_BaseObjects_Parameters_GetSet_Code( Real );
 cpPlugins_BaseObjects_Parameters_GetSet_Code( OpenFileName );
 cpPlugins_BaseObjects_Parameters_GetSet_Code( SaveFileName );
 cpPlugins_BaseObjects_Parameters_GetSet_Code( PathName );
+
 cpPlugins_BaseObjects_Parameters_GetSetList_Code( String );
 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Bool );
 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Int );
 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Uint );
 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Real );
-cpPlugins_BaseObjects_Parameters_GetSetList_Code( OpenFileName );
-cpPlugins_BaseObjects_Parameters_GetSetList_Code( SaveFileName );
 cpPlugins_BaseObjects_Parameters_GetSetList_Code( PathName );
 
+// -------------------------------------------------------------------------
+std::vector< cpPlugins::BaseObjects::Parameters::TOpenFileName >
+cpPlugins::BaseObjects::Parameters::
+GetOpenFileNameList( const std::string& name ) const
+{
+  return( this->_GetList< TOpenFileName, OpenFileNameList >( name ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseObjects::Parameters::
+AddToOpenFileNameList(
+  const std::string& name,
+  const cpPlugins::BaseObjects::Parameters::TOpenFileName& v
+  )
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == OpenFileNameList )
+    {
+      auto pos = name.find_last_of( "/\\" );
+      if( i->second.second == "" )
+        i->second.second = name.substr( 0, pos );
+      i->second.second += std::string( "#" );
+      i->second.second += name.substr( pos + 1 );
+      this->Modified( );
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseObjects::Parameters::
+ClearOpenFileNameList( const std::string& name )
+{
+  this->_ClearList< OpenFileNameList >( name );
+}
+
+// -------------------------------------------------------------------------
+std::vector< cpPlugins::BaseObjects::Parameters::TSaveFileName >
+cpPlugins::BaseObjects::Parameters::
+GetSaveFileNameList( const std::string& name ) const
+{
+  return( this->_GetList< TSaveFileName, SaveFileNameList >( name ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseObjects::Parameters::
+AddToSaveFileNameList(
+  const std::string& name,
+  const cpPlugins::BaseObjects::Parameters::TSaveFileName& v
+  )
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == SaveFileNameList )
+    {
+      auto pos = name.find_last_of( "/\\" );
+      if( i->second.second == "" )
+        i->second.second = name.substr( 0, pos );
+      i->second.second += std::string( "#" );
+      i->second.second += name.substr( pos + 1 );
+      this->Modified( );
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseObjects::Parameters::
+ClearSaveFileNameList( const std::string& name )
+{
+  this->_ClearList< SaveFileNameList >( name );
+}
+
 // -------------------------------------------------------------------------
 template< unsigned int _Enum >
 void cpPlugins::BaseObjects::Parameters::
index 338c8afe44f3842bf81f42acff93e3628ea25425..fd6764bb55fd823a20305efcb3dab26fe0f9f6c6 100644 (file)
@@ -17,13 +17,18 @@ namespace tinyxml2
 }
 
 // -------------------------------------------------------------------------
-#define cpPlugins_BaseObjects_Parameters_Configure( Y )         \
-  void ConfigureAs##Y( const std::string& name );               \
+#define cpPlugins_BaseObjects_Parameters_Configure( Y )                 \
+  void ConfigureAs##Y( const std::string& name, const T##Y& init );     \
   bool Has##Y( const std::string& name ) const
 
 // -------------------------------------------------------------------------
-#define cpPlugins_BaseObjects_Parameters_GetSet( Y )            \
-  T##Y Get##Y( const std::string& name ) const;                 \
+#define cpPlugins_BaseObjects_Parameters_ConfigureList( Y )             \
+  void ConfigureAs##Y##List( const std::string& name );                 \
+  bool Has##Y##List( const std::string& name ) const
+
+// -------------------------------------------------------------------------
+#define cpPlugins_BaseObjects_Parameters_GetSet( Y )    \
+  T##Y Get##Y( const std::string& name ) const;         \
   void Set##Y( const std::string& name, const T##Y& v )
 
 // -------------------------------------------------------------------------
@@ -46,18 +51,18 @@ namespace cpPlugins
       // Frienship with forward declaration to improve Qt dialog execution
       friend class cpPlugins::QT::ParametersDialog;
       friend std::ostream& operator<<( std::ostream& o, const Parameters& p )
-      {
-        for(
-          auto i = p.m_Parameters.begin( );
-          i != p.m_Parameters.end( );
-          ++i
-          )
-          o << i->first << ": ("
-            << i->second.first << " | "
-            << i->second.second << ")"
-            << std::endl;
-        return( o );
-      }
+        {
+          for(
+            auto i = p.m_Parameters.begin( );
+            i != p.m_Parameters.end( );
+            ++i
+            )
+            o << i->first << ": ("
+              << i->second.first << " | "
+              << i->second.second << ")"
+              << std::endl;
+          return( o );
+        }
 
     public:
       typedef Parameters Self;
@@ -93,15 +98,15 @@ namespace cpPlugins
       cpPlugins_BaseObjects_Parameters_Configure( OpenFileName );
       cpPlugins_BaseObjects_Parameters_Configure( SaveFileName );
       cpPlugins_BaseObjects_Parameters_Configure( PathName );
-      cpPlugins_BaseObjects_Parameters_Configure( StringList );
-      cpPlugins_BaseObjects_Parameters_Configure( BoolList );
-      cpPlugins_BaseObjects_Parameters_Configure( IntList );
-      cpPlugins_BaseObjects_Parameters_Configure( UintList );
-      cpPlugins_BaseObjects_Parameters_Configure( RealList );
-      cpPlugins_BaseObjects_Parameters_Configure( OpenFileNameList );
-      cpPlugins_BaseObjects_Parameters_Configure( SaveFileNameList );
-      cpPlugins_BaseObjects_Parameters_Configure( PathNameList );
-      cpPlugins_BaseObjects_Parameters_Configure( Choices );
+
+      cpPlugins_BaseObjects_Parameters_ConfigureList( String );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Bool );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Int );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Uint );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Real );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( OpenFileName );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( SaveFileName );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( PathName );
 
       cpPlugins_BaseObjects_Parameters_GetSet( Bool );
       cpPlugins_BaseObjects_Parameters_GetSet( Int );
@@ -170,25 +175,25 @@ namespace cpPlugins
       const TParameters& GetRawParameters( ) const;
 
       template< unsigned int _Enum >
-        inline void _Configure( const std::string& name );
+      inline void _Configure( const std::string& name );
 
       template< unsigned int _Enum >
-        inline bool _Has( const std::string& name ) const;
+      inline bool _Has( const std::string& name ) const;
 
       template< class _Type, unsigned int _Enum >
-        inline _Type _Get( const std::string& name ) const;
+      inline _Type _Get( const std::string& name ) const;
 
       template< class _Type, unsigned int _Enum >
-        inline void _Set( const std::string& name, const _Type& v );
+      inline void _Set( const std::string& name, const _Type& v );
 
       template< class _Type, unsigned int _Enum >
-        inline std::vector< _Type > _GetList( const std::string& name ) const;
+      inline std::vector< _Type > _GetList( const std::string& name ) const;
 
       template< class _Type, unsigned int _Enum >
-        inline void _AddToList( const std::string& name, const _Type& v );
+      inline void _AddToList( const std::string& name, const _Type& v );
 
       template< unsigned int _Enum >
-        inline void _ClearList( const std::string& name );
+      inline void _ClearList( const std::string& name );
 
     private:
       // Purposely not implemented
index 93bf1b93b9757957d35aacf41ddcb6638d24141d..fe842aa14ce26608b33960a3d955679cd4fa88ef 100644 (file)
@@ -35,8 +35,7 @@ cpPlugins::BaseObjects::Widget::
 Widget( )
   : Superclass( )
 {
-  this->m_Parameters.ConfigureAsString( "Text" );
-  this->m_Parameters.SetString( "Text", "" );
+  this->m_Parameters.ConfigureAsString( "Text", "" );
 }
 
 // -------------------------------------------------------------------------
index 0ed7696e170c8b14d9e6a3d620c0aae5cadb0f9d..0d8a325c9106e1c849b8a9ed4e8397fe076afd6f 100644 (file)
@@ -19,5 +19,6 @@ ColorPixels_AllDims itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process
 ColorPixels_VisualDims itk::Image< itk::#color_pixels#< #scalar_pixels# >, #visual_dims# >
 VectorPixels_AllDims itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# >
 VectorPixels_VisualDims itk::Image< itk::#vectors#< #real_types#, #visual_dims# >, #visual_dims# >
+CovariantVectorPixels_AllDims itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >
 
 ** eof - $RCSfile$
diff --git a/lib/cpPlugins/QT/OpenFileDialog.cxx b/lib/cpPlugins/QT/OpenFileDialog.cxx
new file mode 100644 (file)
index 0000000..1027250
--- /dev/null
@@ -0,0 +1,112 @@
+#include <cpPlugins/QT/OpenFileDialog.h>
+
+#ifdef cpPlugins_QT4
+
+#include <cpPlugins/BaseObjects/Parameters.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::QT::OpenFileDialog::
+OpenFileDialog( QWidget* parent )
+  : QFileDialog( parent ),
+    m_Parameters( NULL ),
+    m_Name( "" )
+{
+  this->connect(
+    this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) )
+    );
+  this->setWindowTitle( "Open an(some) file(s)" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::QT::OpenFileDialog::
+~OpenFileDialog( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::QT::OpenFileDialog::
+SetParameters(
+  cpPlugins::BaseObjects::Parameters* params, const std::string& name
+  )
+{
+  if( params == NULL )
+  {
+    this->m_Parameters = NULL;
+    this->m_Name = "";
+    return;
+
+  } // fi
+  auto param_type = params->GetType( name );
+  if(
+    param_type != cpPlugins::BaseObjects::Parameters::OpenFileName &&
+    param_type != cpPlugins::BaseObjects::Parameters::OpenFileNameList
+    )
+  {
+    this->m_Parameters = NULL;
+    this->m_Name = "";
+    return;
+
+  } // fi
+  this->m_Parameters = params;
+  this->m_Name = name;
+
+  QStringList filters;
+  auto extensions = this->m_Parameters->GetAcceptedFileExtensions( name );
+  if( extensions != "" )
+    filters << extensions.c_str( );
+  filters << "Any file (*)";
+  if( param_type == cpPlugins::BaseObjects::Parameters::OpenFileName )
+    this->setFileMode( QFileDialog::ExistingFile );
+  else
+    this->setFileMode( QFileDialog::ExistingFiles );
+  this->setNameFilters( filters );
+  this->setAcceptMode( QFileDialog::AcceptOpen );
+  if( param_type == cpPlugins::BaseObjects::Parameters::OpenFileName )
+  {
+    auto file = this->m_Parameters->GetOpenFileName( this->m_Name );
+    if( file == "" )
+      file = ".";
+    QFileInfo info( file.c_str( ) );
+    this->setDirectory( info.canonicalPath( ) );
+  }
+  else
+  {
+    auto files = this->m_Parameters->GetOpenFileNameList( this->m_Name );
+    if( files.size( ) > 0 )
+    {
+      QFileInfo info( files[ 0 ].c_str( ) );
+      this->setDirectory( info.canonicalPath( ) );
+    }
+    else
+      this->setDirectory( "." );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::QT::OpenFileDialog::
+_dlg_Accepted( )
+{
+  if( this->m_Parameters != NULL )
+  {
+    auto files = this->selectedFiles( );
+    auto param_type = this->m_Parameters->GetType( this->m_Name );
+    if( param_type == cpPlugins::BaseObjects::Parameters::OpenFileNameList )
+    {
+      this->m_Parameters->ClearOpenFileNameList( this->m_Name );
+      for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt )
+        this->m_Parameters->AddToOpenFileNameList(
+          this->m_Name, fIt->toStdString( )
+          );
+    }
+    else
+      this->m_Parameters->SetOpenFileName(
+        this->m_Name, files[ 0 ].toStdString( )
+        );
+
+  } // fi
+}
+
+#endif // cpPlugins_QT4
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/QT/OpenFileDialog.h b/lib/cpPlugins/QT/OpenFileDialog.h
new file mode 100644 (file)
index 0000000..8b1e304
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef __cpPlugins__QT__OpenFileDialog__h__
+#define __cpPlugins__QT__OpenFileDialog__h__
+
+#include <cpPlugins/Config.h>
+
+#ifdef cpPlugins_QT4
+
+#include <QFileDialog>
+
+namespace cpPlugins{ namespace BaseObjects { class Parameters; } }
+
+namespace cpPlugins
+{
+  namespace QT
+  {
+    /**
+     */
+    class OpenFileDialog
+      : public QFileDialog
+    {
+      Q_OBJECT;
+    public:
+      OpenFileDialog( QWidget* parent = 0 );
+      virtual ~OpenFileDialog( );
+
+      void SetParameters(
+        cpPlugins::BaseObjects::Parameters* params, const std::string& name
+        );
+
+    protected slots:
+      void _dlg_Accepted( );
+
+    protected:
+      cpPlugins::BaseObjects::Parameters* m_Parameters;
+      std::string m_Name;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // cpPlugins_QT4
+
+#endif // __cpPlugins__QT__OpenFileDialog__h__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/QT/SaveFileDialog.cxx b/lib/cpPlugins/QT/SaveFileDialog.cxx
new file mode 100644 (file)
index 0000000..7fb1f63
--- /dev/null
@@ -0,0 +1,81 @@
+#include <cpPlugins/QT/SaveFileDialog.h>
+
+#ifdef cpPlugins_QT4
+
+#include <cpPlugins/BaseObjects/Parameters.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::QT::SaveFileDialog::
+SaveFileDialog( QWidget* parent )
+  : QFileDialog( parent ),
+    m_Parameters( NULL ),
+    m_Name( "" )
+{
+  this->connect(
+    this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) )
+    );
+  this->setWindowTitle( "Save a file" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::QT::SaveFileDialog::
+~SaveFileDialog( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::QT::SaveFileDialog::
+SetParameters(
+  cpPlugins::BaseObjects::Parameters* params, const std::string& name
+  )
+{
+  if( params == NULL )
+  {
+    this->m_Parameters = NULL;
+    this->m_Name = "";
+    return;
+
+  } // fi
+  auto param_type = params->GetType( name );
+  if( param_type != cpPlugins::BaseObjects::Parameters::SaveFileName )
+  {
+    this->m_Parameters = NULL;
+    this->m_Name = "";
+    return;
+
+  } // fi
+  this->m_Parameters = params;
+  this->m_Name = name;
+
+  QStringList filters;
+  auto extensions = this->m_Parameters->GetAcceptedFileExtensions( name );
+  if( extensions != "" )
+    filters << extensions.c_str( );
+  filters << "Any file (*)";
+  this->setFileMode( QFileDialog::AnyFile );
+  this->setNameFilters( filters );
+  this->setAcceptMode( QFileDialog::AcceptOpen );
+  auto file = this->m_Parameters->GetSaveFileName( this->m_Name );
+  if( file == "" )
+    file = ".";
+  QFileInfo info( file.c_str( ) );
+  this->setDirectory( info.canonicalPath( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::QT::SaveFileDialog::
+_dlg_Accepted( )
+{
+  if( this->m_Parameters != NULL )
+  {
+    auto files = this->selectedFiles( );
+    this->m_Parameters->SetSaveFileName(
+      this->m_Name, files[ 0 ].toStdString( )
+      );
+
+  } // fi
+}
+
+#endif // cpPlugins_QT4
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/QT/SaveFileDialog.h b/lib/cpPlugins/QT/SaveFileDialog.h
new file mode 100644 (file)
index 0000000..36abd2f
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef __cpPlugins__QT__SaveFileDialog__h__
+#define __cpPlugins__QT__SaveFileDialog__h__
+
+#include <cpPlugins/Config.h>
+
+#ifdef cpPlugins_QT4
+
+#include <QFileDialog>
+
+namespace cpPlugins{ namespace BaseObjects { class Parameters; } }
+
+namespace cpPlugins
+{
+  namespace QT
+  {
+    /**
+     */
+    class SaveFileDialog
+      : public QFileDialog
+    {
+      Q_OBJECT;
+    public:
+      SaveFileDialog( QWidget* parent = 0 );
+      virtual ~SaveFileDialog( );
+
+      void SetParameters(
+        cpPlugins::BaseObjects::Parameters* params, const std::string& name
+        );
+
+    protected slots:
+      void _dlg_Accepted( );
+
+    protected:
+      cpPlugins::BaseObjects::Parameters* m_Parameters;
+      std::string m_Name;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // cpPlugins_QT4
+
+#endif // __cpPlugins__QT__SaveFileDialog__h__
+
+// eof - $RCSfile$
index d8ce6597ae2ef6ecc992458377955caf9e07af0a..ad82dc8980475f74b09d7b29b30a81e694c62d69 100644 (file)
@@ -13,10 +13,10 @@ CurvatureAnisotropicDiffusionImageFilter( )
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsUint( "NumberOfIterations" );
-  this->m_Parameters.ConfigureAsBool( "UseImageSpacing" );
-  this->m_Parameters.ConfigureAsReal( "ConductanceParameter" );
-  this->m_Parameters.ConfigureAsReal( "TimeStep" );
+  this->m_Parameters.ConfigureAsUint( "NumberOfIterations", 5 );
+  this->m_Parameters.ConfigureAsBool( "UseImageSpacing", false );
+  this->m_Parameters.ConfigureAsReal( "ConductanceParameter", 3 );
+  this->m_Parameters.ConfigureAsReal( "TimeStep", 0.0625 );
   std::vector< std::string > choices;
 #ifdef cpPlugins_CONFIG_REAL_TYPES_float
   choices.push_back( "float" );
@@ -25,11 +25,6 @@ CurvatureAnisotropicDiffusionImageFilter( )
   choices.push_back( "double" );
 #endif // cpPlugins_CONFIG_REAL_TYPES_double
   this->m_Parameters.ConfigureAsChoices( "OutputResolution", choices );
-
-  this->m_Parameters.SetUint( "NumberOfIterations", 5 );
-  this->m_Parameters.SetBool( "UseImageSpacing", false );
-  this->m_Parameters.SetReal( "ConductanceParameter", 3 );
-  this->m_Parameters.SetReal( "TimeStep", 0.0625 );
 }
 
 // -------------------------------------------------------------------------
index fccbecad7e1faa0a5fd8935fddc701b24dfc8a24..c8223be128b1c859e58e39da9655aa64c2633a7f 100644 (file)
@@ -48,5 +48,11 @@ TARGET_LINK_LIBRARIES(
   cpPluginsImageDistanceMaps
   cpPluginsImageThresholdFilters
   )
+IF(ParabolicMorphology_LOADED)
+  TARGET_LINK_LIBRARIES(
+    cpPluginsImageParaMorphologyFilters
+    cpPluginsImageThresholdFilters
+    )
+ENDIF(ParabolicMorphology_LOADED)
 
 ## eof - $RSCfile$
index 24952b02b6fd08e63252394b9a44a89376a571a1..527117444edc332cfd6632d4dbc9a5f7e685c14b 100644 (file)
@@ -16,8 +16,7 @@ PolyLineParametricPathToSimple3DCurve( )
   this->_ConfigureInput< _TPath >( "Input", true, false );
   this->_ConfigureOutput< _TCurve >( "Output" );
 
-  this->m_Parameters.ConfigureAsUint( "NumberOfSamples" );
-  this->m_Parameters.SetUint( "NumberOfSamples", 0 );
+  this->m_Parameters.ConfigureAsUint( "NumberOfSamples", 0 );
 }
 
 // -------------------------------------------------------------------------
index a54a5409601fae920ee66e4b419aed07f8e8efc1..972ae5b05e136243a0d8a760dc885acf1bd8b2b4 100644 (file)
@@ -1,75 +1,13 @@
 #include <IO/ImageReader.h>
-#include <IO/ImageReaderQDialog.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/QT/OpenFileDialog.h>
 
 #include <itkImageFileReader.h>
 #include <itkImageSeriesReader.h>
 #include <itkImageIOFactory.h>
 
 #ifdef cpPlugins_QT4
-
-#include <QApplication>
-#include <QFileInfo>
-
-// -------------------------------------------------------------------------
-cpPluginsIO::ImageReaderQDialog::
-ImageReaderQDialog( QWidget* parent )
-  : QFileDialog( parent ),
-    m_ProcessObject( NULL )
-{
-  this->connect(
-    this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) )
-    );
-  this->setWindowTitle( "Open an(some) image(s)" );
-}
-
-// -------------------------------------------------------------------------
-cpPluginsIO::ImageReaderQDialog::
-~ImageReaderQDialog( )
-{
-}
-
-// -------------------------------------------------------------------------
-void cpPluginsIO::ImageReaderQDialog::
-setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj )
-{
-  if( obj == NULL )
-    return;
-  this->m_ProcessObject = obj;
-  auto param = this->m_ProcessObject->GetParameters( );
-  auto extensions = param->GetAcceptedFileExtensions( "FileNames" );
-  auto files = param->GetOpenFileNameList( "FileNames" );
-
-  QStringList filters;
-  if( extensions != "" )
-    filters << extensions.c_str( );
-  filters << "Any file (*)";
-  this->setFileMode( QFileDialog::ExistingFiles );
-  this->setNameFilters( filters );
-  this->setAcceptMode( QFileDialog::AcceptOpen );
-  if( files.size( ) > 0 )
-  {
-    QFileInfo info( files[ 0 ].c_str( ) );
-    this->setDirectory( info.canonicalPath( ) );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpPluginsIO::ImageReaderQDialog::
-_dlg_Accepted( )
-{
-  if( this->m_ProcessObject != NULL )
-  {
-    auto param = this->m_ProcessObject->GetParameters( );
-    auto files = this->selectedFiles( );
-    param->ClearOpenFileNameList( "FileNames" );
-    for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt )
-      param->AddToOpenFileNameList( "FileNames", fIt->toStdString( ) );
-
-  } // fi
-}
-
+#  include <QApplication>
 #endif // cpPlugins_QT4
 
 // -------------------------------------------------------------------------
@@ -77,11 +15,11 @@ QDialog* cpPluginsIO::ImageReader::
 CreateQDialog( )
 {
 #ifdef cpPlugins_QT4
-  ImageReaderQDialog* dlg = NULL;
+  cpPlugins::QT::OpenFileDialog* dlg = NULL;
   if( QApplication::instance( ) != NULL )
   {
-    dlg = new ImageReaderQDialog( );
-    dlg->setProcessObject( this );
+    dlg = new cpPlugins::QT::OpenFileDialog( );
+    dlg->SetParameters( &( this->m_Parameters ), "FileNames" );
 
   } // fi
   return( dlg );
@@ -116,38 +54,37 @@ _GenerateData( )
 {
   // Get filenames
   auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" );
-  if( fnames.size( ) >= 1 )
+  if( fnames.size( ) > 1 )
   {
+    std::stringstream fname_str;
+    fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ];
+    std::string fname = fname_str.str( );
+
     // Guess image properties
     itk::ImageIOBase::Pointer io =
       itk::ImageIOFactory::CreateImageIO(
-        fnames[ 0 ].c_str( ),
-        itk::ImageIOFactory::ReadMode
+        fname.c_str( ), itk::ImageIOFactory::ReadMode
         );
     if( io.IsNotNull( ) )
     {
-      io->SetFileName( fnames[ 0 ] );
+      io->SetFileName( fname );
       io->ReadImageInformation( );
-      if( fnames.size( ) >= 1 )
-      {
-        bool success = false;
-        unsigned int dim = io->GetNumberOfDimensions( );
+      bool success = false;
+      unsigned int dim = io->GetNumberOfDimensions( );
 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_1
-        if( dim == 1 ) success = this->_GD0< 1 >( io );
+      if( dim == 1 ) success = this->_GD0< 1 >( io );
 #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_1
 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_2
-        if( dim == 2 ) success = this->_GD0< 2 >( io );
+      if( dim == 2 ) success = this->_GD0< 2 >( io );
 #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_2
 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_3
-        if( dim == 3 ) success = this->_GD0< 3 >( io );
+      if( dim == 3 ) success = this->_GD0< 3 >( io );
 #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_3
 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_4
-        if( dim == 4 ) success = this->_GD0< 4 >( io );
+      if( dim == 4 ) success = this->_GD0< 4 >( io );
 #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_4
-        if( !success )
-          this->_Error( "Image dimension not supported." );
-
-      } // fi
+      if( !success )
+        this->_Error( "Image dimension not supported." );
     }
     else
       this->_Error(
@@ -340,10 +277,13 @@ _GD1( itk::ImageIOBase* io )
 
   // Get filenames
   auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" );
-  if( fnames.size( ) == 1 )
+  if( fnames.size( ) == 2 )
   {
+    std::stringstream fname_str;
+    fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ];
+
     auto f = this->_CreateITK< itk::ImageFileReader< _TImage > >( );
-    f->SetFileName( fnames[ 0 ] );
+    f->SetFileName( fname_str.str( ) );
     f->SetImageIO( io );
     try
     {
@@ -361,8 +301,12 @@ _GD1( itk::ImageIOBase* io )
   else // if( fnames.size( ) > 1 )
   {
     auto f = this->_CreateITK< itk::ImageSeriesReader< _TImage > >( );
-    for( auto i = fnames.begin( ); i != fnames.end( ); ++i )
-      f->AddFileName( *i );
+    auto i = fnames.begin( );
+    std::stringstream dir;
+    dir << *i << cpPlugins_PATH_SEPARATOR;
+    i++;
+    for( ; i != fnames.end( ); ++i )
+      f->AddFileName( dir.str( ) + *i );
     f->SetImageIO( io );
     try
     {
diff --git a/plugins/IO/ImageReaderQDialog.h b/plugins/IO/ImageReaderQDialog.h
deleted file mode 100644 (file)
index 80f57e1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef __cpPluginsIO__ImageReaderQDialog__h__
-#define __cpPluginsIO__ImageReaderQDialog__h__
-
-#include <cpPlugins/Config.h>
-
-#ifdef cpPlugins_QT4
-
-#include <QFileDialog>
-
-namespace cpPlugins { namespace BaseObjects { class ProcessObject; } }
-
-namespace cpPluginsIO
-{
-  /**
-   */
-  class ImageReaderQDialog
-    : public QFileDialog
-  {
-    Q_OBJECT;
-  public:
-    ImageReaderQDialog( QWidget* parent = 0 );
-    virtual ~ImageReaderQDialog( );
-    void setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj );
-
-  protected slots:
-    void _dlg_Accepted( );
-
-  protected:
-    cpPlugins::BaseObjects::ProcessObject* m_ProcessObject;
-  };
-
-} // ecapseman
-
-#endif // cpPlugins_QT4
-
-#endif // __cpPluginsIO__ImageReaderQDialog__h__
-
-// eof - $RCSfile$
index 8fcf08e7dce05f1a705936975403e724365f7b03..c5aa3df9b1ccfc427d59a7ad0235c08388fed2fe 100644 (file)
@@ -1,78 +1,13 @@
 #include <IO/ImageWriter.h>
-#include <IO/ImageWriterQDialog.h>
 #include <cpPlugins/DataObjects/Image.h>
 #include <cpPlugins/DataObjects/Image_Demanglers.h>
+#include <cpPlugins/QT/SaveFileDialog.h>
 #include <cpInstances_SimpleImages.h>
 
 #include <itkImageFileWriter.h>
 
 #ifdef cpPlugins_QT4
-
-#include <QApplication>
-#include <QFileInfo>
-
-// -------------------------------------------------------------------------
-cpPluginsIO::ImageWriterQDialog::
-ImageWriterQDialog( QWidget* parent )
-  : QFileDialog( parent ),
-    m_ProcessObject( NULL )
-{
-  this->connect(
-    this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) )
-    );
-  this->setWindowTitle( "Save an image" );
-}
-
-// -------------------------------------------------------------------------
-cpPluginsIO::ImageWriterQDialog::
-~ImageWriterQDialog( )
-{
-}
-
-// -------------------------------------------------------------------------
-void cpPluginsIO::ImageWriterQDialog::
-setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj )
-{
-  if( obj == NULL )
-    return;
-  this->m_ProcessObject = obj;
-  auto parameters = this->m_ProcessObject->GetParameters( );
-  auto extensions = parameters->GetAcceptedFileExtensions( "FileName" );
-  auto filename = parameters->GetSaveFileName( "FileName" );
-
-  QStringList filters;
-  if( extensions != "" )
-    filters << extensions.c_str( );
-  filters << "Any file (*)";
-  this->setFileMode( QFileDialog::AnyFile );
-  this->setNameFilters( filters );
-  this->setAcceptMode( QFileDialog::AcceptSave );
-  if( filename != "" )
-  {
-    QFileInfo info( filename.c_str( ) );
-    if( info.exists( ) )
-      this->setDirectory( info.canonicalPath( ) );
-    else
-      this->setDirectory( "." );
-  }
-  else
-    this->setDirectory( "." );
-}
-
-// -------------------------------------------------------------------------
-void cpPluginsIO::ImageWriterQDialog::
-_dlg_Accepted( )
-{
-  if( this->m_ProcessObject != NULL )
-  {
-    auto param = this->m_ProcessObject->GetParameters( );
-    auto files = this->selectedFiles( );
-    if( files.size( ) > 0 )
-      param->SetSaveFileName( "FileName", files.begin( )->toStdString( ) );
-
-  } // fi
-}
-
+#  include <QApplication>
 #endif // cpPlugins_QT4
 
 // -------------------------------------------------------------------------
@@ -80,11 +15,11 @@ QDialog* cpPluginsIO::ImageWriter::
 CreateQDialog( )
 {
 #ifdef cpPlugins_QT4
-  ImageWriterQDialog* dlg = NULL;
+  cpPlugins::QT::SaveFileDialog* dlg = NULL;
   if( QApplication::instance( ) != NULL )
   {
-    dlg = new ImageWriterQDialog( );
-    dlg->setProcessObject( this );
+    dlg = new cpPlugins::QT::SaveFileDialog( );
+    dlg->SetParameters( &( this->m_Parameters ), "FileName" );
 
   } // fi
   return( dlg );
@@ -100,7 +35,7 @@ ImageWriter( )
 {
   this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
   this->m_Parameters.Clear( );
-  this->m_Parameters.ConfigureAsSaveFileName( "FileName" );
+  this->m_Parameters.ConfigureAsSaveFileName( "FileName", "" );
   this->m_Parameters.SetAcceptedFileExtensions(
     "FileName",
     "Image files (*.bmp *.png *.jpg *.jpeg *.dcm *.mhd *.nhdr *.nrrd *.tiff)"
diff --git a/plugins/IO/ImageWriterQDialog.h b/plugins/IO/ImageWriterQDialog.h
deleted file mode 100644 (file)
index c1f1400..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef __cpPluginsIO__ImageWriterQDialog__h__
-#define __cpPluginsIO__ImageWriterQDialog__h__
-
-#include <cpPlugins/Config.h>
-
-#ifdef cpPlugins_QT4
-
-#include <QFileDialog>
-
-namespace cpPlugins { namespace BaseObjects { class ProcessObject; } }
-
-namespace cpPluginsIO
-{
-  /**
-   */
-  class ImageWriterQDialog
-    : public QFileDialog
-  {
-    Q_OBJECT;
-  public:
-    ImageWriterQDialog( QWidget* parent = 0 );
-    virtual ~ImageWriterQDialog( );
-    void setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj );
-
-  protected slots:
-    void _dlg_Accepted( );
-
-  protected:
-    cpPlugins::BaseObjects::ProcessObject* m_ProcessObject;
-  };
-
-} // ecapseman
-
-#endif // cpPlugins_QT4
-
-#endif // __cpPluginsIO__ImageWriterQDialog__h__
-
-// eof - $RCSfile$
index 986eebbfbc0c2c0a3335052682810b2fbe830755..8bb075ea75dea28c4cd1a37b7c954db182a2c7cb 100644 (file)
@@ -1,9 +1,32 @@
 #include <IO/MeshWriter.h>
 #include <cpPlugins/DataObjects/Mesh.h>
+#include <cpPlugins/QT/SaveFileDialog.h>
 
 #include <vtkPolyData.h>
 #include <vtkPolyDataWriter.h>
 
+#ifdef cpPlugins_QT4
+#  include <QApplication>
+#endif // cpPlugins_QT4
+
+// -------------------------------------------------------------------------
+QDialog* cpPluginsIO::MeshWriter::
+CreateQDialog( )
+{
+#ifdef cpPlugins_QT4
+  cpPlugins::QT::SaveFileDialog* dlg = NULL;
+  if( QApplication::instance( ) != NULL )
+  {
+    dlg = new cpPlugins::QT::SaveFileDialog( );
+    dlg->SetParameters( &( this->m_Parameters ), "FileName" );
+
+  } // fi
+  return( dlg );
+#else // cpPlugins_QT4
+  return( NULL );
+#endif // cpPlugins_QT4
+}
+
 // -------------------------------------------------------------------------
 cpPluginsIO::MeshWriter::
 MeshWriter( )
@@ -13,7 +36,7 @@ MeshWriter( )
 
   this->_ConfigureInput< _TMesh >( "Input", true, false );
   this->m_Parameters.Clear( );
-  this->m_Parameters.ConfigureAsSaveFileName( "FileName" );
+  this->m_Parameters.ConfigureAsSaveFileName( "FileName", "" );
   this->m_Parameters.SetAcceptedFileExtensions(
     "FileName",
     "Mesh files (*.vtk)"
index 8b8b59f2c43fa55bf6d977c02b3232d989da3795..ba17022eb1ddb11d76ebaf8b4a6e400cc4b9a03b 100644 (file)
@@ -12,6 +12,9 @@ namespace cpPluginsIO
     : public cpPlugins::BaseObjects::ProcessObject
   {
     cpPluginsObject( MeshWriter, cpPlugins::BaseObjects::ProcessObject, IO );
+
+  public:
+    virtual QDialog* CreateQDialog( ) cpPlugins_OVERRIDE;
   };
 
 } // ecapseman
index 62c2a8561168f12fb0faf83640aa222fe379d39d..74ef30d20c858ad2910d160d372ff62e5d5b0f94 100644 (file)
@@ -14,8 +14,7 @@ PowImageFilter( )
   this->_ConfigureInput< _TImage >( "Input2", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "Constant" );
-  this->m_Parameters.SetReal( "Constant", 1 );
+  this->m_Parameters.ConfigureAsReal( "Constant", 1 );
 }
 
 // -------------------------------------------------------------------------
index ade258036a556c3fe4dcf07f7cf0a9e3aed80a3d..e9b9c0a509893523d275e014f6ccfac1eb640863 100644 (file)
@@ -14,13 +14,9 @@ BinaryContourImageFilter( )
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "BackgroundValue" );
-  this->m_Parameters.ConfigureAsReal( "ForegroundValue" );
-  this->m_Parameters.ConfigureAsBool( "FullyConnected" );
-
-  this->m_Parameters.SetReal( "BackgroundValue", 0 );
-  this->m_Parameters.SetReal( "ForegroundValue", 1 );
-  this->m_Parameters.SetBool( "FullyConnected", false );
+  this->m_Parameters.ConfigureAsReal( "BackgroundValue", 0 );
+  this->m_Parameters.ConfigureAsReal( "ForegroundValue", 1 );
+  this->m_Parameters.ConfigureAsBool( "FullyConnected", false );
 }
 
 // -------------------------------------------------------------------------
index 5a7a0336ac04bfed6c45b2d18bbe228ca9ef16a9..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 );
 }
 
 // -------------------------------------------------------------------------
index 38681d9a8cbefd2fb8cb18814228f4f2e426af43..a484a62a1bff4eba664df0f68c8a2efbe64767d2 100644 (file)
@@ -13,11 +13,8 @@ RescaleIntensityImageFilter( )
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "OutputMinimum" );
-  this->m_Parameters.ConfigureAsReal( "OutputMaximum" );
-
-  this->m_Parameters.SetReal( "OutputMinimum", 0 );
-  this->m_Parameters.SetReal( "OutputMaximum", 1 );
+  this->m_Parameters.ConfigureAsReal( "OutputMinimum", 0 );
+  this->m_Parameters.ConfigureAsReal( "OutputMaximum", 1 );
 }
 
 // -------------------------------------------------------------------------
index 8231a82ae48fb673e11051fddb21f34b3ff8f6d2..8aa7dd6a9951b52d4fa937024a1cf6fa1df2c5c9 100644 (file)
@@ -2,15 +2,8 @@
 #include <cpPlugins/DataObjects/Image.h>
 #include <cpPlugins/DataObjects/Image_Demanglers.h>
 
-/* TODO
-   #include <cpExtensions/Algorithms/ImageFunctionFilter.h>
-   #include <cpExtensions/Algorithms/FluxMedialness.h>
-
-   #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
-   #include <cpExtensions/Algorithms/FluxMedialness.hxx>
-   #include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
-   #include <itkImageFunction.hxx>
-*/
+#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
+#include <cpExtensions/Algorithms/FluxMedialness.h>
 
 // -------------------------------------------------------------------------
 cpPluginsImageGradientFilters::FluxImageFilter::
@@ -22,15 +15,10 @@ FluxImageFilter( )
   this->_ConfigureInput< _TImage >( "Mask", false, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "MinRadius" );
-  this->m_Parameters.ConfigureAsReal( "MaxRadius" );
-  this->m_Parameters.ConfigureAsReal( "RadiusStep" );
-  this->m_Parameters.ConfigureAsUint( "RadialSampling" );
-
-  this->m_Parameters.SetReal( "MinRadius", 0 );
-  this->m_Parameters.SetReal( "MaxRadius", 1 );
-  this->m_Parameters.SetReal( "RadiusStep", 1 );
-  this->m_Parameters.SetUint( "RadialSampling", 4 );
+  this->m_Parameters.ConfigureAsReal( "MinRadius", 0 );
+  this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 );
+  this->m_Parameters.ConfigureAsReal( "RadiusStep", 1 );
+  this->m_Parameters.ConfigureAsUint( "RadialSampling", 4 );
 }
 
 // -------------------------------------------------------------------------
@@ -43,11 +31,9 @@ cpPluginsImageGradientFilters::FluxImageFilter::
 void cpPluginsImageGradientFilters::FluxImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 );
-     else this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -55,29 +41,27 @@ template< class _TImage >
 void cpPluginsImageGradientFilters::FluxImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef typename _TImage::PixelType _TGradient;
-     typedef cpExtensions::Algorithms::FluxMedialness< _TImage > _TFunction;
-     typedef typename _TFunction::TOutput _TScalar;
-     typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage;
-     typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter;
+  typedef typename _TImage::PixelType _TGradient;
+  typedef cpExtensions::Algorithms::FluxMedialness< _TImage > _TFunction;
+  typedef typename _TFunction::TOutput _TScalar;
+  typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage;
+  typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter;
 
-     auto filter = this->_CreateITK< _TFilter >( );
-     auto function = filter->GetFunction( );
-     if( function == NULL )
-     {
-     filter->SetFunction( _TFunction::New( ) );
-     function = filter->GetFunction( );
+  auto filter = this->_CreateITK< _TFilter >( );
+  auto function = filter->GetFunction( );
+  if( function == NULL )
+  {
+    filter->SetFunction( _TFunction::New( ) );
+    function = filter->GetFunction( );
 
-     } // fi
-     function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) );
-     function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) );
-     function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) );
-     function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) );
-     filter->SetInput( image );
-     filter->Update( );
-     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-  */
+  } // fi
+  function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) );
+  function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) );
+  function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) );
+  function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) );
+  filter->SetInput( image );
+  filter->Update( );
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$
index 4c4689788472493282aa16d042a8a4ab41f03092..089b6d5ad80e0e2b1bc02ac774a4fa4f5d0efc45 100644 (file)
@@ -1,16 +1,9 @@
 #include <ImageGradientFilters/GulsunTekImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
 #include <cpPlugins/DataObjects/Image_Demanglers.h>
-/* TODO
-   #include <cpExtensions/Algorithms/ImageFunctionFilter.h>
-   #include <cpExtensions/Algorithms/GulsunTekMedialness.h>
 
-   #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
-   #include <cpExtensions/Algorithms/GulsunTekMedialness.hxx>
-   #include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
-   #include <itkImageFunction.hxx>
-*/
+#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
+#include <cpExtensions/Algorithms/GulsunTekMedialness.h>
 
 // -------------------------------------------------------------------------
 cpPluginsImageGradientFilters::GulsunTekImageFilter::
@@ -23,15 +16,10 @@ GulsunTekImageFilter( )
   this->_ConfigureInput< _TImage >( "Mask", false, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "MinRadius" );
-  this->m_Parameters.ConfigureAsReal( "MaxRadius" );
-  this->m_Parameters.ConfigureAsUint( "ProfileSampling" );
-  this->m_Parameters.ConfigureAsUint( "RadialSampling" );
-
-  this->m_Parameters.SetReal( "MinRadius", 0 );
-  this->m_Parameters.SetReal( "MaxRadius", 1 );
-  this->m_Parameters.SetUint( "ProfileSampling", 4 );
-  this->m_Parameters.SetUint( "RadialSampling", 10 );
+  this->m_Parameters.ConfigureAsReal( "MinRadius", 0 );
+  this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 );
+  this->m_Parameters.ConfigureAsUint( "ProfileSampling", 4 );
+  this->m_Parameters.ConfigureAsUint( "RadialSampling", 10 );
 }
 
 // -------------------------------------------------------------------------
@@ -44,11 +32,9 @@ cpPluginsImageGradientFilters::GulsunTekImageFilter::
 void cpPluginsImageGradientFilters::GulsunTekImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 );
-     else this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -56,73 +42,41 @@ template< class _TImage >
 void cpPluginsImageGradientFilters::GulsunTekImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef itk::Image< char, _TImage::ImageDimension > _TChar;
-     typedef itk::Image< short, _TImage::ImageDimension > _TShort;
-     typedef itk::Image< int, _TImage::ImageDimension > _TInt;
-     typedef itk::Image< long, _TImage::ImageDimension > _TLong;
-     typedef itk::Image< float, _TImage::ImageDimension > _TFloat;
-     typedef itk::Image< double, _TImage::ImageDimension > _TDouble;
-     typedef itk::Image< unsigned char, _TImage::ImageDimension > _TUChar;
-     typedef itk::Image< unsigned short, _TImage::ImageDimension > _TUShort;
-     typedef itk::Image< unsigned int, _TImage::ImageDimension > _TUInt;
-     typedef itk::Image< unsigned long, _TImage::ImageDimension > _TULong;
+  typedef itk::Image< bool, _TImage::ImageDimension > _TDummy;
 
-     auto m = this->GetInput( "Mask" );
-     auto ci = m->GetITK< _TChar >( );
-     auto si = m->GetITK< _TShort >( );
-     auto ii = m->GetITK< _TInt >( );
-     auto li = m->GetITK< _TLong >( );
-     auto fi = m->GetITK< _TFloat >( );
-     auto di = m->GetITK< _TDouble >( );
-     auto uci = m->GetITK< _TUChar >( );
-     auto usi = m->GetITK< _TUShort >( );
-     auto uii = m->GetITK< _TUInt >( );
-     auto uli = m->GetITK< _TULong >( );
-     if     (  ci != NULL ) this->_GD1( image,  ci );
-     else if(  si != NULL ) this->_GD1( image,  si );
-     else if(  ii != NULL ) this->_GD1( image,  ii );
-     else if(  li != NULL ) this->_GD1( image,  li );
-     else if(  fi != NULL ) this->_GD1( image,  fi );
-     else if(  di != NULL ) this->_GD1( image,  di );
-     else if( uci != NULL ) this->_GD1( image, uci );
-     else if( usi != NULL ) this->_GD1( image, usi );
-     else if( uii != NULL ) this->_GD1( image, uii );
-     else if( uli != NULL ) this->_GD1( image, uli );
-     else                   this->_GD1( image, ci );
-  */
+  auto o = this->GetInputData( "Mask" );
+  cpPlugins_Demangle_Image_ScalarPixels_2( o, _GD1, _TImage::ImageDimension, image )
+    this->_GD1< _TDummy, _TImage >( NULL, image );
 }
 
 // -------------------------------------------------------------------------
-template< class _TImage, class _TMask >
+template< class _TMask, class _TImage >
 void cpPluginsImageGradientFilters::GulsunTekImageFilter::
-_GD1( _TImage* image, _TMask* mask )
+_GD1( _TMask* mask, _TImage* image )
 {
-  /* TODO
-     typedef typename _TImage::PixelType _TGradient;
-     typedef cpExtensions::Algorithms::GulsunTekMedialness< _TImage, _TMask > _TFunction;
-     typedef typename _TFunction::TOutput _TScalar;
-     typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage;
-     typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter;
+  typedef typename _TImage::PixelType _TGradient;
+  typedef cpExtensions::Algorithms::GulsunTekMedialness< _TImage, _TMask > _TFunction;
+  typedef typename _TFunction::TOutput _TScalar;
+  typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage;
+  typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter;
 
-     auto filter = this->_CreateITK< _TFilter >( );
-     auto function = filter->GetFunction( );
-     if( function == NULL )
-     {
-     filter->SetFunction( _TFunction::New( ) );
-     function = filter->GetFunction( );
+  auto filter = this->_CreateITK< _TFilter >( );
+  auto function = filter->GetFunction( );
+  if( function == NULL )
+  {
+    filter->SetFunction( _TFunction::New( ) );
+    function = filter->GetFunction( );
 
-     } // fi
-     function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) );
-     function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) );
-     function->SetProfileSampling( this->m_Parameters.GetUint( "ProfileSampling" ) );
-     function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) );
-     filter->SetInput( image );
-     if( mask != NULL )
-     function->SetMask( mask );
-     filter->Update( );
-     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-  */
+  } // fi
+  function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) );
+  function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) );
+  function->SetProfileSampling( this->m_Parameters.GetUint( "ProfileSampling" ) );
+  function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) );
+  filter->SetInput( image );
+  if( mask != NULL )
+    function->SetMask( mask );
+  filter->Update( );
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$
index e48623c04fc08ba16fda33b9d26c2ad87d837a85..6242a4c5eb0040898e32afd229678f89a05afacf 100644 (file)
@@ -21,8 +21,8 @@ namespace cpPluginsImageGradientFilters
     template< class _TImage >
       inline void _GD0( _TImage* image );
 
-    template< class _TImage, class _TMask >
-      inline void _GD1( _TImage* image, _TMask* mask );
+    template< class _TMask, class _TImage >
+    inline void _GD1( _TMask* mask, _TImage* image );
   };
 
 } // ecapseman
diff --git a/plugins/ImageGradientFilters/ImageGradientFilters.i b/plugins/ImageGradientFilters/ImageGradientFilters.i
new file mode 100644 (file)
index 0000000..95bff3a
--- /dev/null
@@ -0,0 +1,30 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define funcs=GulsunTekMedialness;FluxMedialness;MFluxMedialness
+define all_funcs=GradientImageFunctionBase;#funcs#
+define itk_filters=RecursiveGaussianImageFilter;GradientRecursiveGaussianImageFilter
+
+tinclude itk#itk_filters#:h|hxx
+tinclude cpExtensions/Algorithms/#all_funcs#:h|hxx
+tinclude cpExtensions/Algorithms/ImageFunctionFilter:h|hxx
+tinclude cpExtensions/Algorithms/MultiScaleGaussianImageFilter:h|hxx
+
+cinclude itkImageAdaptor.hxx
+cinclude itkImageFunction.hxx
+cinclude itkImageConstIteratorWithIndex.hxx
+cinclude itkUnaryFunctorImageFilter.hxx
+cinclude itkBinaryFunctorImageFilter.hxx
+cinclude itkImageRegionIteratorWithIndex.hxx
+cinclude itkImageRegionConstIteratorWithIndex.hxx
+cinclude itkSimpleDataObjectDecorator.hxx
+
+instances itk::RecursiveGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+instances itk::GradientRecursiveGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
+
+instances cpExtensions::Algorithms::#all_funcs#< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
+
+instances cpExtensions::Algorithms::ImageFunctionFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #real_types#, #process_dims# >, cpExtensions::Algorithms::#funcs#< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > > >
+
+instances cpExtensions::Algorithms::MultiScaleGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
+
+** eof - $RCSfile$
index 8575a59f432af1a52e5b75f65f76f1ee3adf5626..657cd1e90f38cbe51e4da4c8751613e98c001d4b 100644 (file)
@@ -2,15 +2,8 @@
 #include <cpPlugins/DataObjects/Image.h>
 #include <cpPlugins/DataObjects/Image_Demanglers.h>
 
-/* TODO
-   #include <cpExtensions/Algorithms/ImageFunctionFilter.h>
-   #include <cpExtensions/Algorithms/MFluxMedialness.h>
-
-   #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
-   #include <cpExtensions/Algorithms/MFluxMedialness.hxx>
-   #include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
-   #include <itkImageFunction.hxx>
-*/
+#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
+#include <cpExtensions/Algorithms/MFluxMedialness.h>
 
 // -------------------------------------------------------------------------
 cpPluginsImageGradientFilters::MFluxImageFilter::
@@ -22,15 +15,10 @@ MFluxImageFilter( )
   this->_ConfigureInput< _TImage >( "Mask", false, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "MinRadius" );
-  this->m_Parameters.ConfigureAsReal( "MaxRadius" );
-  this->m_Parameters.ConfigureAsReal( "RadiusStep" );
-  this->m_Parameters.ConfigureAsUint( "RadialSampling" );
-
-  this->m_Parameters.SetReal( "MinRadius", 0 );
-  this->m_Parameters.SetReal( "MaxRadius", 1 );
-  this->m_Parameters.SetReal( "RadiusStep", 1 );
-  this->m_Parameters.SetUint( "RadialSampling", 4 );
+  this->m_Parameters.ConfigureAsReal( "MinRadius", 0 );
+  this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 );
+  this->m_Parameters.ConfigureAsReal( "RadiusStep", 1 );
+  this->m_Parameters.ConfigureAsUint( "RadialSampling", 4 );
 }
 
 // -------------------------------------------------------------------------
@@ -43,11 +31,9 @@ cpPluginsImageGradientFilters::MFluxImageFilter::
 void cpPluginsImageGradientFilters::MFluxImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 );
-     else this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -55,29 +41,27 @@ template< class _TImage >
 void cpPluginsImageGradientFilters::MFluxImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef typename _TImage::PixelType _TGradient;
-     typedef cpExtensions::Algorithms::MFluxMedialness< _TImage > _TFunction;
-     typedef typename _TFunction::TOutput _TScalar;
-     typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage;
-     typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter;
+  typedef typename _TImage::PixelType _TGradient;
+  typedef cpExtensions::Algorithms::MFluxMedialness< _TImage > _TFunction;
+  typedef typename _TFunction::TOutput _TScalar;
+  typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage;
+  typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter;
 
-     auto filter = this->_CreateITK< _TFilter >( );
-     auto function = filter->GetFunction( );
-     if( function == NULL )
-     {
-     filter->SetFunction( _TFunction::New( ) );
-     function = filter->GetFunction( );
+  auto filter = this->_CreateITK< _TFilter >( );
+  auto function = filter->GetFunction( );
+  if( function == NULL )
+  {
+    filter->SetFunction( _TFunction::New( ) );
+    function = filter->GetFunction( );
 
-     } // fi
-     function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) );
-     function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) );
-     function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) );
-     function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) );
-     filter->SetInput( image );
-     filter->Update( );
-     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-  */
+  } // fi
+  function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) );
+  function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) );
+  function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) );
+  function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) );
+  filter->SetInput( image );
+  filter->Update( );
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$
index d4e74e8eee796a00ee96fd3a884470149d4b2411..b3b4565c71c7db7ca27a8d216f32726411d22841 100644 (file)
@@ -4,20 +4,6 @@
 
 #include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h>
 
-/* TODO
-   #include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx>
-   #include <itkGradientRecursiveGaussianImageFilter.hxx>
-   #include <itkRecursiveGaussianImageFilter.hxx>
-   #include <itkImageAdaptor.hxx>
-   #include <itkUnaryFunctorImageFilter.hxx>
-   #include <itkImageConstIteratorWithIndex.hxx>
-   #include <itkBinaryFunctorImageFilter.hxx>
-   #include <itkImageRegionIteratorWithIndex.hxx>
-   #include <itkInPlaceImageFilter.hxx>
-   #include <itkImageRegionConstIteratorWithIndex.hxx>
-   #include <itkSimpleDataObjectDecorator.hxx>
-*/
-
 // -------------------------------------------------------------------------
 cpPluginsImageGradientFilters::MultiScaleGaussianImageFilter::
 MultiScaleGaussianImageFilter( )
index 20a6769299597c2443dbbfb8ff02269c8d998b72..f2226db54b0927c919696a3e2d9e735fc454cc07 100644 (file)
@@ -18,13 +18,9 @@ RasterMeshFilter( )
   this->_ConfigureInput< _TDataObject >( "Template", false, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsUint( "InsideValue" );
-  this->m_Parameters.ConfigureAsUint( "OutsideValue" );
-  this->m_Parameters.ConfigureAsUint( "MinimumSize" );
-
-  this->m_Parameters.SetUint( "InsideValue", 1 );
-  this->m_Parameters.SetUint( "OutsideValue", 0 );
-  this->m_Parameters.SetUint( "MinimumSize", 100 );
+  this->m_Parameters.ConfigureAsUint( "InsideValue", 1 );
+  this->m_Parameters.ConfigureAsUint( "OutsideValue", 0 );
+  this->m_Parameters.ConfigureAsUint( "MinimumSize", 100 );
 }
 
 // -------------------------------------------------------------------------
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$
index c123e19fb01b6553ae6148f3c9dc4ee0274d7faa..349e84ce9e4657d57ffe5e1eedf3313b946e6fc8 100644 (file)
@@ -1,13 +1,8 @@
 #include <ImageParaMorphologyFilters/BinaryErodeParaImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 
-/* TODO
-   #include <itkBinaryErodeParaImageFilter.h>
-   #include <itkBinaryErodeParaImageFilter.hxx>
-   #include <itkBinaryThresholdImageFilter.hxx>
-   #include <itkUnaryFunctorImageFilter.hxx>
-   #include <itkParabolicErodeDilateImageFilter.hxx>
-*/
+#include <itkBinaryErodeParaImageFilter.h>
 
 // -------------------------------------------------------------------------
 cpPluginsImageParaMorphologyFilters::BinaryErodeParaImageFilter::
@@ -18,13 +13,9 @@ BinaryErodeParaImageFilter( )
 
   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::BinaryErodeParaImageFilter::
 void cpPluginsImageParaMorphologyFilters::BinaryErodeParaImageFilter::
 _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::BinaryErodeParaImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef itk::BinaryErodeParaImageFilter< _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::BinaryErodeParaImageFilter< _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$
diff --git a/plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i b/plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i
new file mode 100644 (file)
index 0000000..5c1b278
--- /dev/null
@@ -0,0 +1,17 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define itk_filters=BinaryDilateParaImageFilter;BinaryErodeParaImageFilter
+define in_scalar_pixels=#scalar_pixels#
+define out_scalar_pixels=#scalar_pixels#
+define booleans=false;true
+
+tinclude itkParabolicErodeDilateImageFilter:h|hxx
+tinclude itk#itk_filters#:h|hxx
+
+cinclude itkUnaryFunctorImageFilter.hxx
+
+instances itk::ParabolicErodeDilateImageFilter< itk::Image< #in_scalar_pixels#, #process_dims# >, #booleans#, itk::Image< #out_scalar_pixels#, #process_dims# > >
+instances itk::#itk_filters#< itk::Image< #in_scalar_pixels#, #process_dims# >, itk::Image< #out_scalar_pixels#, #process_dims# > >
+
+
+** eof - $RCSfile$
index 12537737b1f1c581a6389aca2646c4a9a4d63ba5..0fddf92b30bc91468f031f836ae098256e9872fd 100644 (file)
@@ -1,5 +1,6 @@
 #include <ImageThresholdFilters/BinaryThresholdImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 
 #include <itkBinaryThresholdImageFilter.h>
 
@@ -12,15 +13,10 @@ BinaryThresholdImageFilter( )
   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 );
 }
 
 // -------------------------------------------------------------------------
@@ -33,11 +29,9 @@ cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-     else this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -45,30 +39,28 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef unsigned char _TBin;
-     typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage;
-     typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter;
-     typedef typename _TImage::PixelType _TPixel;
+  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$
index 50de8f10d945847ad34bc7a176a81c216df67544..b1222ae595107ca379baaec7c85a66700714304d 100644 (file)
@@ -1,8 +1,10 @@
 header #define ITK_MANUAL_INSTANTIATION
 
 define filters=BinaryThresholdImageFilter
+define other=UnaryThresholdImageFilter;ImageToBoundingBoxFromThreshold
 
 tinclude itk#filters#:h|hxx
+tinclude cpExtensions/Algorithms/#other#:h|hxx
 
 cinclude itkUnaryFunctorImageFilter.hxx
 
@@ -10,5 +12,6 @@ define in_scalar_pixels=#scalar_pixels#
 define out_scalar_pixels=#scalar_pixels#
 
 instances itk::#filters#< itk::Image< #in_scalar_pixels#, #process_dims# >, itk::Image< #out_scalar_pixels#, #process_dims# > >
+instances cpExtensions::Algorithms::#other#< itk::Image< #scalar_pixels#, #process_dims# > >
 
 ** eof - $RCSfile$
index 52082a2b1b1b9952912c6efc41a57571107ee6db..4b86d54fc8a80dcdcc67c9c9523e1adc8a4614d8 100644 (file)
@@ -1,7 +1,9 @@
 #include <ImageThresholdFilters/ImageToBoundingBoxFromThreshold.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 #include <cpPlugins/DataObjects/BoundingBox.h>
 
+#include <itkImage.h>
 #include <cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h>
 
 // -------------------------------------------------------------------------
@@ -15,11 +17,8 @@ ImageToBoundingBoxFromThreshold( )
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TBBox >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "LowerThreshold" );
-  this->m_Parameters.ConfigureAsReal( "UpperThreshold" );
-
-  this->m_Parameters.SetReal( "LowerThreshold", 0 );
-  this->m_Parameters.SetReal( "LowerThreshold", 0 );
+  this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
+  this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 );
 }
 
 // -------------------------------------------------------------------------
@@ -32,11 +31,9 @@ cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 void cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-     else this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -44,27 +41,25 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef
-     cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage >
-     _TFilter;
+  typedef
+    cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage >
+    _TFilter;
 
-     // Configure filter
-     _TFilter* filter = this->_CreateITK< _TFilter >( );
-     filter->SetImage( image );
-     filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
-     filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
-     filter->Compute( );
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetImage( image );
+  filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
+  filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
+  filter->Compute( );
 
-     // Create output
-     auto reg = filter->GetRegion( );
-     auto bb = this->GetOutput< cpPlugins::DataObjects::BoundingBox >( "Output" );
-     typename _TImage::PointType p0, p1;
-     image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 );
-     image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 );
-     bb->SetMinimum( p0 );
-     bb->SetMaximum( p1 );
-  */
+  // Create output
+  auto reg = filter->GetRegion( );
+  auto bb = this->GetOutput< cpPlugins::DataObjects::BoundingBox >( "Output" );
+  typename _TImage::PointType p0, p1;
+  image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 );
+  image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 );
+  bb->SetMinimum( p0 );
+  bb->SetMaximum( p1 );
 }
 
 // eof - $RCSfile$
index cd16ed3a243ce3e6de71ef48346598eb1d006f0e..84aded188f6393ca83e75db72673b97e97617bac 100644 (file)
@@ -1,5 +1,6 @@
 #include <ImageThresholdFilters/UnaryThresholdImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 
 #include <cpExtensions/Algorithms/UnaryThresholdImageFilter.h>
 
@@ -12,15 +13,10 @@ UnaryThresholdImageFilter( )
   this->_ConfigureInput< _TImage >( "Input", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
-  this->m_Parameters.ConfigureAsReal( "Threshold" );
-  this->m_Parameters.ConfigureAsReal( "InsideValue" );
-  this->m_Parameters.ConfigureAsReal( "OutsideValue" );
-  this->m_Parameters.ConfigureAsBool( "Strict" );
-
-  this->m_Parameters.SetReal( "Threshold", 0 );
-  this->m_Parameters.SetReal( "InsideValue", 1 );
-  this->m_Parameters.SetReal( "OutsideValue", 0 );
-  this->m_Parameters.SetBool( "Strict", false );
+  this->m_Parameters.ConfigureAsReal( "Threshold", 0 );
+  this->m_Parameters.ConfigureAsReal( "InsideValue", 1 );
+  this->m_Parameters.ConfigureAsReal( "OutsideValue", 0 );
+  this->m_Parameters.ConfigureAsBool( "Strict", false );
 }
 
 // -------------------------------------------------------------------------
@@ -33,11 +29,9 @@ cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Input" );
-     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-     else this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -45,23 +39,21 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     typedef
-     cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage >
-     _TFilter;
-
-     // Configure filter
-     _TFilter* filter = this->_CreateITK< _TFilter >( );
-     filter->SetInput( image );
-     filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) );
-     filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) );
-     filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) );
-     filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) );
-     filter->Update( );
-
-     // Connect output
-     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-  */
+  typedef
+    cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage >
+    _TFilter;
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) );
+  filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) );
+  filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) );
+  filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$
index 5a11d78441f0403550d131995fb7bd9405e3b686..a89e1a444a78d4d03323fd4d31a03a7c44ad071f 100644 (file)
@@ -9,12 +9,9 @@ CylinderSource( )
   : Superclass( )
 {
   this->_ConfigureOutput< cpPlugins::DataObjects::Mesh >( "Output" );
-  this->m_Parameters.ConfigureAsReal( "Height" );
-  this->m_Parameters.ConfigureAsReal( "Radius" );
-  this->m_Parameters.ConfigureAsUint( "Resolution" );
-  this->m_Parameters.SetReal( "Height", 1 );
-  this->m_Parameters.SetReal( "Radius", 1 );
-  this->m_Parameters.SetUint( "Resolution", 8 );
+  this->m_Parameters.ConfigureAsReal( "Height", 1 );
+  this->m_Parameters.ConfigureAsReal( "Radius", 1 );
+  this->m_Parameters.ConfigureAsUint( "Resolution", 8 );
 }
 
 // -------------------------------------------------------------------------
index 8d52ce305f34c848220be01e540184b156e196ae..fba068adccbb4d4ce29307c41a9be565037432e5 100644 (file)
@@ -9,12 +9,9 @@ SphereSource( )
   : Superclass( )
 {
   this->_ConfigureOutput< cpPlugins::DataObjects::Mesh >( "Output" );
-  this->m_Parameters.ConfigureAsReal( "Radius" );
-  this->m_Parameters.ConfigureAsUint( "PhiResolution" );
-  this->m_Parameters.ConfigureAsUint( "ThetaResolution" );
-  this->m_Parameters.SetReal( "Radius", 1 );
-  this->m_Parameters.SetUint( "PhiResolution", 8 );
-  this->m_Parameters.SetUint( "ThetaResolution", 8 );
+  this->m_Parameters.ConfigureAsReal( "Radius", 1 );
+  this->m_Parameters.ConfigureAsUint( "PhiResolution", 8 );
+  this->m_Parameters.ConfigureAsUint( "ThetaResolution", 8 );
 }
 
 // -------------------------------------------------------------------------
index 258c0bd677a43e923f501aeb51001f9565e3b112..256ae8f334248638aa3f51275af0ee2ee1e716ab 100644 (file)
@@ -63,8 +63,7 @@ SplineWidget( )
   this->m_Contour->SetStrips( vtkSmartPointer< vtkCellArray >::New( ) );
   this->GetOutput( "Output" )->SetVTK( this->m_Contour );
 
-  this->m_Parameters.ConfigureAsBool( "Extend" );
-  this->m_Parameters.SetBool( "Extend", false );
+  this->m_Parameters.ConfigureAsBool( "Extend", false );
 }
 
 // -------------------------------------------------------------------------