[Insight-users] Deprecation Warning ImageSeriesWriter ITK 1.8

Luis Ibanez luis.ibanez at kitware.com
Wed Aug 18 08:36:20 EDT 2004


Hi Christoph,

As the warning says, you should now use the
itkNumericSeriesFileNames class in order to
generate the list of files to write.

For an example on how to do this, please
look at


    Insight/Examples/IO/
        ImageSeriesReadWrite.cxx


The essential code will look like:


   typedef itk::NumericSeriesFileNames    NameGeneratorType;

   NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();

   nameGenerator->SetStartIndex( first );
   nameGenerator->SetEndIndex( last );
   nameGenerator->SetIncrementIndex( 1 );

   nameGenerator->SetSeriesFormat( "myImages%04d.png" );

   seriesWriter->SetFileNames( nameGenerator->GetFileNames()  );




Regards,



    Luis




------------------------
Christoph Palm wrote:

> Hi all,
> 
> I just recompiled my code with ITK 1.8.0 and get the following
> warning:
> 
> WARNING: In InsightToolkit-1.8.0/Code/IO/itkImageSeriesWriter.txx, line
> 133
> ImageSeriesWriter (0x82d90e0): This functionality has been DEPRECATED.
> NumericSeriesFileName for generating the filenames
> 
> I use the ImageSeriesWriter in the following way:
> 
> typedef itk::ImageSeriesWriter< InputImageType, OutputImageType >
> WriterType;
> typename WriterType::Pointer writer = WriterType::New();
> writer->SetInput( image );
> std::string filename = tmpDirectory + "/" + tmpDirectory + "%03d." +
> tmpFormat;
> writer->SetSeriesFormat( filename.c_str() );
> writer->SetStartIndex( 1 );
> writer->SetIncrementIndex( 1 );
> writer->Update();
> 
> The output is absolutely correct, but what I want to get rid of the
> warning message! Any suggestions?
> 
> Thanks
> 
> Christoph
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 






More information about the Insight-users mailing list