]> Creatis software - cpPlugins.git/commitdiff
Kind of bored: graph editor debugged
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Sun, 3 Jan 2016 02:54:25 +0000 (21:54 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Sun, 3 Jan 2016 02:54:25 +0000 (21:54 -0500)
26 files changed:
appli/cpPipelineEditor/QNodesEditor.cxx
appli/cpPipelineEditor/cpPipelineEditor.cxx
appli/examples/example_TestParameters.cxx
lib/cpPlugins/Interface/Parameters.cxx
lib/cpPlugins/Interface/Parameters.h
lib/cpPlugins/Interface/Parameters.hxx
lib/cpPlugins/Interface/WorkspaceIO.cxx
lib/cpPlugins/Plugins/BasicFilters/BinaryErodeImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/DoubleFloodImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/ExtractSliceImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/FloodFillImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MacheteImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx
lib/cpPlugins/Plugins/IO/DicomSeriesReader.h
lib/cpPlugins/Plugins/IO/ImageReader.cxx
lib/cpPlugins/Plugins/IO/ImageReader.h
lib/cpPlugins/Plugins/IO/ImageWriter.cxx
lib/cpPlugins/Plugins/IO/ImageWriter.h
lib/cpPlugins/Plugins/IO/MeshReader.cxx
lib/cpPlugins/Plugins/IO/MeshReader.h
lib/cpPlugins/Plugins/IO/MeshWriter.cxx
lib/cpPlugins/Plugins/IO/MeshWriter.h

index 039b45ebc1a01cdeaf4eadf896e0ac30ffd8acbe..a499e94308c6339660ffbf26c4e11b9c0f50fc53 100644 (file)
@@ -81,49 +81,70 @@ setWorkspace( TWorkspace* ws )
   this->m_Workspace = ws;\r
   this->m_Graph = TGraph::New( );\r
 \r
-  /* TODO\r
-     QGraphicsScene* scene = this->scene( );\r
-     // Add vertices and keep track of ports\r
-     std::map< std::string, std::map< std::string, QNEPort* > >\r
-     in_ports, out_ports;\r
-     auto vIt = this->m_Workspace->GetGraph( )->BeginVertices( );\r
-     auto vIt_end = this->m_Workspace->GetGraph( )->EndVertices( );\r
-     for( ; vIt != vIt_end; ++vIt )\r
-     {\r
-     this->_createBlock( dynamic_cast< TFilter* >( vIt->second.GetPointer( ) ) );\r
+  // Create blocks\r
+  auto vIt = this->m_Workspace->GetGraph( )->BeginVertices( );\r
+  auto vIt_end = this->m_Workspace->GetGraph( )->EndVertices( );\r
+  for( ; vIt != vIt_end; ++vIt )\r
+  {\r
+    this->_CreateBlock(\r
+      dynamic_cast< TFilter* >( vIt->second.GetPointer( ) ),\r
+      QPointF( )\r
+      );\r
 \r
-     } // rof\r
-  */\r
+  } // rof\r
 \r
   // Add edges\r
-  /* TODO\r
-     auto rIt = this->m_Workspace->GetGraph( )->BeginEdgesRows( );\r
-     auto rIt_end = this->m_Workspace->GetGraph( )->EndEdgesRows( );\r
-     for( ; rIt != rIt_end; ++rIt )\r
-     {\r
-     auto cIt = rIt->second.begin( );\r
-     for( ; cIt != rIt->second.end( ); ++cIt )\r
-     {\r
-     auto eIt = cIt->second.begin( );\r
-     for( ; eIt != cIt->second.end( ); ++eIt )\r
-     {\r
-     QNEPort* p1 = out_ports[ rIt->first ][ eIt->first ];\r
-     QNEPort* p2 = in_ports[ cIt->first ][ eIt->second ];\r
-     if( p1 != NULL && p2 != NULL )\r
-     {\r
-     QNEConnection* conn = new QNEConnection( 0, scene );\r
-     conn->setPort1( p1 );\r
-     conn->setPort2( p2 );\r
-     this->m_Graph->AddConnection( rIt->first, cIt->first, conn );\r
+  auto rIt = this->m_Workspace->GetGraph( )->BeginEdgesRows( );\r
+  auto rIt_end = this->m_Workspace->GetGraph( )->EndEdgesRows( );\r
+  for( ; rIt != rIt_end; ++rIt )\r
+  {\r
+    if( !this->m_Graph->HasVertexIndex( rIt->first ) )\r
+      continue;\r
+    QNEBlock* orig = this->m_Graph->GetVertex( rIt->first );\r
+    if( orig == NULL )\r
+      continue;\r
+    QVector< QNEOutputPort* >& oPorts = orig->outputPorts( );\r
+\r
+    auto cIt = rIt->second.begin( );\r
+    for( ; cIt != rIt->second.end( ); ++cIt )\r
+    {\r
+      if( !this->m_Graph->HasVertexIndex( cIt->first ) )\r
+        continue;\r
+      QNEBlock* dest = this->m_Graph->GetVertex( cIt->first );\r
+      if( dest == NULL )\r
+        continue;\r
+      QVector< QNEInputPort* >& iPorts = dest->inputPorts( );\r
+\r
+      auto eIt = cIt->second.begin( );\r
+      for( ; eIt != cIt->second.end( ); ++eIt )\r
+      {\r
+        QNEOutputPort* op = NULL;\r
+        auto opIt = oPorts.begin( );\r
+        for( ; opIt != oPorts.end( ) && op == NULL; ++opIt )\r
+          if( ( *opIt )->name( ).toStdString( ) == eIt->first )\r
+            op = *opIt;\r
 \r
-     } // fi\r
+        QNEInputPort* ip = NULL;\r
+        auto ipIt = iPorts.begin( );\r
+        for( ; ipIt != iPorts.end( ) && ip == NULL; ++ipIt )\r
+          if( ( *ipIt )->name( ).toStdString( ) == eIt->second )\r
+            ip = *ipIt;\r
 \r
-     } // rof\r
+        if( op == NULL || ip == NULL )\r
+          continue;\r
 \r
-     } // rof\r
+        QNEConnection* conn = new QNEConnection( 0, this->m_Scene );\r
+        conn->setPort1( op );\r
+        conn->setPort2( ip );\r
+        conn->updatePosFromPorts( );\r
+        conn->updatePath( );\r
+        this->m_Graph->AddConnection( rIt->first, cIt->first, conn );\r
 \r
-     } // rof\r
-  */\r
+      } // rof\r
+\r
+    } // rof\r
+\r
+  } // rof\r
 }\r
 \r
 // -------------------------------------------------------------------------\r
