[Insight-users] Get the data buffer of itk::Image?

Luis Ibanez luis . ibanez at kitware . com
Wed, 15 Oct 2003 09:28:11 -0400


Hi Feng,


You can get the buffer from the itk::Image
http://www . itk . org/Insight/Doxygen/html/classitk_1_1Image . html



by using the method

        GetBufferPointer()

http://www . itk . org/Insight/Doxygen/html/classitk_1_1Image . html#z839_0
It will return a raw pointer to the pixel type.



You could also use the method

        GetPixelContainer()

http://www . itk . org/Insight/Doxygen/html/classitk_1_1Image . html#a11
That returns the intermediate class holding the buffer.



Regards,


   Luis



-------------------
Feng Zhuge wrote:
> I am pretty new to this wonderful package and any help
> is greatly appreciated. 
> 
> Some 3rd party software, e.g., fftw, will take a data
> buffer as its input and output. Like, double *
> Some3rdPartyProcess(double *inputBuffer);
> 
> Therefore, the iterator in ITK does not work for me
> well. 
> 
> Is there a way I can get an itk::Image object's
> buffer?
> I found a m_Buffer member in Image but I am not sure
> how safe it is to use it. 
>