[Insight-users] How to use C/C++ memory operations with ITK?

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 5 15:22:19 EDT 2007


Hi Steven,

You can get access to the pixel buffer of the ITK
image by calling:


        image->GetBufferPointer();


However, you should be *VERY* sure of what you are
doing.

Note for example, that if the image is the output
of a filter, then all the changes that you make
will be lost as soon as the filter reruns.

The memory buffer is *ALREADY* allocated by ITK,
so you don't need to use malloc or new.

---

It seems that you should read the Tutorials:

    http://www.itk.org/HTML/Tutorials.htm


In particular:

http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf


This tutorial describes multiple ways of integrating
ITK with existing applications, in particular by
passing the pointer to the pixel buffer back and forth
between ITK and your application.


You will also find useful to read the ITK Software Guide


    http://www.itk.org/ItkSoftwareGuide.pdf


In particular Section 4.1 on "Image", "Data Representation".



    Regards,


       Luis


===============
wei wei wrote:
> Anyone can help? I want to process the DICOM data
> using both ITK and the regular C/C++ memory
> operations.
> 
> Is it possible to access the actual memory of the
> image data which is input by ITK image reader? Is
> there any ITK method who can return a pointer to this
> memory and other information so that I may use it with
> other "malloc()" or "new" operations in C/C++? 
> 
> Thanks a lot in advance!
> 
> Steven
> 
> 
> 
> 
> 
>        
> ____________________________________________________________________________________
> Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
> http://answers.yahoo.com/dir/?link=list&sid=396545433
> _______________________________________________
> 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