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