]> Creatis software - cpPlugins.git/commitdiff
Parameters class fully added
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 16 Jan 2015 18:53:21 +0000 (13:53 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 16 Jan 2015 18:53:21 +0000 (13:53 -0500)
14 files changed:
appli/ImageMPR/CMakeLists.txt
appli/ImageMPR/ImageMPR.cxx
appli/ImageMPR/ImageMPR.h
appli/examples/example_MPR.cxx
appli/examples/example_RGBImageToHSVChannels.cxx
appli/examples/example_ReadImageSeriesWriteImage.cxx
appli/examples/example_ReadQuadEdgeMesh.cxx
appli/examples/example_ReadWriteImage.cxx
appli/examples/example_RenderQuadEdgeMesh.cxx
lib/cpPlugins/Extensions/CMakeLists.txt
lib/cpPlugins/Interface/Parameters.hxx
lib/cpPlugins/Plugins/CMakeLists.txt
lib/cpPlugins/Plugins/ImageSeriesReader.cxx
lib/cpPlugins/Plugins/ImageWriter.cxx

index 8b4f68482c601fb5aa099a6c96b053183406fd99..5660c19b7f205b0cf3dfbc0d3f0d0f566716b422 100644 (file)
@@ -58,6 +58,9 @@ IF(USE_QT4)
   TARGET_LINK_LIBRARIES(
     ${App_NAME}
     cpPlugins_Interface
+    ${QT_LIBRARIES}
+    vtkGUISupportQt
+
     )
 ENDIF(USE_QT4)
 
index 025b8c841dfb1d31bb89545f1e32d7e892eb9b7d..76daaa514f58e8bb235b91dceb8b8f09ea9c34b1 100644 (file)
@@ -116,10 +116,10 @@ _triggered_actionOpenInputImage( )
         );
 
     TParameters reader_params = reader->GetDefaultParameters( );
-    reader_params[ "FileName" ].second = fname;
-    reader_params[ "PixelType" ].second = "short";
-    reader_params[ "ImageDimension" ].second = "3";
-    reader_params[ "IsColorImage" ].second = "0";
+    reader_params.SetValueAsString( "FileName", fname );
+    reader_params.SetValueAsString( "PixelType", "short" );
+    reader_params.SetValueAsUint( "ImageDimension", 3 );
+    reader_params.SetValueAsUint( "IsColorImage", 0 );
     reader->SetParameters( reader_params );
     std::string err = reader->Update( );
 
index c9bb20f31f71f214bc00d4933519e7c6f5c6f95f..4f5144477fc1b695830fbcbcae54da7ee9591182 100644 (file)
@@ -39,7 +39,7 @@ public:
   typedef cpPlugins::Interface::DataObject    TPluginData;
   typedef cpPlugins::Interface::Image         TPluginImage;
   typedef cpPlugins::Interface::ProcessObject TPlugin;
-  typedef TPlugin::TParameters                TParameters;
+  typedef cpPlugins::Interface::Parameters    TParameters;
 
   typedef std::map< std::string, std::string > TStringMap;
   typedef cpPlugins::Extensions::Visualization::MPRWithDifferentWindows TMPR;
index 9a8865c2de7d66fdfcce854b75319b4947c2055b..6b37e2a181f5aceaed54bebe8a5730a2d16664ea 100644 (file)
@@ -40,7 +40,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef TProcessObject::TParameters         TParameters;
+  typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader;
 
   reader = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageReader" );
@@ -53,9 +53,10 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params[ "FileName" ].second = input_image_file;
-  reader_params[ "PixelType" ].second = pixel_type;
-  reader_params[ "ImageDimension" ].second = "3";
+  reader_params.SetValueAsString( "FileName", input_image_file );
+  reader_params.SetValueAsString( "PixelType", pixel_type );
+  reader_params.SetValueAsUint( "ImageDimension", 3 );
+  reader_params.SetValueAsUint( "IsColorImage", 0 );
   reader->SetParameters( reader_params );
 
   // Execute reader
