[Insight-users] Converting ITK images into Buffers and back

Luis Ibanez luis.ibanez at kitware.com
Wed Apr 4 11:20:35 EDT 2007


Hi Zihua,

You can get the buffer to the image data by
calling the GetBufferPointer() method in the
ITK Image.

Please look at the Doxygen documentation of
this class at:

http://www.itk.org/Insight/Doxygen/html/classitk_1_1Image.html


You should also look at the Tutorials

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


In particular to:

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

That describes how to integrate ITK into existing
applications. Buffer conversions is the central theme
of this tutorial.


    Regards,


        Luis



------------------
Zihua Su wrote:
> Hi Luis,
> 
> Thank you for your quick reply, Just one more question, After distacn
> map filter, Does ITK have anther filter to convert Image back to
> buffer files? How can i implement this action.
> 
> Thanks a lot
> 
> Zihua
> 
> On 4/4/07, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
>>
>> HI Zihua,
>>
>> You can simply follow the examples in the ITK Software Guide:
>>
>>             http://www.itk.org/ItkSoftwareGuide.pdf
>>
>>
>> A) For creating an ITK image out of a buffer that you already
>>      have in memory you should look at
>>
>>     Section: 4.1.7 "Importing Image Data from a Buffer"
>>     in pdf-page 78.
>>
>>
>> B) For passing an image as input to the
>> DanielssonDistanceMapImageFilter
>>      look at Section 6.8 "Distance Map" in pdf-page 248.
>>
>>     you simply need  to pass the output of your import filter
>>    as the input to the Distance map filter.
>>
>>
>>  Note that you may also want to try the MaurerDistanceMapImageFilter.
>>
>>
>>       Regards,
>>
>>
>>            Luis
>>
>>
>>
>> ============================================
>>
>>
>> On 4/3/07, Zihua Su < zihuabox at gmail.com> wrote:
>> >
>> > Hi there,
>> >
>> > I think i have a very very rookie question.
>> >
>> > I wanna process my image data into a distance map, but I don't wan't
>> > to use the "itkImageFileReader.h" to readin image files, cause my work
>> > is only a small part of the project.
>> > So, Could anyone pls give me some clue how to compose my ITK distance
>> > map code with some data already read in,or if someone already have
>> > simliar situation , you can shall me part of your code.
>> >
>> >
>> > Thank you Very much
>> >
>> > Richard
>> > _______________________________________________
>> > 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