[Insight-users] Create an image

Sergio Vera sergio.vera at alma3d.com
Wed Mar 2 10:23:49 EST 2011


Jhon,

take a look at http://www.itk.org/Wiki/ITK/Examples for simple examples of
very useful ITK code snippets

regards

On Wed, Mar 2, 2011 at 4:14 PM, David Doria <daviddoria at gmail.com> wrote:

> On Wed, Mar 2, 2011 at 10:06 AM, john smith <mkitkinsightuser at gmail.com>wrote:
>
>> Hello,
>>
>> I am trying to create an image 20x20. Every pixel will have the value 0.
>> Then, I have created an other function called OutputImage, with which I
>> trying to see all the pixel's value on my window command prompt. The project
>> is built correctly, but when I run it from the command window prompt I do
>> not take any value. Could anybody find the problem?
>>
>> Thanks in advance
>>
>>
> You should probably use a region iterator for your output function:
> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator
>
> Also, you'll need to cast the unsigned char to an int to view the value
> "0":
>
> std::cout << static_cast<int>(image->GetPixel(pixelIndex));
>
> David
>
> _____________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110302/6f21fb07/attachment.htm>


More information about the Insight-users mailing list