]> Creatis software - cpPlugins.git/blobdiff - appli/examples/example_ReadImageSeriesWriteImage.cxx
This does not compile yet: updating plugins interface and transparency of image actors
[cpPlugins.git] / appli / examples / example_ReadImageSeriesWriteImage.cxx
index c0bc7ad79afe3b5675bb66900d460722bca1d0f1..6446d78def2f8ebf63c45ec84703aff15e257d30 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;
@@ -42,7 +37,7 @@ int main( int argc, char* argv[] )
   cpPlugins::Interface::ProcessObject::Pointer writer;
 
   reader =
-    plugins.CreateProcessObject( "cpPlugins::Plugins::ImageSeriesReader" );
+    plugins.CreateProcessObject( "cpPlugins::Plugins::ImageReader" );
   if( reader.IsNull( ) )
   {
     std::cerr << "No suitable reader found in plugins." << std::endl;
@@ -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[ i ] );
   reader_params.SetValueAsString( "PixelType", pixel_type );
   reader_params.SetValueAsUint( "ImageDimension", dimensions );
   reader_params.SetValueAsUint( "IsColorImage", ( is_color? 1: 0 ) );