<span style="font-weight: bold; color: rgb(64, 64, 255);">Hi all</span><br style="font-weight: bold; color: rgb(64, 64, 255);"> <span style="font-weight: bold; color: rgb(64, 64, 255);">I'm reading Dicom file containing many slice, from which i extract one slice.</span><br style="font-weight: bold; color: rgb(64, 64, 255);"> <span style="font-weight: bold; color: rgb(64, 64, 255);">when i try to show the contenent of the image extracted (pixel value) using iterators i get a black screen, and when i try GetPixel method( which is too slow), i can show the value.</span><br style="font-weight: bold; color: rgb(64, 64, 255);"> <span style="font-weight: bold; color: rgb(64, 64, 255);">did i make a mistake somewhere!</span><br style="font-weight: bold; color: rgb(64, 64, 255);"> <br style="font-weight: bold; color: rgb(64, 64, 255);"> <span style="font-weight: bold; color: rgb(64, 64, 255);">this is the code <br> <br> </span><span style="font-weight:
bold;">/************************************************************************************/</span><br style="font-weight: bold;"> <span style="font-weight: bold;">typedef itk::Image<float,3> InputImageType;</span><br style="font-weight: bold;"> <span style="font-weight: bold;">typedef itk::Image< float, 2 > DiasstolImageType;</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">typedef itk::ImageRegionConstIterator< InputImageType > ConstIteratorType;</span><br style="font-weight: bold;"> <span style="font-weight: bold;">typedef itk::ImageRegionIterator< DiasstolImageType> IteratorType;</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">.....</span><br style="font-weight: bold;"> <span style="font-weight: bold;">m_thresholdregion=m_OutputImage->GetLargestPossibleRegion();</span><br
style="font-weight: bold;"> <span style="font-weight: bold;">ThresholdedImageType::SizeType m_thresholdregionsize= m_thresholdregion.GetSize();</span><br style="font-weight: bold;"> <span style="font-weight: bold;">m_thresholdregionsize[2]=0;</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">ThresholdedImageType::IndexType m_thresholdregionstart = m_thresholdregion.GetIndex();</span><br style="font-weight: bold;"> <span style="font-weight: bold;">m_thresholdregionstart[2]=slicenumber;</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">m_thresholddesiredregion.SetSize( m_thresholdregionsize );</span><br style="font-weight: bold;"> <span style="font-weight: bold;">m_thresholddesiredregion.SetIndex( m_thresholdregionstart );</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight:
bold;">std::cout<<std::endl<<"---------------------------------->incidence N°"<<card<<std::endl;</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">ConstIteratorType in( m_OutputImage, m_thresholddesiredregion );</span><br style="font-weight: bold;"> <span style="font-weight: bold;">IteratorType out( m_DiasstoledImage, m_diasstoledimageregion );</span><br style="font-weight: bold;"> <span style="font-weight: bold;">for ( in.GoToBegin(), out.GoToBegin(); !in.IsAtEnd(); ++in, ++out)</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> {</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> out.Set( in.Get() );</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> std::cout<<in.Get()<<" - ";</span><br style="font-weight: bold;"> <span
style="font-weight: bold;"> }</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">/*******************************************************************************/</span><br> <span style="color: rgb(64, 64, 255); font-weight: bold;">i get this screen on execution:</span><br> <br> <span style="font-weight: bold;">La diasstole de l'incidence courante est l'image 0</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">---------------------------------->incidence N°0</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">**********************************Incidence suivante****************************</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">La diasstole de l'incidence courante est l'image 0</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span
style="font-weight: bold;">---------------------------------->incidence N°1</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">**********************************Incidence suivante****************************</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">/*******************************************************************************************/</span><br> <span style="color: rgb(64, 64, 255); font-weight: bold;">But if remplace the use of iterators loop with this classic one :</span><br> <br> <span style="font-weight: bold;"> pixelIndex[2]=slicenumber;</span><br style="font-weight: bold;"> <span style="font-weight: bold;">for(j=0; j<m_inputimagesize[1]; j++)</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> {</span><br style="font-weight: bold;"> <span style="font-weight: bold;">
pixelIndex[1]=j;</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> m_diasstoledimageindex[1]=j;</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> for(i=0; i<m_inputimagesize[0]; i++)</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> {</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> m_diasstoledimageindex[0]=i;</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> pixelIndex[0]=i;</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> pixelValue = m_OutputImage->GetPixel( pixelIndex );</span><br style="font-weight: bold;"> <span style="font-weight: bold;">
m_DiasstoledImage->SetPixel(m_diasstoledimageindex,pixelValue);</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> std::cout<<pixelValue<<" - ";</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> }</span><br style="font-weight: bold;"> <span style="font-weight: bold;"> }</span><br> <br> <span style="color: rgb(64, 64, 255); font-weight: bold;">I get the next screen:</span><br> <br> <span style="font-weight: bold;">La diasstole de l'incidence courante est l'image 0</span><br style="font-weight: bold;"> <span style="font-weight: bold;">0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -
0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 255 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -.........<br> <br> <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);">thx</span><br style="color: rgb(64, 64, 255);"> <span style="color: rgb(64, 64, 255);">amir</span><br> </span><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.