<br>Hi Ra,<br><br>If you are going to do this systematically <br>in an image, (that is, if you plan to search<br>for the diagonal pixel of every pixel), then<br>you probably should be using the<br><br>          NeighborhoodIterator<br>
<br>Please look at the &quot;Image Iterators&quot; chapter<br><div class="gmail_quote">of the ITK Software Guide<br><br>    <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>
<br><br>Otherwise, if you are going to do this in only<br>one pixel, then the following code will suffice <br><br> ImageType::IndexType  index = iterator.GetIndex();<br><br> ImageType::OffsetType offset;<br><br> offset[0] = 1;<br>
 offset[1] = 1;<br> offset[2] = 0;<br><br> index += offset;<br><br> ImageType::PixelType  pixelvalue = image-&gt;GetPixel( index );<br><br><br>This second method for accessing pixel values<br>is a lot slower than using Image Iterators.<br>
<br><br>   Regards,<br><br><br>        Luis<br><br><br>-------------------------------------------------------------------<br>On Mon, May 25, 2009 at 3:56 PM, Raquel Itk <span dir="ltr">&lt;<a href="mailto:raquelitk@gmail.com">raquelitk@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>I have an iterator and I want to increment it by a specific value because I wan to know only the values of the pixel in the diagonal of an DICOM image. I want to use <b>operator</b>+=(<b>OffsetType</b>) but I don&#39;t know how I should do. My image is 512x512 so I would like an offset of 512.<br>

Than you in advance<br>Ra<br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>