]> Creatis software - cpPlugins.git/blobdiff - appli/examples/example_ReadImageSeriesWriteImage.cxx
Parameters finished
[cpPlugins.git] / appli / examples / example_ReadImageSeriesWriteImage.cxx
index c0bc7ad79afe3b5675bb66900d460722bca1d0f1..fdd434124948cb268af436e2d9049bd6767c18f7 100644 (file)
@@ -1,7 +1,6 @@
 #include <cstdlib>
 #include <iostream>
 #include <string>
-#include <vector>
 
 #include <cpPlugins/Interface/Interface.h>
 #include <cpPlugins/Interface/ProcessObject.h>
@@ -24,10 +23,6 @@ int main( int argc, char* argv[] )
   std::string pixel_type = argv[ 4 ];
   bool is_color = ( std::atoi( argv[ 5 ] ) == 1 );
 
-  std::vector< std::string > input_image_files;
-  for( int i = 6; i < argc; ++i )
-    input_image_files.push_back( argv[ i ] );
-
   // Create interface
   typedef cpPlugins::Interface::Interface TInterface;
   typedef TInterface::TClasses            TClasses;
@@ -59,11 +54,8 @@ int main( int argc, char* argv[] )
 
   // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params.SetValueAsStringList(
-    "FileNames",
-    input_image_files.begin( ),
-    input_image_files.end( )
-    );
+  for( int i = 6; i < argc; ++i )
+    reader_params.AddValueToStringList( "FileNames", argv[ 1 ] );
   reader_params.SetValueAsString( "PixelType", pixel_type );
   reader_params.SetValueAsUint( "ImageDimension", dimensions );
   reader_params.SetValueAsUint( "IsColorImage", ( is_color? 1: 0 ) );