Dear all,<br><br>I&#39;m starting in ITK and I&#39;ve the following problem:<br>I don&#39;t know how can I access to the pixels of an image. The example:&quot;Examples/DataRepresentation/Image/Image3.cxx&quot; implements how to create a new image and how to change values&nbsp; of the image but I want to change values of a read image. Do I have to create a region and then allocated the data as I do in the following code? If this is the way, how can I assingn the read data to the region?<br>
<br>&nbsp;&nbsp;<i> // Inizialize<br>&nbsp;&nbsp; const unsigned int Dimension = 2;<br>&nbsp;&nbsp; typedef itk::Image&lt; unsigned char, Dimension &gt; ImageType;<br><br>&nbsp;&nbsp; // Create image object<br>&nbsp; ImageType::Pointer image = ImageType::New();<br><br>
&nbsp; // Create image region<br>&nbsp; ImageType::IndexType start;<br>&nbsp; ImageType::SizeType&nbsp; size;<br><br>&nbsp; size[0]&nbsp; = 200;&nbsp; // size of the read image along X<br>&nbsp; size[1]&nbsp; = 200;&nbsp; // size of the read image along Y<br><br>&nbsp; start[0] =&nbsp;&nbsp; 0;&nbsp; // first index on X<br>
&nbsp; start[1] =&nbsp;&nbsp; 0;&nbsp; // first index on Y<br><br>&nbsp; ImageType::RegionType region;<br>&nbsp; region.SetSize( size );<br>&nbsp; region.SetIndex( start );<br>&nbsp; <br>&nbsp; // Pixel data is allocated<br>&nbsp; image-&gt;SetRegions( region );<br>&nbsp; image-&gt;Allocate();<br>
<br>&nbsp;<b> // Now, I want to assign the data from &quot;reader-&gt;GetOutput()&quot; to the image</b><br>&nbsp; image-&gt;??????????</i><br><br><br><br>Thanks for any suggestion,<br><br clear="all"><br>-- <br>~~~~~~~~~~~~~~~~Fran~~~~~~~~~~~~~~~~<br>