Hi, <br><br>my name's Javier González and I'm working with ITK, VTK y MFC on C++ for 7 months. I'm trying to make changes in a 2D image to make a graph. I only need put some point and maybe some lines. I'm using SetPixel(...,...) but when I show my image It has not changed. ¿May I use another method? My code is:<br>
<br>------------------------------------------------------------------------------------------------------------------------------------------<br>const char * inputFilename = "D:/fondografica.jpg";<br>reader = ReaderType::New();<br>
reader->SetFileName( inputFilename );<br>ImageType::Pointer newimage = reader->GetOutput();<br>ImageType::SizeType size;<br> size[0] = 255; // size along X<br> size[1] = 255; // size along Y<br>ImageType::IndexType start;<br>
start[0] = 0; // first index on X<br> start[1] = 0; // first index on Y<br>ImageType::RegionType region;<br> region.SetSize( size );<br> region.SetIndex( start );<br>newimage->SetRegions(size);<br>newimage->Allocate();<br>
<br> ImageType::Pointer image = this->pitkDICOM5->GetOutput();<br>ImageType::IndexType pixelValue1;<br> pixelValue1[0] = 80;<br> pixelValue1[1] = 80;<br>image = this->pitkDICOM4->GetOutput();<br>ImageType::IndexType pixelValue2;<br>
pixelValue2[0] = 125;<br> pixelValue2[1] = 125;<br>image = this->pitkDICOM3->GetOutput();<br>ImageType::IndexType pixelValue3;<br> pixelValue3[0] = 170;<br> pixelValue3[1] = 170;<br>image = this->pitkDICOM1->GetOutput();<br>
ImageType::IndexType pixelValue4;<br> pixelValue4[0] = 215;<br> pixelValue4[1] = 215;<br><br> newimage->SetPixel(pixelValue1, 0);<br> newimage->SetPixel(pixelValue2, 0);<br> newimage->SetPixel(pixelValue3, 0);<br>
newimage->SetPixel(pixelValue4, 0);<br><br> return newimage;<br>------------------------------------------------------------------------------------------------------------------------------------------<br><br>Thans for your help.<br>