index 9a2a46893fd33e684e628ef9f549e2a8337f4920..84b9d3cd9a5243a56fb5e23d2a1a6cb354182080 100644 (file)
@@ -11,7 +11,7 @@ typedef cpPlugins::Interface::Interface     TInterface;
 typedef cpPlugins::Interface::DataObject    TDataObject;
 typedef TInterface::TClasses                TClasses;
 typedef cpPlugins::Interface::ProcessObject TProcessObject;
-typedef TProcessObject::TParameters         TParameters;
+typedef cpPlugins::Interface::Parameters    TParameters;
 
 // -------------------------------------------------------------------------
 void SaveImage(
@@ -28,7 +28,7 @@ void SaveImage(
   } // fi
   // Configure reader
   TParameters writer_params = writer->GetDefaultParameters( );
-  writer_params[ "FileName" ].second = fname;
+  writer_params.SetValueAsString( "FileName", fname );
   writer->SetParameters( writer_params );
 
   writer->SetInput( 0, image );
@@ -56,7 +56,7 @@ int main( int argc, char* argv[] )
   std::string output_hue_image_file = argv[ 3 ];
   std::string output_saturation_image_file = argv[ 4 ];
   std::string output_value_image_file = argv[ 5 ];
-  std::string dimensions = argv[ 6 ];
+  unsigned int dimensions = std::atoi( argv[ 6 ] );
   std::string pixel_type = argv[ 7 ];
 
   // Create interface
@@ -85,10 +85,10 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params[ "FileName" ].second = input_image_file;
-  reader_params[ "PixelType" ].second = pixel_type;
-  reader_params[ "ImageDimension" ].second = dimensions;
-  reader_params[ "IsColorImage" ].second = "1";
+  reader_params.SetValueAsString( "FileName", input_image_file );
+  reader_params.SetValueAsString( "PixelType", pixel_type );
+  reader_params.SetValueAsUint( "ImageDimension", dimensions );
+  reader_params.SetValueAsUint( "IsColorImage", 1 );
   reader->SetParameters( reader_params );
 
   // Connect pipeline
index e2216ff7c1a997bf007611006b47ec77985d4776..c0bc7ad79afe3b5675bb66900d460722bca1d0f1 100644 (file)
@@ -1,7 +1,7 @@
 #include <cstdlib>
 #include <iostream>
-#include <sstream>
 #include <string>
+#include <vector>
 
 #include <cpPlugins/Interface/Interface.h>
 #include <cpPlugins/Interface/ProcessObject.h>
@@ -20,14 +20,14 @@ int main( int argc, char* argv[] )
   } // fi
   std::string plugins_file = argv[ 1 ];
   std::string output_image_file = argv[ 2 ];
-  std::string dimensions = argv[ 3 ];
+  unsigned int dimensions = std::atoi( argv[ 3 ] );
   std::string pixel_type = argv[ 4 ];
   bool is_color = ( std::atoi( argv[ 5 ] ) == 1 );
 
-  std::stringstream input_image_files;
+  std::vector< std::string > input_image_files;
   for( int i = 6; i < argc; ++i )
-    input_image_files << argv[ i ] << ";";
-  
+    input_image_files.push_back( argv[ i ] );
+
   // Create interface
   typedef cpPlugins::Interface::Interface TInterface;
   typedef TInterface::TClasses            TClasses;
@@ -37,7 +37,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef TProcessObject::TParameters         TParameters;
+  typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader;
   cpPlugins::Interface::ProcessObject::Pointer writer;
 
@@ -59,15 +59,19 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params[ "FileNames" ].second = input_image_files.str( );
-  reader_params[ "PixelType" ].second = pixel_type;
-  reader_params[ "ImageDimension" ].second = dimensions;
-  reader_params[ "IsColorImage" ].second = ( is_color )? "1": "0";
+  reader_params.SetValueAsStringList(
+    "FileNames",
+    input_image_files.begin( ),
+    input_image_files.end( )
+    );
+  reader_params.SetValueAsString( "PixelType", pixel_type );
+  reader_params.SetValueAsUint( "ImageDimension", dimensions );
+  reader_params.SetValueAsUint( "IsColorImage", ( is_color? 1: 0 ) );
   reader->SetParameters( reader_params );
 
   // Configure reader
   TParameters writer_params = writer->GetDefaultParameters( );
