[Insight-users] problem reading pixel value with Iterators Get()
method, plz help!
charfeddine amir
charfeddine_amir at yahoo.fr
Sun Feb 12 05:49:33 EST 2006
Hi all,
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.
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!
could any one tell me where is the problem.
thx
this the code :
typedef itk::Image<float,3> InputImageType;
typedef itk::ImageFileReader< InputImageType > ImageReaderType;
.....
ConstIteratorType3 out( m_InputImage, m_inputimageregion );
for ( out.GoToBegin(); !out.IsAtEnd(); ++out)
{
if(out.Get()!=0)
{
pixelIndex=out.GetIndex();
std::cout<<"pixel ("<<pixelIndex[0]<<","<<pixelIndex[1]<<") = <<out.Get()<<std::endl;
// Coord du pixel consid‚r‚ dans le plan image en millimetres.
CoordInRecp[0]=pixelIndex[0]*m_inputimagespacing[0];
CoordInRecp[1]=pixelIndex[1]*m_inputimagespacing[0];
.......
}
}
---------------------------------
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.Téléchargez la version beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060212/edc97eb1/attachment.html
More information about the Insight-users
mailing list