[Insight-users] How to transfer ITK image to matrix or vector ?

Sergio Vera sergio.vera at alma3d.com
Fri Aug 6 06:13:17 EDT 2010


Hello Yang,

Reply to both, or at least to the mailing list address so all the users can
participate in the thread.

Best, safest and fastest way to access pixels in ITK are Image iterators:
have a look at the chapter 11 from the ITK software guide for more info and
examples:
http://www.itk.org/ItkSoftwareGuide.pdf

with the iterator you can traverse the image reading a voxel each time, that
you can copy to your matrix

Also, what do you mean when you ask for "testing codes in ITK"?
<http://www.itk.org/ItkSoftwareGuide.pdf>

On Fri, Aug 6, 2010 at 12:03 PM, Guang Yang <samggyy at gmail.com> wrote:

> Hi Sergio,
>
> Thanks for your reply. I am not sure if I can send you the email directly
> or I need to send it to insight-users at itk.org. I am a starter :-)
>
> Do you know if there is an example or testing codes in ITK? Or somewhere on
> the interenet. Do we need something like a image->GetBufferePointer() to get
> the pixel or voxel?
>
> Thanks a lot.
>
>
> Best regards,
> Yang
>
>
>
> On 8/6/10, Sergio Vera <sergio.vera at alma3d.com> wrote:
>>
>> Hi  Guan Yang
>>
>>
>> Use a Iterator to read the voxels from your image and then,copy them into
>> a standard matrix
>>
>>
>> you can find the specific details in the chapter of the insight guide
>> devoted to iterators.
>>
>>
>> Sergio
>>
>>  On Fri, Aug 6, 2010 at 2:13 AM, Guang Yang <samggyy at gmail.com> wrote:
>>
>>>  Hi there,
>>>
>>> May I ask how to transfer ITK image to matrix or vector?
>>>
>>> I need to put ITK image pixels into a matrix form or put them in a
>>> vector. The image might be 3D images, then how to put all the voxels in a
>>> vector?
>>>
>>> Thanks.
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
>>
>> --
>> Sergio Vera
>>
>>  Alma IT Systems
>>  C/ Vilana, 4B, 4º 1ª
>>  08022 Barcelona
>>  T. (+34) 932 380 592
>>  www.alma3d.com
>>
>>
>
>


-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100806/75be7be1/attachment.htm>


More information about the Insight-users mailing list