-  writer_params[ "FileName" ].second = output_image_file;
+  writer_params.SetValueAsString( "FileName", output_image_file );
   writer->SetParameters( writer_params );
 
   // Connect pipeline
index 94b6d6c190c8e3ffc656a6d2005de1988143ae02..49f7d6adf000d460c294ab818eba2b88243248da 100644 (file)
@@ -19,7 +19,7 @@ int main( int argc, char* argv[] )
   } // fi
   std::string plugins_file = argv[ 1 ];
   std::string input_mesh_file = argv[ 2 ];
-  std::string dimensions = argv[ 3 ];
+  unsigned int dimensions = std::atoi( argv[ 3 ] );
   std::string pixel_type = argv[ 4 ];
 
   // Create interface
@@ -31,7 +31,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef TProcessObject::TParameters         TParameters;
+  typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader;
 
   reader = plugins.CreateProcessObject( "cpPlugins::Plugins::MeshReader" );
@@ -44,9 +44,9 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params[ "FileName" ].second = input_mesh_file;
-  reader_params[ "PixelType" ].second = pixel_type;
-  reader_params[ "MeshDimension" ].second = dimensions;
+  reader_params.SetValueAsString( "FileName", input_mesh_file );
+  reader_params.SetValueAsString( "PixelType", pixel_type );
+  reader_params.SetValueAsUint( "MeshDimension", dimensions );
   reader->SetParameters( reader_params );
 
   // Execute reader
index d1419d9ba8347c304d8dc4b3c80092fd6b1c9d15..728f817f487124f0f68fa7cb22794881079ce5c1 100644 (file)
@@ -20,7 +20,7 @@ int main( int argc, char* argv[] )
   std::string plugins_file = argv[ 1 ];
   std::string input_image_file = argv[ 2 ];
   std::string output_image_file = argv[ 3 ];
-  std::string dimensions = argv[ 4 ];
+  unsigned int dimensions = std::atoi( argv[ 4 ] );
   std::string pixel_type = argv[ 5 ];
   bool is_color = ( std::atoi( argv[ 6 ] ) == 1 );
 
@@ -33,7 +33,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef TProcessObject::TParameters         TParameters;
+  typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader;
   cpPlugins::Interface::ProcessObject::Pointer writer;
 
@@ -54,15 +54,15 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params[ "FileName" ].second = input_image_file;
-  reader_params[ "PixelType" ].second = pixel_type;
-  reader_params[ "ImageDimension" ].second = dimensions;
-  reader_params[ "IsColorImage" ].second = ( is_color )? "1": "0";
+  reader_params.SetValueAsString( "FileName", input_image_file );
+  reader_params.SetValueAsString( "PixelType", pixel_type );
+  reader_params.SetValueAsUint( "ImageDimension", dimensions );
+  reader_params.SetValueAsUint( "IsColorImage", ( is_color? 1: 0 ) );
   reader->SetParameters( reader_params );
 
   // Configure reader
   TParameters writer_params = writer->GetDefaultParameters( );
-  writer_params[ "FileName" ].second = output_image_file;
+  writer_params.SetValueAsString( "FileName", output_image_file );
   writer->SetParameters( writer_params );
 
   // Connect pipeline
index 9fcd519d47e24ee334efa3c212869450bf9fc98b..6380660d4e746667241882bb3d4ece02be791542 100644 (file)
@@ -28,7 +28,7 @@ int main( int argc, char* argv[] )
   } // fi
   std::string plugins_file = argv[ 1 ];
   std::string input_mesh_file = argv[ 2 ];
-  std::string dimensions = argv[ 3 ];
+  unsigned int dimensions = std::atoi( argv[ 3 ] );
   std::string pixel_type = argv[ 4 ];
 
   // Create interface
@@ -40,7 +40,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef TProcessObject::TParameters         TParameters;
+  typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader;
 
   reader = plugins.CreateProcessObject( "cpPlugins::Plugins::MeshReader" );
