<span style="color: rgb(64, 64, 255); font-weight: bold;">Hi all</span><br style="color: rgb(64, 64, 255); font-weight: bold;"> <span style="color: rgb(64, 64, 255); font-weight: bold;">Hi Yan</span><br style="color: rgb(64, 64, 255); font-weight: bold;"> <span style="color: rgb(64, 64, 255); font-weight: bold;">thx for reply</span><br style="color: rgb(64, 64, 255); font-weight: bold;"> <span style="color: rgb(64, 64, 255); font-weight: bold;">but the problem is that i need to browse each pixel of the image extracted, so i have to use iterators, and i did, and there the same problem occur.</span><br style="color: rgb(64, 64, 255); font-weight: bold;"> <span style="color: rgb(64, 64, 255); font-weight: bold;">i make a test after reading the pixel if it's value is equal to 0, if not i process it and so on,</span><br style="color: rgb(64, 64, 255); font-weight: bold;"> <span style="color: rgb(64, 64, 255); font-weight: bold;">but all the test are false, mean he find that all pixel
 value are equal to 0( he didn't process any pixel) even many pixel are not equal to 0. if i use the classic method ( using GetPixel() method) , the program work well, but it is very slow!<br> this is the part of code where i use the iterators :</span><br> <span style="font-weight: bold;">......</span><br style="font-weight: bold;"> <span style="font-weight: bold;">ConstIteratorType2&nbsp;&nbsp;&nbsp; out2(&nbsp; m_DiasstoledImage, m_diasstoledimageregion );</span><br style="font-weight: bold;"> <span style="font-weight: bold;">for ( out2.GoToBegin(); !out2.IsAtEnd(); ++out2)</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; {</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(out2.Get()!=0)</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="font-weight: bold;"> <span style="font-weight:
 bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_diasstoledimageindex=out2.GetIndex();</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Coord du pixel consid&#130;r&#130; dans le plan image en millimetres.</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CoordInRecp[0]=m_diasstoledimageindex[0]*m_diasstoledimagespacing[0];</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CoordInRecp[1]=m_diasstoledimageindex[1]*m_diasstoledimagespacing[0];</span><br style="font-weight: bold;"><span style="font-weight: bold;">.......<br> <br> <br> <span style="color: rgb(64, 64, 255);">thx in advance</span><br style="color: rgb(64, 64, 255);"> <span
 style="color: rgb(64, 64, 255);">any comment is welcome</span><br style="color: rgb(64, 64, 255);"> <span style="color: rgb(64, 64, 255);">amir,</span><br> <br> <br> </span><b><i>Pingkun Yan &lt;pingkun.yan@gmail.com&gt;</i></b> a écrit&nbsp;:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi charfeddine,<br><br>I am not sure if the problem is caused by<br>m_thresholdregionsize[2]=0;<br>Maybe you should set it to 1.<br><br>In fact, you have a better choice. You can use the ITK extract slice<br>filter, which will extract one slice from a volume. You can find<br>examples in ITK. Then you just need to use a 2D image iterator to read<br>this 2D slice, which will be much easier.<br><br>HTH,<br>Pingkun<br><br>On 2/9/06, charfeddine amir <charfeddine_amir @yahoo.fr=""> wrote:<br>&gt; Hi all<br>&gt;  I'm reading Dicom file containing many slice, from which i extract one<br>&gt; slice.<br>&gt;  when i try to show the contenent
 of the image extracted (pixel value) using<br>&gt; iterators i get a black screen, and when i try GetPixel method( which is too<br>&gt; slow), i can show the value.<br>&gt;  did i make a mistake somewhere!<br>&gt;<br>&gt;  this is the code<br>&gt;<br>&gt; /************************************************************************************/<br>&gt;  typedef   itk::Image<float ,3="">    InputImageType;<br>&gt;  typedef itk::Image&lt; float, 2 &gt; DiasstolImageType;<br>&gt;<br>&gt;  typedef itk::ImageRegionConstIterator&lt; InputImageType &gt; ConstIteratorType;<br>&gt;  typedef itk::ImageRegionIterator&lt; DiasstolImageType&gt;       IteratorType;<br>&gt;<br>&gt;  .....<br>&gt; m_thresholdregion=m_OutputImage-&gt;GetLargestPossibleRegion();<br>&gt;  ThresholdedImageType::SizeType m_thresholdregionsize=<br>&gt; m_thresholdregion.GetSize();<br>&gt;  m_thresholdregionsize[2]=0;<br>&gt;<br>&gt;  ThresholdedImageType::IndexType m_thresholdregionstart =<br>&gt;
 m_thresholdregion.GetIndex();<br>&gt;  m_thresholdregionstart[2]=slicenumber;<br>&gt;<br>&gt;  m_thresholddesiredregion.SetSize( m_thresholdregionsize );<br>&gt;  m_thresholddesiredregion.SetIndex( m_thresholdregionstart<br>&gt; );<br>&gt;<br>&gt;<br>&gt; std::cout&lt;<std::endl ="">&lt;&lt;"----------------------------------&gt;incidence<br>&gt; N°"&lt;<card ="">&lt;<std::endl ;=""><br>&gt;<br>&gt;<br>&gt;  ConstIteratorType in(   m_OutputImage, m_thresholddesiredregion );<br>&gt;  IteratorType      out(  m_DiasstoledImage, m_diasstoledimageregion );<br>&gt;  for ( in.GoToBegin(), out.GoToBegin(); !in.IsAtEnd(); ++in, ++out)<br>&gt;    {<br>&gt;    out.Set( in.Get() );<br>&gt;    std::cout&lt;<in.Get (="">&lt;&lt;" - ";<br>&gt;    }<br>&gt;<br>&gt; /*******************************************************************************/<br>&gt;  i get this screen on execution:<br>&gt;<br>&gt;  La diasstole de l'incidence courante est l'image 0<br>&gt;<br>&gt; 
 ----------------------------------&gt;incidence N°0<br>&gt;<br>&gt;  **********************************Incidence<br>&gt; suivante****************************<br>&gt;<br>&gt;  La diasstole de l'incidence courante est l'image 0<br>&gt;<br>&gt;  ----------------------------------&gt;incidence N°1<br>&gt;<br>&gt;  **********************************Incidence<br>&gt; suivante****************************<br>&gt;<br>&gt; /*******************************************************************************************/<br>&gt;  But if remplace the use of iterators loop with this classic one :<br>&gt;<br>&gt;  pixelIndex[2]=slicenumber;<br>&gt;  for(j=0; j<m_inputimagesize [1="" j=""><br>&gt;       {<br>&gt;        pixelIndex[1]=j;<br>&gt;        m_diasstoledimageindex[1]=j;<br>&gt;        for(i=0; i<m_inputimagesize [0="" i=""><br>&gt;        {<br>&gt;         m_diasstoledimageindex[0]=i;<br>&gt;         pixelIndex[0]=i;<br>&gt;         pixelValue = m_OutputImage-&gt;GetPixel( pixelIndex
 );<br>&gt;<br>&gt; m_DiasstoledImage-&gt;SetPixel(m_diasstoledimageindex,pixelValue);<br>&gt;         std::cout&lt;<pixelValue ="">&lt;&lt;" - ";<br>&gt;        }<br>&gt;       }<br>&gt;<br>&gt;  I get the next screen:<br>&gt;<br>&gt;  La diasstole de l'incidence courante est l'image 0<br>&gt;  0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -<br>&gt; 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -<br>&gt; 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -<br>&gt; 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -<br>&gt; 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -<br>&gt; 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255<br>&gt; - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 -<br>&gt; 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255<br>&gt; - 255 - 255 - 255 - 255 - 255 -
 255 - 255 - 255 - 255 - 255 - 255 - 255 -<br>&gt; 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255<br>&gt; - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 -<br>&gt; 255 - 255 - 255 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0<br>&gt; - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0<br>&gt; - 0 -.........<br>&gt;<br>&gt;  any comment is welcome<br>&gt;  thx<br>&gt;  amir<br>&gt;<br>&gt;<br>&gt;  ________________________________<br>&gt;  Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs<br>&gt; exceptionnels pour appeler la France et l'international. Téléchargez la<br>&gt; version beta.<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Insight-users mailing list<br>&gt; Insight-users@itk.org<br>&gt;
 http://www.itk.org/mailman/listinfo/insight-users<br>&gt;<br>&gt;<br>&gt;<br></pixelValue></m_inputimagesize></m_inputimagesize></in.Get></std::endl></card></std::endl></float></charfeddine_amir></blockquote><br><p>
                <hr size=1> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com">Téléchargez</a> la version beta.