[Insight-users] How to access a value from the index array?
D, Yamini
Yamini.D at philips.com
Mon Oct 22 00:26:57 EDT 2012
Hi,
I am working on a problem which requires the access of certain values(every 5th value) from an "index" array.
This is the part of the code which fetch the pointset of the pixels which are white in the image. The pointset are stored in "index".
Outside the for loop, I want to access every 5th value from the array index[0] (x-values) and from array[1] (y-values).
//code
InputImageType::IndexType index;
int i,j;
for (i=0;i<size_x;i++){
for (j=0;j<size_y; j++){
index[0]=i; // x-values
index[1]=j; // y-values
InputImageType::PixelType pixelValue = image->GetPixel(index);
if(pixelValue==255)
cout<<index[0]<<" " << index[1]<<endl;
}
}
Can anyone guide me to solve this.
Thank you,
Yamini.D
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121022/b7fe9b1d/attachment.htm>
More information about the Insight-users
mailing list