@@ -53,9 +53,9 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params[ "FileName" ].second = input_mesh_file;
-  reader_params[ "PixelType" ].second = pixel_type;
-  reader_params[ "MeshDimension" ].second = dimensions;
+  reader_params.SetValueAsString( "FileName", input_mesh_file );
+  reader_params.SetValueAsString( "PixelType", pixel_type );
+  reader_params.SetValueAsUint( "MeshDimension", dimensions );
   reader->SetParameters( reader_params );
 
   // Execute reader
index 550daf7e8796af333a9a573d04f642c9d53210fc..f9d6d9844631166cde2f6f029fdc94eed0d53e29 100644 (file)
@@ -71,8 +71,9 @@ GENERATE_EXPORT_HEADER(
   )
 TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
-  ${ITK_LIBRARIES}
-  ${VTK_LIBRARIES}
+  ITKCommon
+  ITKVtkGlue
+  vtkInteractionWidgets
   )
 
 ## eof - $RCSfile$
index f0c3a27e8d99b0ab17e95af7a02f33fc35a946e6..0a73b373b2ca558f7a3ed21a81a2eb8cf51f455a 100644 (file)
@@ -2,6 +2,7 @@
 #define __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
 
 #include <cstdlib>
+#include <iostream>
 #include <sstream>
 
 // -------------------------------------------------------------------------
@@ -18,7 +19,7 @@
     std::stringstream ss;                                               \
     for( I i = b; i != e; ++i )                                         \
       ss << *i << ":";                                                  \
-    pIt->second = ss.str( );                                            \
+    pIt->second.second = ss.str( );                                     \
   }
 
 cpPlugins_Interface_Parameters_SetListMacro( String );
@@ -95,6 +96,7 @@ GetValueAsIndexList( std::vector< I >& lst, const TString& name ) const
     return;
 
   // TODO:
+  std::cerr << "TODO GetValueAsIndexList" << std::endl;
 }
 
 // -------------------------------------------------------------------------
@@ -110,6 +112,7 @@ GetValueAsPointList( std::vector< P >& lst, const TString& name ) const
     return;
 
   // TODO:
+  std::cerr << "TODO GetValueAsPointList" << std::endl;
 }
 
 #endif // __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
index d32fafbaecc7e9b307118c558ae385962fe5eb43..372b1504dbb12cfb3f07cc48392fff9958a773ea 100644 (file)
@@ -32,6 +32,7 @@ GENERATE_EXPORT_HEADER(
 TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
   cpPlugins_Interface
+  ${ITK_LIBRARIES}
   )
 
 ## eof - $RCSfile$
index d6fbfa6487919be026847a3591ff28c97e1ea3ab..30585e77182595dfaf498fc590506c8a2c2cf789 100644 (file)
@@ -25,11 +25,15 @@ ImageSeriesReader( )
   this->SetNumberOfOutputs( 1 );
   this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
 
-  this->m_DefaultParameters[ "FileNames" ] =
-    TParameter( "string", "file_name1;file_name2;file_name3;..." );
-  this->m_DefaultParameters[ "PixelType" ] = TParameter( "type", "uchar" );
-  this->m_DefaultParameters[ "ImageDimension" ] = TParameter( "int", "3" );
-  this->m_DefaultParameters[ "IsColorImage" ] = TParameter( "bool", "0" );
+  using namespace cpPlugins::Interface;
+  this->m_DefaultParameters.Configure( Parameters::StringList, "FileNames" );
+  this->m_DefaultParameters.Configure( Parameters::String, "PixelType" );
+  this->m_DefaultParameters.Configure( Parameters::Uint, "Dimension" );
+  this->m_DefaultParameters.Configure( Parameters::Uint, "IsColorImage" );
+  this->m_DefaultParameters.SetValueAsString( "PixelType", "uchar" );
+  this->m_DefaultParameters.SetValueAsUint( "Dimension", 3 );
+  this->m_DefaultParameters.SetValueAsUint( "IsColorImage", 0 );
+  this->m_Parameters = this->m_DefaultParameters;
 }
 
 // -------------------------------------------------------------------------
