[Insight-users] Persisting a dynamically created image onto the file system

Andinet Enquobahrie andinet.enqu at kitware.com
Wed Jun 28 15:03:24 EDT 2006


Shlomo Kashani wrote:

>Dear Frank,
>I already read chapter 7 of the ITK manual and the code I posted here is
>based on the examples that are referred to in that chapter
>(ITK\src\Examples\DataRepresentation\Image\). While there are a rich number
>of examples for associating an image reader with an image read from the file
>system and then associating that with an image writer such as:
>
>// create	new	image reader
> ReaderType::Pointer reader = ReaderType::New();
>// create	new	image writer
>WriterType::Pointer writer = WriterType::New();
>reader->SetFileName( argv[1] );
>writer->SetFileName( argv[2] ); 
>writer->SetInput(reader->GetOutput() );
>writer->Update();
> 
>I could not find an example or the method for associating a dynamically
>created image with a file writer. Its as simple as that ?  
>
>Shlomo.
>  
>


Take a look at

ITK\src\Examples\DataRepresentation\Image\Image5.cxx

In this particular example,  block of memory with image pixel data is imported using 
itk::ImportImageFilter and is written out into a file..

-Andinet








More information about the Insight-users mailing list