index 872b4f4a33907f9f2cbf2539f16a4c07439b5fdb..957158a565e54c937f6dc8047d2eeb36b2351abb 100644 (file)
@@ -193,6 +193,7 @@ _ActionOpenWorkspace( )
   if( err == "" )
   {
     this->m_UI->Canvas->editor( )->setWorkspace( this->m_Workspace );
+    this->_UpdateLoadedPlugins( );
   }
   else
   {
index c728bb246f878037d34ea9269c2dd1600b7ce956..807b4d9af8f505ee546f2a5f63dc40844115ae11 100644 (file)
@@ -29,13 +29,13 @@ int main( int argc, char* argv[] )
   TIndex idx; idx[ 0 ] = 1; idx[ 1 ] = 2; idx[ 2 ] = 3;
   TPoint pnt; pnt[ 0 ] = 3.1; pnt[ 1 ] = 2.2; pnt[ 2 ] = 1.3;
 
-  parameters->ConfigureAsString( "StringParam", "String_Value" );
-  parameters->ConfigureAsBool( "BoolParam", false );
-  parameters->ConfigureAsInt( "IntParam", -314 );
-  parameters->ConfigureAsUint( "UintParam", 314 );
-  parameters->ConfigureAsReal( "RealParam", 3.14 );
-  parameters->ConfigureAsIndex( "IndexParam", 3, idx );
-  parameters->ConfigureAsPoint( "PointParam", 3, pnt );
+  parameters->ConfigureAsString( "StringParam" );
+  parameters->ConfigureAsBool( "BoolParam" );
+  parameters->ConfigureAsInt( "IntParam" );
+  parameters->ConfigureAsUint( "UintParam" );
+  parameters->ConfigureAsReal( "RealParam" );
+  parameters->ConfigureAsIndex( "IndexParam" );
+  parameters->ConfigureAsPoint( "PointParam" );
   parameters->ConfigureAsStringList( "StringListParam" );
   parameters->ConfigureAsBoolList( "BoolListParam" );
   parameters->ConfigureAsIntList( "IntListParam" );
index e584b5e5d36cbd5d7f2719fe46f9ffb481f77302..52b2e47d423eccc3463a89a133de20acd5982d7b 100644 (file)
@@ -44,50 +44,31 @@ Clear( )
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::Interface::Parameters::
-ConfigureAsString( const TString& name, const TString& v )
-{
-  this->m_Parameters[ name ] =
-    TParameter( Self::String, TValues( v, v ) );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Parameters_Configure( Y )             \
-  void cpPlugins::Interface::Parameters::               \
-  ConfigureAs##Y( const TString& name, const T##Y& v )  \
-  {                                                     \
-    std::stringstream str;                              \
-    str << v;                                           \
-    std::string s = str.str( );                         \
-    this->m_Parameters[ name ] =                        \
-      TParameter( Self::Y, TValues( s, s ) );           \
-    this->Modified( );                                  \
+#define cpPlugins_Parameters_Configure( Y )                     \
+  void cpPlugins::Interface::Parameters::                       \
+  ConfigureAs##Y( const TString& name )                         \
+  {                                                             \
+    this->m_Parameters[ name ] = TParameter( Self::Y, "" );     \
+    this->Modified( );                                          \
   }
 
+cpPlugins_Parameters_Configure( String );
 cpPlugins_Parameters_Configure( Bool );
 cpPlugins_Parameters_Configure( Int );
 cpPlugins_Parameters_Configure( Uint );
 cpPlugins_Parameters_Configure( Real );
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Parameters_List_Configure( Y )        \
-  void cpPlugins::Interface::Parameters::               \
-  ConfigureAs##Y##List( const TString& name )           \
-  {                                                     \
-    this->m_Parameters[ name ] =                        \
-      TParameter( Self::Y##List, TValues( "", "" ) );   \
-    this->Modified( );                                  \
-  }
-
-cpPlugins_Parameters_List_Configure( String );
-cpPlugins_Parameters_List_Configure( Bool );
-cpPlugins_Parameters_List_Configure( Int );
-cpPlugins_Parameters_List_Configure( Uint );
-cpPlugins_Parameters_List_Configure( Real );
-cpPlugins_Parameters_List_Configure( Index );
-cpPlugins_Parameters_List_Configure( Point );
-cpPlugins_Parameters_List_Configure( Vector );
+cpPlugins_Parameters_Configure( Index );
+cpPlugins_Parameters_Configure( Point );
+cpPlugins_Parameters_Configure( Vector );
+cpPlugins_Parameters_Configure( StringList );
+cpPlugins_Parameters_Configure( BoolList );
+cpPlugins_Parameters_Configure( IntList );
+cpPlugins_Parameters_Configure( UintList );
+cpPlugins_Parameters_Configure( RealList );
+cpPlugins_Parameters_Configure( IndexList );
+cpPlugins_Parameters_Configure( PointList );
+cpPlugins_Parameters_Configure( VectorList );
+cpPlugins_Parameters_Configure( Choices );
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Parameters::
@@ -103,8 +84,9 @@ ConfigureAsChoices(
   str_choices << choices[ 0 ];
   for( unsigned int i = 1; i < choices.size( ); ++i )
     str_choices << "#" << choices[ i ];
+  str_choices << "@";
   this->m_Parameters[ name ] =
-    TParameter( Self::Choices, TValues( str_choices.str( ), "" ) );
+    TParameter( Self::Choices, str_choices.str( ) );
   this->Modified( );
 }
 
@@ -169,7 +151,7 @@ GetString( const TString& name, bool force ) const
   if( i != this->m_Parameters.end( ) )
   {
     if( i->second.first == Self::String || !force )
-      return( i->second.second.second );
+      return( i->second.second );
 
   } // fi
   return( "" );
@@ -184,7 +166,7 @@ GetBool( const TString& name ) const
   if( i != this->m_Parameters.end( ) )
   {
     if( i->second.first == Self::Bool )
-      return( std::atoi( i->second.second.second.c_str( ) ) == 1 );
+      return( std::atoi( i->second.second.c_str( ) ) == 1 );
 
   } // fi
   return( false );
@@ -199,7 +181,7 @@ GetInt( const TString& name ) const
   if( i != this->m_Parameters.end( ) )
   {
     if( i->second.first == Self::Int )
-      return( TInt( std::atoi( i->second.second.second.c_str( ) ) ) );
+      return( TInt( std::atoi( i->second.second.c_str( ) ) ) );
 
   } // fi
   return( TInt( 0 ) );
@@ -214,7 +196,7 @@ GetUint( const TString& name ) const
   if( i != this->m_Parameters.end( ) )
   {
     if( i->second.first == Self::Uint )
-      return( TUint( std::atoi( i->second.second.second.c_str( ) ) ) );
+      return( TUint( std::atoi( i->second.second.c_str( ) ) ) );
 
   } // fi
   return( TUint( 0 ) );
@@ -230,7 +212,7 @@ GetReal( const TString& name ) const
   {
     if( i->second.first == Self::Real )
     {
-      std::istringstream tok_str( i->second.second.second );
+      std::istringstream tok_str( i->second.second );
       float v;
       tok_str >> v;
       return( TReal( v ) );
@@ -252,7 +234,7 @@ GetStringList( std::vector< TString >& lst, const TString& name ) const
   if( i->second.first != Self::StringList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   while( std::getline( str, token, '#' ) )
     lst.push_back( token );
@@ -269,7 +251,7 @@ GetBoolList( std::vector< TBool >& lst, const TString& name ) const
   if( i->second.first != Self::BoolList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   while( std::getline( str, token, '#' ) )
     lst.push_back( std::atoi( token.c_str( ) ) == 1 );
@@ -286,7 +268,7 @@ GetIntList( std::vector< TInt >& lst, const TString& name ) const
   if( i->second.first != Self::IntList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   while( std::getline( str, token, '#' ) )
     lst.push_back( TInt( std::atoi( token.c_str( ) ) ) );
@@ -303,7 +285,7 @@ GetUintList( std::vector< TUint >& lst, const TString& name ) const
   if( i->second.first != Self::UintList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   while( std::getline( str, token, '#' ) )
     lst.push_back( TUint( std::atoi( token.c_str( ) ) ) );
@@ -320,7 +302,7 @@ GetRealList( std::vector< TReal >& lst, const TString& name ) const
   if( i->second.first != Self::RealList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   while( std::getline( str, token, '#' ) )
   {
@@ -343,7 +325,10 @@ GetChoices( std::vector< TString >& choices, const TString& name ) const
   if( i->second.first != Self::Choices )
     return;
 
-  std::istringstream str( i->second.second.first );
+  std::istringstream str_choices( i->second.second );
+  std::string real_choices;
+  std::getline( str_choices, real_choices, '@' );
+  std::istringstream str( real_choices );
   std::string token;
   while( std::getline( str, token, '#' ) )
     choices.push_back( token );
@@ -359,7 +344,12 @@ GetSelectedChoice( const TString& name ) const
     return( "" );
   if( i->second.first != Self::Choices )
     return( "" );
-  return( i->second.second.second );
+
+  std::istringstream str_choices( i->second.second );
+  std::string real_choice;
+  std::getline( str_choices, real_choice, '@' );
+  std::getline( str_choices, real_choice, '@' );
+  return( real_choice );
 }
 
 // -------------------------------------------------------------------------
@@ -371,7 +361,7 @@ SetString( const TString& name, const TString& v, bool force )
     return;
   if( i->second.first != Self::String && force )
     return;
-  i->second.second.second = v;
+  i->second.second = v;
   this->Modified( );
 }
 
@@ -387,7 +377,7 @@ SetString( const TString& name, const TString& v, bool force )
       return;                                                   \
     std::stringstream str;                                      \
     str << v;                                                   \
-    i->second.second.second = str.str( );                       \
+    i->second.second = str.str( );                              \
     this->Modified( );                                          \
   }
 
@@ -407,11 +397,11 @@ cpPlugins_Parameters_Set( Real );
     if( i->second.first != Self::Y##List )                      \
       return;                                                   \
     std::stringstream str;                                      \
-    if( i->second.second.second == "" )                         \
+    if( i->second.second == "" )                                \
       str << v;                                                 \
     else                                                        \
       str << "#" << v;                                          \
-    i->second.second.second += str.str( );                      \
+    i->second.second += str.str( );                             \
     this->Modified( );                                          \
   }
 
@@ -431,7 +421,7 @@ cpPlugins_Parameters_Add( Real );
       return;                                                   \
     if( i->second.first != Self::Y##List )                      \
       return;                                                   \
-    i->second.second.second = "";                               \
+    i->second.second = "";                                      \
     this->Modified( );                                          \
   }
 
@@ -453,10 +443,17 @@ SetSelectedChoice( const TString& name, const TString& choice )
     return( false );
   if( i->second.first != Self::Choices )
     return( false );
-  if( i->second.second.first.find( choice ) != std::string::npos )
+
+  std::vector< TString > c;
+  this->GetChoices( c, name );
+  if( std::find( c.begin( ), c.end( ), choice ) != c.end( ) )
   {
-    i->second.second.second = choice;
-    this->Modified( );
+    std::istringstream str_choices( i->second.second );
+    std::string choices;
+    std::getline( str_choices, choices, '@' );
+    std::stringstream new_choices;
+    new_choices << choices << "@" << choice;
+    i->second.second = new_choices.str( );
     return( true );
   }
   else
@@ -487,8 +484,7 @@ PrintSelf( std::ostream& os, itk::Indent indent ) const
     os << indent
        << i->first << ": ("
        << i->second.first << " | "
-       << i->second.second.first << " | "
-       << i->second.second.second << ")"
+       << i->second.second << ")"
        << std::endl;
 }
 
index 9c97639e11fce640eb199cea2ba942d0f20312d0..dfcfc793300e552a1055e82cbda7725d888f39cd 100644 (file)
@@ -45,9 +45,7 @@ namespace cpPlugins
       typedef double        TReal;
       typedef std::string   TString;
 
-      // NOTE: std::pair< default, value >
-      typedef std::pair< TString, TString >    TValues;
-      typedef std::pair< Self::Type, TValues > TParameter;
+      typedef std::pair< Self::Type, TString > TParameter;
       typedef std::map< TString, TParameter >  TParameters;
 
     public:
@@ -64,25 +62,14 @@ namespace cpPlugins
       // Parameters container configuration
       void Clear( );
 
-      void ConfigureAsString( const TString& name, const TString& v );
-      void ConfigureAsBool( const TString& name, const TBool& v );
-      void ConfigureAsInt( const TString& name, const TInt& v );
-      void ConfigureAsUint( const TString& name, const TUint& v );
-      void ConfigureAsReal( const TString& name, const TReal& v );
-
-      template< class I >
-        inline void ConfigureAsIndex(
-          const TString& name, const TUint& dim, const I& v
-          );
-      template< class P >
-        inline void ConfigureAsPoint(
-          const TString& name, const TUint& dim, const P& v
-          );
-      template< class V >
-        inline void ConfigureAsVector(
-          const TString& name, const TUint& dim, const V& v
-          );
-
+      void ConfigureAsString( const TString& name );
+      void ConfigureAsBool( const TString& name );
+      void ConfigureAsInt( const TString& name );
+      void ConfigureAsUint( const TString& name );
+      void ConfigureAsReal( const TString& name );
+      void ConfigureAsIndex( const TString& name );
+      void ConfigureAsPoint( const TString& name );
+      void ConfigureAsVector( const TString& name );
       void ConfigureAsStringList( const TString& name );
       void ConfigureAsBoolList( const TString& name );
       void ConfigureAsIntList( const TString& name );
@@ -91,6 +78,7 @@ namespace cpPlugins
       void ConfigureAsIndexList( const TString& name );
       void ConfigureAsPointList( const TString& name );
       void ConfigureAsVectorList( const TString& name );
+      void ConfigureAsChoices( const TString& name );
       void ConfigureAsChoices(
         const TString& name, const std::vector< TString >& choices
         );
index b633f879f5e33b70b0a3064e259ca0c754849b4d..d0fb9c27b1e2cb055286e8d1efb24dddfc329c99 100644 (file)
@@ -1,51 +1,6 @@
 #ifndef __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
 #define __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
 
-// -------------------------------------------------------------------------
-template< class I >
-void cpPlugins::Interface::Parameters::
-ConfigureAsIndex( const TString& name, const TUint& dim, const I& v )
-{
-  std::stringstream str;
-  str << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  std::string s = str.str( );
-  this->m_Parameters[ name ] =
-    TParameter( Self::Index, TValues( s, s ) );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class P >
-void cpPlugins::Interface::Parameters::
-ConfigureAsPoint( const TString& name, const TUint& dim, const P& v )
-{
-  std::stringstream str;
-  str << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  std::string s = str.str( );
-  this->m_Parameters[ name ] =
-    TParameter( Self::Point, TValues( s, s ) );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class V >
-void cpPlugins::Interface::Parameters::
-ConfigureAsVector( const TString& name, const TUint& dim, const V& v )
-{
-  std::stringstream str;
-  str << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  std::string s = str.str( );
-  this->m_Parameters[ name ] =
-    TParameter( Self::Vector, TValues( s, s ) );
-  this->Modified( );
-}
-
 // -------------------------------------------------------------------------
 template< class I >
 I cpPlugins::Interface::Parameters::
@@ -57,7 +12,7 @@ GetIndex( const TString& name, const TUint& dim ) const
   {
     if( i->second.first == Self::Index )
     {
-      std::istringstream str( i->second.second.second );
+      std::istringstream str( i->second.second );
       std::string token;
       unsigned int d = 0;
       while( std::getline( str, token, ';' ) && d < dim )
@@ -89,7 +44,7 @@ GetPoint( const TString& name, const TUint& dim ) const
   {
     if( i->second.first == Self::Point )
     {
-      std::istringstream str( i->second.second.second );
+      std::istringstream str( i->second.second );
       std::string token;
       unsigned int d = 0;
       while( std::getline( str, token, ';' ) && d < dim )
@@ -122,7 +77,7 @@ GetVector( const TString& name, const TUint& dim ) const
   {
     if( i->second.first == Self::Vector )
     {
-      std::istringstream str( i->second.second.second );
+      std::istringstream str( i->second.second );
       std::string token;
       unsigned int d = 0;
       while( std::getline( str, token, ';' ) && d < dim )
@@ -159,7 +114,7 @@ GetIndexList(
   if( i->second.first == Self::IndexList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   unsigned int d = 0;
   while( std::getline( str, token, '#' ) )
@@ -194,7 +149,7 @@ GetPointList(
   if( i->second.first == Self::PointList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   unsigned int d = 0;
   while( std::getline( str, token, '#' ) )
@@ -230,7 +185,7 @@ GetVectorList(
   if( i->second.first == Self::VectorList )
     return;
 
-  std::istringstream str( i->second.second.second );
+  std::istringstream str( i->second.second );
   std::string token;
   unsigned int d = 0;
   while( std::getline( str, token, '#' ) )
@@ -266,7 +221,7 @@ SetIndex( const TString& name, const TUint& dim, const I& v )
   str << v[ 0 ];
   for( unsigned int d = 1; d < dim; ++d )
     str << ";" << v[ d ];
-  i->second.second.second = str.str( );
+  i->second.second = str.str( );
   this->Modified( );
 }
 
@@ -285,7 +240,7 @@ SetPoint( const TString& name, const TUint& dim, const P& v )
   str << v[ 0 ];
   for( unsigned int d = 1; d < dim; ++d )
     str << ";" << v[ d ];
-  i->second.second.second = str.str( );
+  i->second.second = str.str( );
   this->Modified( );
 }
 
@@ -304,7 +259,7 @@ SetVector( const TString& name, const TUint& dim, const V& v )
   str << v[ 0 ];
   for( unsigned int d = 1; d < dim; ++d )
     str << ";" << v[ d ];
-  i->second.second.second = str.str( );
+  i->second.second = str.str( );
   this->Modified( );
 }
 
@@ -320,13 +275,13 @@ AddToIndexList( const TString& name, const TUint& dim, const I& v )
     return;
 
   std::stringstream str;
-  if( i->second.second.second == "" )
+  if( i->second.second == "" )
     str << v[ 0 ];
   else
     str << "#" << v[ 0 ];
   for( unsigned int d = 1; d < dim; ++d )
     str << ";" << v[ d ];
-  i->second.second.second += str.str( );
+  i->second.second += str.str( );
   this->Modified( );
 }
 
@@ -342,13 +297,13 @@ AddToPointList( const TString& name, const TUint& dim, const P& v )
     return;
 
   std::stringstream str;
-  if( i->second.second.second == "" )
+  if( i->second.second == "" )
     str << v[ 0 ];
   else
     str << "#" << v[ 0 ];
   for( unsigned int d = 1; d < dim; ++d )
     str << ";" << v[ d ];
-  i->second.second.second += str.str( );
+  i->second.second += str.str( );
   this->Modified( );
 }
 
@@ -364,13 +319,13 @@ AddToVectorList( const TString& name, const TUint& dim, const V& v )
     return;
 
   std::stringstream str;
-  if( i->second.second.second == "" )
+  if( i->second.second == "" )
     str << v[ 0 ];
   else
     str << "#" << v[ 0 ];
   for( unsigned int d = 1; d < dim; ++d )
     str << ";" << v[ d ];
-  i->second.second.second += str.str( );
+  i->second.second += str.str( );
   this->Modified( );
 }
 
index b623ad9a025e44118c0ab0b56de645f151169025..d1578ba12818ddb9a3070f113587fcffc473ae98 100644 (file)
@@ -59,6 +59,8 @@ LoadWorkspace( const std::string& fname )
       {
         // Read parameters
         TParameters* parameters = this->GetParameters( name_value );
+        parameters->Clear( );
+
         TiXmlElement* param = filter->FirstChildElement( "parameter" );
         while( param != NULL )
         {
@@ -70,121 +72,42 @@ LoadWorkspace( const std::string& fname )
             const char* value = param->Attribute( "value" );
             if( value != NULL )
             {
-              std::istringstream value_str( value );
               if( param_type_str == "String" )
-                parameters->SetString( param_name, value );
+                parameters->ConfigureAsString( param_name );
               else if( param_type_str == "Bool" )
-                parameters->SetBool( param_name, value[ 0 ] != '0' );
+                parameters->ConfigureAsBool( param_name );
               else if( param_type_str == "Int" )
-              {
-                TParameters::TInt v;
-                value_str >> v;
-                parameters->SetInt( param_name, v );
-              }
+                parameters->ConfigureAsInt( param_name );
               else if( param_type_str == "Uint" )
-              {
-                TParameters::TUint v;
-                value_str >> v;
-                parameters->SetUint( param_name, v );
-              }
+                parameters->ConfigureAsUint( param_name );
               else if( param_type_str == "Real" )
-              {
-                TParameters::TReal v;
-                value_str >> v;
-                parameters->SetReal( param_name, v );
-              }
-              /* TODO
-                 else if( param_type_str == "Index" )
-                 else if( param_type_str == "Point" )
-                 else if( param_type_str == "Vector" )
-              */
-            }
-            else
-            {
-              if( param_type_str == "StringList" )
-              {
-                TiXmlElement* item = param->FirstChildElement( "item" );
-                while( item != NULL )
-                {
-                  value = item->Attribute( "value" );
-                  if( value != NULL )
-                    parameters->AddToStringList( param_name, value );
-                  item = item->NextSiblingElement( "item" );
-
-                } // elihw
-              }
+                parameters->ConfigureAsReal( param_name );
+              else if( param_type_str == "Index" )
+                parameters->ConfigureAsIndex( param_name );
+              else if( param_type_str == "Point" )
+                parameters->ConfigureAsPoint( param_name );
+              else if( param_type_str == "Vector" )
+                parameters->ConfigureAsVector( param_name );
+              else if( param_type_str == "StringList" )
+                parameters->ConfigureAsStringList( param_name );
               else if( param_type_str == "BoolList" )
-              {
-                TiXmlElement* item = param->FirstChildElement( "item" );
-                while( item != NULL )
-                {
-                  value = item->Attribute( "value" );
-                  if( value != NULL )
-                    parameters->AddToBoolList( param_name, value[ 0 ] != '0' );
-                  item = item->NextSiblingElement( "item" );
-
-                } // elihw
-              }
+                parameters->ConfigureAsBoolList( param_name );
               else if( param_type_str == "IntList" )
-              {
-                TiXmlElement* item = param->FirstChildElement( "item" );
-                while( item != NULL )
-                {
-                  value = item->Attribute( "value" );
-                  if( value != NULL )
-                  {
-                    std::istringstream value_str( value );
-                    TParameters::TInt v;
-                    value_str >> v;
-                    parameters->AddToIntList( param_name, v );
-
-                  } // fi
-                  item = item->NextSiblingElement( "item" );
-
-                } // elihw
-              }
+                parameters->ConfigureAsIntList( param_name );
               else if( param_type_str == "UintList" )
-              {
-                TiXmlElement* item = param->FirstChildElement( "item" );
-                while( item != NULL )
-                {
-                  value = item->Attribute( "value" );
-                  if( value != NULL )
-                  {
-                    std::istringstream value_str( value );
-                    TParameters::TUint v;
-                    value_str >> v;
-                    parameters->AddToUintList( param_name, v );
-
-                  } // fi
-                  item = item->NextSiblingElement( "item" );
-
-                } // elihw
-              }
+                parameters->ConfigureAsUintList( param_name );
               else if( param_type_str == "RealList" )
-              {
-                TiXmlElement* item = param->FirstChildElement( "item" );
-                while( item != NULL )
-                {
-                  value = item->Attribute( "value" );
-                  if( value != NULL )
-                  {
-                    std::istringstream value_str( value );
-                    TParameters::TReal v;
-                    value_str >> v;
-                    parameters->AddToRealList( param_name, v );
+                parameters->ConfigureAsRealList( param_name );
+              else if( param_type_str == "IndexList" )
+                parameters->ConfigureAsIndexList( param_name );
+              else if( param_type_str == "PointList" )
+                parameters->ConfigureAsPointList( param_name );
+              else if( param_type_str == "VectorList" )
+                parameters->ConfigureAsVectorList( param_name );
+              else if( param_type_str == "Choices" )
+                parameters->ConfigureAsChoices( param_name );
+              parameters->SetString( param_name, value, false );
 
-                  } // fi
-                  item = item->NextSiblingElement( "item" );
-
-                } // elihw
-              }
-              /* TODO
-                 else if( param_type_str == "IndexList" )
-                 else if( param_type_str == "PointList" )
-                 else if( param_type_str == "VectorList" )
-                 else if( param_type_str == "Choices" );
-              */
             } // fi
 
           } // fi
@@ -203,7 +126,7 @@ LoadWorkspace( const std::string& fname )
 
   } // elihw
 
-  // Read filters
+  // Read connections
   TiXmlElement* connection = root->FirstChildElement( "connection" );
   while( connection != NULL )
   {
@@ -271,7 +194,6 @@ SaveWorkspace( const std::string& fname ) const
       {
         TiXmlElement* p = new TiXmlElement( "parameter" );
         p->SetAttribute( "name", nIt->c_str( ) );
-        //const char* param_type = param->Attribute( "type" );
         if( params->HasString( *nIt ) )
           p->SetAttribute( "type", "String" );
         else if( params->HasBool( *nIt ) ) 
@@ -306,7 +228,9 @@ SaveWorkspace( const std::string& fname ) const
           p->SetAttribute( "type", "VectorList" );
         else if( params->HasChoices( *nIt ) )
           p->SetAttribute( "type", "Choices" );
-        p->SetAttribute( "value", params->GetString( *nIt, false ).c_str( ) );
+        p->SetAttribute(
+          "value", params->GetString( *nIt, false ).c_str( )
+          );
         e->LinkEndChild( p );
 
       } // rof
@@ -314,10 +238,39 @@ SaveWorkspace( const std::string& fname ) const
     }
     else if( data != NULL )
     {
+      // TODO
     } // fi
 
   } // rof
 
+  // Save connections
+  auto mIt = this->m_Graph->BeginEdgesRows( );
+  for( ; mIt != this->m_Graph->EndEdgesRows( ); ++mIt )
+  {
+    auto rIt = mIt->second.begin( );
+    for( ; rIt != mIt->second.end( ); ++rIt )
+    {
+      auto eIt = rIt->second.begin( );
+      for( ; eIt != rIt->second.end( ); ++eIt )
+      {
+        TiXmlElement* conn = new TiXmlElement( "connection" );
+        TiXmlElement* orig = new TiXmlElement( "origin" );
+        TiXmlElement* dest = new TiXmlElement( "destination" );
+        orig->SetAttribute( "filter", mIt->first.c_str( ) );
+        orig->SetAttribute( "name", eIt->first.c_str( ) );
+        dest->SetAttribute( "filter", rIt->first.c_str( ) );
+        dest->SetAttribute( "name", eIt->second.c_str( ) );
+
+        conn->LinkEndChild( orig );
+        conn->LinkEndChild( dest );
+        root->LinkEndChild( conn );
+
+      } // rof
+
+    } // rof
+
+  } // rof
+
   // Physical write and return
   doc->LinkEndChild( root );
   doc->SaveFile( fname.c_str( ) );
index 7460520f37303fd146525044a4560771467ea651..55b2eedfab3b9b209c6ac088e098337e4b4d5306 100644 (file)
@@ -13,7 +13,8 @@ BinaryErodeImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsUint( "Radius", 2 );
+  this->m_Parameters->ConfigureAsUint( "Radius" );
+  this->m_Parameters->SetUint( "Radius", 2 );
 }
 
 // -------------------------------------------------------------------------
index 5dc60cba906aabf2a6f0a21845275b37b9a22633..09ba2c3f1ba5513ab4be6bfdc4da1d6351487f4e 100644 (file)
@@ -11,10 +11,15 @@ BinaryThresholdImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsReal( "LowerThresholdValue", 0 );
-  this->m_Parameters->ConfigureAsReal( "UpperThresholdValue", 10000 );
-  this->m_Parameters->ConfigureAsUint( "InsideValue", 1 );
-  this->m_Parameters->ConfigureAsUint( "OutsideValue", 0 );
+  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 );
 }
 
 // -------------------------------------------------------------------------
index 2dbbf27501ca9d14801721e60f0f0ea44a75717f..c6aef7ebd2db77fa7fbfbe39a9cd7018eb93cdc5 100644 (file)
@@ -169,13 +169,17 @@ DoubleFloodImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  double seed[ 3 ] = { double( 0 ) };
-  this->m_Parameters->ConfigureAsPoint( "Seed0", 3, seed );
-  this->m_Parameters->ConfigureAsPoint( "Seed1", 3, seed );
-  this->m_Parameters->ConfigureAsReal( "Window", 0 );
-  this->m_Parameters->ConfigureAsReal( "Level", 0 );
-  this->m_Parameters->ConfigureAsUint( "InsideValue", 255 );
-  this->m_Parameters->ConfigureAsUint( "OutsideValue", 0 );
+  this->m_Parameters->ConfigureAsPoint( "Seed0" );
+  this->m_Parameters->ConfigureAsPoint( "Seed1" );
+  this->m_Parameters->ConfigureAsReal( "Window" );
+  this->m_Parameters->ConfigureAsReal( "Level" );
+  this->m_Parameters->ConfigureAsUint( "InsideValue" );
+  this->m_Parameters->ConfigureAsUint( "OutsideValue" );
+
+  this->m_Parameters->SetReal( "Window", 0 );
+  this->m_Parameters->SetReal( "Level", 0 );
+  this->m_Parameters->SetUint( "InsideValue", 255 );
+  this->m_Parameters->SetUint( "OutsideValue", 0 );
 }
 
 // -------------------------------------------------------------------------
index 65a70809a3cd136e660a245349d10cd80703f8db..5a65ca67da587acbbb6536b53a544ffb61c56cb3 100644 (file)
@@ -11,8 +11,11 @@ ExtractSliceImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsUint( "Axis", 0 );
-  this->m_Parameters->ConfigureAsInt( "Slice", 0 );
+  this->m_Parameters->ConfigureAsUint( "Axis" );
+  this->m_Parameters->ConfigureAsInt( "Slice" );
+
+  this->m_Parameters->SetUint( "Axis", 0 );
+  this->m_Parameters->SetInt( "Slice", 0 );
 }
 
 // -------------------------------------------------------------------------
index 71f90cc70e8876b1bf374f5daaddf533a1cb900c..376602bfe6d9f4708f70a0fd5115b6beeb3de488 100644 (file)
@@ -12,12 +12,16 @@ FloodFillImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  double seed[ 3 ] = { double( 0 ) };
-  this->m_Parameters->ConfigureAsPoint( "Seed", 3, seed );
-  this->m_Parameters->ConfigureAsReal( "Window", 0 );
-  this->m_Parameters->ConfigureAsReal( "Level", 0 );
-  this->m_Parameters->ConfigureAsUint( "InsideValue", 0 );
-  this->m_Parameters->ConfigureAsUint( "OutsideValue", 255 );
+  this->m_Parameters->ConfigureAsPoint( "Seed" );
+  this->m_Parameters->ConfigureAsReal( "Window" );
+  this->m_Parameters->ConfigureAsReal( "Level" );
+  this->m_Parameters->ConfigureAsUint( "InsideValue" );
+  this->m_Parameters->ConfigureAsUint( "OutsideValue" );
+
+  this->m_Parameters->SetReal( "Window", 0 );
+  this->m_Parameters->SetReal( "Level", 0 );
+  this->m_Parameters->SetUint( "InsideValue", 0 );
+  this->m_Parameters->SetUint( "OutsideValue", 255 );
 }
 
 // -------------------------------------------------------------------------
index f07b60e4e27832199c80d1a4cf7f6dad75d7cea0..8116e211ff32895d1e5f6cf2a860de75381fede9 100644 (file)
@@ -195,15 +195,8 @@ MacheteFilter( )
   this->_MakeOutput< cpPlugins::Interface::DataObject >( "PositiveOutput" );
   this->_MakeOutput< cpPlugins::Interface::DataObject >( "NegativeOutput" );
 
-  itk::Point< double, 3 > center;
-  itk::Vector< double, 3 > normal;
-
-  center.Fill( double( 0 ) );
-  normal.Fill( double( 0 ) );
-  normal[ 0 ] = double( 1 );
-
-  this->m_Parameters->ConfigureAsPoint( "PlaneCenter", 3, center );
-  this->m_Parameters->ConfigureAsVector( "PlaneNormal", 3, normal );
+  this->m_Parameters->ConfigureAsPoint( "PlaneCenter" );
+  this->m_Parameters->ConfigureAsVector( "PlaneNormal" );
 }
 
 // -------------------------------------------------------------------------
index f56c6e1e7f7ed6b17f127e8e8d25976a08cfc92d..e40ecb192c76217e4b05f44677cac80f1e655ee9 100644 (file)
@@ -15,13 +15,17 @@ MacheteImageFilter()
   this->_AddInput("Input");
   this->_MakeOutput< cpPlugins::Interface::Image >("Output");
 
-  this->m_Parameters->ConfigureAsReal("Radius", 20);
+  this->m_Parameters->ConfigureAsReal("Radius");
   //this->m_Parameters->ConfigureAsPoint("Point", 3, 3);
-  this->m_Parameters->ConfigureAsReal("X", 30);
-  this->m_Parameters->ConfigureAsReal("Y", 30);
-  this->m_Parameters->ConfigureAsReal("Z", 30);
-
-
+  this->m_Parameters->ConfigureAsReal("X");
+  this->m_Parameters->ConfigureAsReal("Y");
+  this->m_Parameters->ConfigureAsReal("Z");
+
+  this->m_Parameters->SetReal("Radius", 20);
+  //this->m_Parameters->SetPoint("Point", 3, 3);
+  this->m_Parameters->SetReal("X", 30);
+  this->m_Parameters->SetReal("Y", 30);
+  this->m_Parameters->SetReal("Z", 30);
 }
 
 // -------------------------------------------------------------------------
index d47b50016c5706d352cd279f4369cc07dafb7307..da2f7f39e59b99b0fa0eff8e3308b86ca776e39f 100644 (file)
@@ -11,7 +11,8 @@ MedianImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsUint( "Radius", 3 );
+  this->m_Parameters->ConfigureAsUint( "Radius" );
+  this->m_Parameters->SetUint( "Radius", 3 );
 }
 
 // -------------------------------------------------------------------------
index 22df71acbe944439fc457bb9587ca9dc0fd55f17..ed8b95a3baf5d016650e439131ab439ebf363282 100644 (file)
@@ -11,9 +11,13 @@ OtsuThresholdImageFilter( )
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsUint( "NumberOfHistogramBins", 100 );
-  this->m_Parameters->ConfigureAsUint( "InsideValue", 255 );
-  this->m_Parameters->ConfigureAsUint( "OutsideValue", 0 );
+  this->m_Parameters->ConfigureAsUint( "NumberOfHistogramBins" );
+  this->m_Parameters->ConfigureAsUint( "InsideValue" );
+  this->m_Parameters->ConfigureAsUint( "OutsideValue" );
+
+  this->m_Parameters->SetUint( "NumberOfHistogramBins", 100 );
+  this->m_Parameters->SetUint( "InsideValue", 255 );
+  this->m_Parameters->SetUint( "OutsideValue", 0 );
 }
 
 // -------------------------------------------------------------------------
index c7c671b6e3e3a6871bc4ef1421ab12e3d330ab91..2ed0b7d79abc994afe3a2fbcfe8e93af206516ca 100644 (file)
@@ -12,11 +12,14 @@ SphereMeshSource( )
 {
   this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
 
-  double point[ 3 ] = { double( 0 ) };
-  this->m_Parameters->ConfigureAsPoint( "Center", 3, point );
-  this->m_Parameters->ConfigureAsReal( "Radius", 1 );
-  this->m_Parameters->ConfigureAsUint( "PhiResolution", 8 );
-  this->m_Parameters->ConfigureAsUint( "ThetaResolution", 8 );
+  this->m_Parameters->ConfigureAsPoint( "Center" );
+  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 );
 }
 
 // -------------------------------------------------------------------------
index c91247606f3e88cbfe3671a535bb0d5d680fdf0a..c74d52ae4789ae4a4dfd4fa2cb8db951160bba18 100644 (file)
@@ -32,9 +32,7 @@ namespace cpPlugins
     public:
       itkNewMacro( Self );
       itkTypeMacro( DicomSeriesReader, ImageReader );
-      cpPlugins_Id_Macro(
-        cpPlugins::IO::DicomSeriesReader, "DicomSeriesReader"
-        );
+      cpPlugins_Id_Macro( cpPlugins::IO::DicomSeriesReader, "IO" );
 
     public:
       virtual DialogResult ExecConfigurationDialog( QWidget* parent );
index 8866f7d2e6add18045f66f659667aeb40c916cd8..17744fa4e38a48c5a1007c54800476b785a1f02d 100644 (file)
@@ -58,7 +58,8 @@ ImageReader( )
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsStringList( "FileNames" );
-  this->m_Parameters->ConfigureAsBool( "VectorType", false );
+  this->m_Parameters->ConfigureAsBool( "VectorType" );
+  this->m_Parameters->SetBool( "VectorType", false );
 }
 
 // -------------------------------------------------------------------------
index 822c5fd7b4ccaea3e83b9b2408072b1fbc1cce1a..50f0b0a7ec98fa7079a1333a65a46ab03c9153ac 100644 (file)
@@ -32,9 +32,7 @@ namespace cpPlugins
     public:
       itkNewMacro( Self );
       itkTypeMacro( ImageReader, cpPluginsInterfaceImageSource );
-      cpPlugins_Id_Macro(
-        cpPlugins::IO::ImageReader, "ImageReader"
-        );
+      cpPlugins_Id_Macro( cpPlugins::IO::ImageReader, "IO" );
 
     public:
       virtual DialogResult ExecConfigurationDialog( QWidget* parent );
index 519adb6638a3dc1b5fff12f811f1be9690353afb..67b13905630c4ce567aef1d43d084789922ebc50 100644 (file)
@@ -47,8 +47,7 @@ ImageWriter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-
-  this->m_Parameters->ConfigureAsString( "FileName", "" );
+  this->m_Parameters->ConfigureAsString( "FileName" );
 }
 
 // -------------------------------------------------------------------------
index a9db113a356ca8a5ba9698fe70d2913320c936a1..53947493d78397554ff5448c2f352f71ad376f43 100644 (file)
@@ -22,9 +22,7 @@ namespace cpPlugins
     public:
       itkNewMacro( Self );
       itkTypeMacro( ImageWriter, cpPluginsInterfaceImageSink );
-      cpPlugins_Id_Macro(
-        cpPlugins::IO::ImageWriter, "ImageWriter"
-        );
+      cpPlugins_Id_Macro( cpPlugins::IO::ImageWriter, "IO" );
 
     public:
       virtual DialogResult ExecConfigurationDialog( QWidget* parent );
index f8c3b84483a96a6b79be61bf9a11eb056fddcd48..35b95d4cc81909ddb0e603e05e712380ba67c377 100644 (file)
@@ -48,9 +48,11 @@ MeshReader( )
   std::vector< TParameters::TString > valid_types;
   valid_types.push_back( "float" );
   valid_types.push_back( "double" );
-  this->m_Parameters->ConfigureAsString( "FileName", "" );
+  this->m_Parameters->ConfigureAsString( "FileName" );
   this->m_Parameters->ConfigureAsChoices( "PixelType", valid_types );
-  this->m_Parameters->ConfigureAsUint( "Dimension", 3 );
+  this->m_Parameters->ConfigureAsUint( "Dimension" );
+
+  this->m_Parameters->SetUint( "Dimension", 3 );
 }
 
 // -------------------------------------------------------------------------
