OK<br> there was a problem specifing the iterator region<br> and program didn't enter the loop<br> <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/03.gif"><br> thx<br><br><b><i>charfeddine amir <charfeddine_amir@yahoo.fr></i></b> a écrit :<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi all,<br> i'm reading pixel value with an iterator, testing if it's equal to 0, if not i enter a loop to do some processing tasks.<br> but the program din't enter to the loop browsing all pixel image, mean he consider that all pixel value are equal to 0, which is not true!<br> could any one tell me where is the problem.<br> thx<br> <br> this the code :<br> <br> <span style="font-weight: bold;">typedef itk::Image<float,3> InputImageType;<br> typedef itk::ImageFileReader< InputImageType > ImageReaderType;<br> .....<br>
ConstIteratorType3 out( m_InputImage, m_inputimageregion );</span><br style="font-weight: bold;"> <span style="font-weight: bold;">for ( out.GoToBegin(); !out.IsAtEnd(); ++out)</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> {</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> if(out.Get()!=0)</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> {</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> </span><br style="font-weight: bold;"> <span style="font-weight: bold;"> pixelIndex=out.GetIndex();</span><br style="font-weight: bold;"> <span style="font-weight: bold;">
std::cout<<"pixel ("<<pixelIndex[0]<<","<<pixelIndex[1]<<") = <<out.Get()<<std::endl;</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> // Coord du pixel consid‚r‚ dans le plan image en millimetres.</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> CoordInRecp[0]=pixelIndex[0]*m_inputimagespacing[0];</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> CoordInRecp[1]=pixelIndex[1]*m_inputimagespacing[0];</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> .......</span><br style="font-weight: bold;"> <span style="font-weight:
bold;"> }</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> }</span><br> <div> </div><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._______________________________________________<br>Insight-users mailing list<br>Insight-users@itk.org<br>http://www.itk.org/mailman/listinfo/insight-users<br></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.