@@ -42,17 +46,13 @@ cpPlugins::Plugins::ImageSeriesReader::
 std::string cpPlugins::Plugins::ImageSeriesReader::
 _GenerateData( )
 {
-  TParameters::const_iterator dIt;
-
-  // Get image dimension
-  dIt = this->m_Parameters.find( "ImageDimension" );
-  if( dIt == this->m_Parameters.end( ) )
-    dIt = this->m_DefaultParameters.find( "ImageDimension" );
+  using namespace cpPlugins::Interface;
+  Parameters::TUint dim = this->m_Parameters.GetValueAsUint( "Dimension" );
 
   std::string r = "cpPlugins::Plugins::ImageSeriesReader: itk::Image dimension not supported.";
-  if( dIt->second.second == "2" ) r = this->_GD0< 2 >( );
-  else if( dIt->second.second == "3" ) r = this->_GD0< 3 >( );
-  else if( dIt->second.second == "4" ) r = this->_GD0< 4 >( );
+  if     ( dim == 2 ) r = this->_GD0< 2 >( );
+  else if( dim == 3 ) r = this->_GD0< 3 >( );
+  else if( dim == 4 ) r = this->_GD0< 4 >( );
 
   return( r );
 }
@@ -62,61 +62,55 @@ template< unsigned int D >
 std::string cpPlugins::Plugins::ImageSeriesReader::
 _GD0( )
 {
-  TParameters::const_iterator tIt, cIt;
-
-  // Get image pixel type
-  tIt = this->m_Parameters.find( "PixelType" );
-  if( tIt == this->m_Parameters.end( ) )
-    tIt = this->m_DefaultParameters.find( "PixelType" );
-  cIt = this->m_Parameters.find( "IsColorImage" );
-  if( cIt == this->m_Parameters.end( ) )
-    cIt = this->m_DefaultParameters.find( "IsColorImage" );
+  using namespace cpPlugins::Interface;
+  Parameters::TString pt = this->m_Parameters.GetValueAsString( "PixelType" );
+  Parameters::TUint ci = this->m_Parameters.GetValueAsUint( "IsColorImage" );
 
   std::string r = "cpPlugins::Plugins::ImageSeriesReader: itk::Image pixel type not supported";
-  if( cIt->second.second == "0" )
+  if( ci == 0 )
   {
-    if( tIt->second.second == "char" )
+    if( pt == "char" )
       r = this->_GD1< char, D >( );
-    else if( tIt->second.second == "short" )
+    else if( pt == "short" )
       r = this->_GD1< short, D >( );
-    else if( tIt->second.second == "int" )
+    else if( pt == "int" )
       r = this->_GD1< int, D >( );
-    else if( tIt->second.second == "long" )
+    else if( pt == "long" )
       r = this->_GD1< long, D >( );
-    else if( tIt->second.second == "uchar" )
+    else if( pt == "uchar" )
       r = this->_GD1< unsigned char, D >( );
-    else if( tIt->second.second == "ushort" )
+    else if( pt == "ushort" )
       r = this->_GD1< unsigned short, D >( );
-    else if( tIt->second.second == "uint" )
+    else if( pt == "uint" )
       r = this->_GD1< unsigned int, D >( );
-    else if( tIt->second.second == "ulong" )
+    else if( pt == "ulong" )
       r = this->_GD1< unsigned long, D >( );
-    else if( tIt->second.second == "float" )
+    else if( pt == "float" )
       r = this->_GD1< float, D >( );
-    else if( tIt->second.second == "double" )
+    else if( pt == "double" )
       r = this->_GD1< double, D >( );
   }
-  else if( cIt->second.second == "1" )
+  else if( ci == 1 )
   {
-    if( tIt->second.second == "char" )
+    if( pt == "char" )
       r = this->_GD1< itk::RGBPixel< char >, D >( );
-    else if( tIt->second.second == "short" )
+    else if( pt == "short" )
       r = this->_GD1< itk::RGBPixel< short >, D >( );
-    else if( tIt->second.second == "int" )
+    else if( pt == "int" )
       r = this->_GD1< itk::RGBPixel< int >, D >( );
-    else if( tIt->second.second == "long" )
+    else if( pt == "long" )
       r = this->_GD1< itk::RGBPixel< long >, D >( );
-    else if( tIt->second.second == "uchar" )
+    else if( pt == "uchar" )
       r = this->_GD1< itk::RGBPixel< unsigned char >, D >( );
-    else if( tIt->second.second == "ushort" )
+    else if( pt == "ushort" )
       r = this->_GD1< itk::RGBPixel< unsigned short >, D >( );
-    else if( tIt->second.second == "uint" )
+    else if( pt == "uint" )
       r = this->_GD1< itk::RGBPixel< unsigned int >, D >( );
-    else if( tIt->second.second == "ulong" )
+    else if( pt == "ulong" )
       r = this->_GD1< itk::RGBPixel< unsigned long >, D >( );
-    else if( tIt->second.second == "float" )
+    else if( pt == "float" )
       r = this->_GD1< itk::RGBPixel< float >, D >( );
-    else if( tIt->second.second == "double" )
+    else if( pt == "double" )
       r = this->_GD1< itk::RGBPixel< double >, D >( );
   } // fi
   return( r );
@@ -127,17 +121,12 @@ template< class P, unsigned int D >
 std::string cpPlugins::Plugins::ImageSeriesReader::
 _GD1( )
 {
-  TParameters::const_iterator fIt;
-
-  // Get filenames
-  std::set< std::string > filenames;
-  fIt = this->m_Parameters.find( "FileNames" );
-  if( fIt == this->m_Parameters.end( ) )
-    fIt = this->m_DefaultParameters.find( "FileName" );
-  std::istringstream filenames_stream( fIt->second.second );
-  std::string filename;
-  while( std::getline( filenames_stream, filename, ';' ) )
-    filenames.insert( filename );
+  using namespace cpPlugins::Interface;
+  std::vector< Parameters::TString > unordered_names;
+  this->m_Parameters.GetValueAsStringList( unordered_names, "FileNames" );
+  std::set< std::string > ordered_names;
+  for( unsigned int i = 0; i < unordered_names.size( ); ++i )
+    ordered_names.insert( unordered_names[ i ] );
 
   // Reader
   typedef itk::Image< P, D > _TImage;
@@ -152,8 +141,8 @@ _GD1( )
       dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
 
   } // fi
-  std::set< std::string >::const_iterator fnIt = filenames.begin( );
-  for( ; fnIt != filenames.end( ); ++fnIt )
+  std::set< std::string >::const_iterator fnIt = ordered_names.begin( );
+  for( ; fnIt != ordered_names.end( ); ++fnIt )
     reader->AddFileName( *fnIt );
   try
   {
index aea4a21e7d42914c01d9f7d33d5cf05abf8eae98..de74e90d019c5884c8ea32aa9903b5a1e0c344c2 100644 (file)
@@ -37,8 +37,9 @@ ImageWriter( )
 {
   this->SetNumberOfInputs( 1 );
 
-  this->m_DefaultParameters[ "FileName" ] =
-    TParameter( "string", "no_file_name" );
+  using namespace cpPlugins::Interface;
+  this->m_DefaultParameters.Configure( Parameters::String, "FileName" );
+  this->m_Parameters = this->m_DefaultParameters;
 }
 
 // -------------------------------------------------------------------------
@@ -101,12 +102,10 @@ _GD1( )
   typedef itk::Image< P, D > _TImage;
   typedef itk::ImageFileWriter< _TImage > _TWriter;
 
-  TParameters::const_iterator fIt;
-
-  // Get image pixelType
-  fIt = this->m_Parameters.find( "FileName" );
-  if( fIt == this->m_Parameters.end( ) )
-    fIt = this->m_DefaultParameters.find( "FileName" );
+  // Get filename
+  using namespace cpPlugins::Interface;
+  Parameters::TString fname =
+    this->m_Parameters.GetValueAsString( "FileName" );
 
   _TWriter* writer =
     dynamic_cast< _TWriter* >( this->m_RealProcessObject.GetPointer( ) );
@@ -117,7 +116,7 @@ _GD1( )
       dynamic_cast< _TWriter* >( this->m_RealProcessObject.GetPointer( ) );
 
   } // fi
-  writer->SetFileName( fIt->second.second );
+  writer->SetFileName( fname );
   writer->SetInput( dynamic_cast< _TImage* >( this->_GetInput( 0 ) ) );
   try
   {