index 6724cd5ef968c6a322796df6eac360e2f5c02bee..6e18ff955d2be5bfe4a10870442d628ad8c0835e 100644 (file)
@@ -24,9 +24,7 @@ namespace cpPlugins
     public:
       itkNewMacro( Self );
       itkTypeMacro( MeshReader, cpPluginsInterfaceMeshSource );
-      cpPlugins_Id_Macro(
-        cpPlugins::IO::MeshReader, "MeshReader"
-        );
+      cpPlugins_Id_Macro( cpPlugins::IO::MeshReader, "IO" );
 
     public:
       virtual DialogResult ExecConfigurationDialog( QWidget* parent );
index 13531a5590617b4595ff81e79d414107499d7667..e3408b25d6b75d68a706f698c4f51f565316e35b 100644 (file)
@@ -49,8 +49,7 @@ MeshWriter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-
-  this->m_Parameters->ConfigureAsString( "FileName", "" );
+  this->m_Parameters->ConfigureAsString( "FileName" );
 }
 
 // -------------------------------------------------------------------------
index 36668646cdcbd96d1a30ecbe99ea51094ecb8fb6..51224febb82b357755a5b20af2a47a90a4fe1a90 100644 (file)
@@ -24,9 +24,7 @@ namespace cpPlugins
     public:
       itkNewMacro( Self );
       itkTypeMacro( MeshWriter, cpPluginsInterfaceMeshSink );
-      cpPlugins_Id_Macro(
-        cpPlugins::IO::MeshWriter, "MeshWriter"
-        );
+      cpPlugins_Id_Macro( cpPlugins::IO::MeshWriter, "IO" );
 
     public:
       virtual DialogResult ExecConfigurationDialog( QWidget* parent );