Thanks for your response.<br>If I use int or unsigned char, then 113.581 would be 114 and 113.281 would be 113. Is this correct?<br><br><br><div class="gmail_quote">2011/6/12 David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Sun, Jun 12, 2011 at 12:32 PM, john smith <<a href="mailto:mkitkinsightuser@gmail.com">mkitkinsightuser@gmail.com</a>> wrote:<br>
> Hi to all,<br>
><br>
> I am using a reader to read an image and then pass the reader to a<br>
> RescaleIntensityImageFilter, with which I rescale the image from 0 to<br>
> 255.Then I am using an index type pointer tto get the pixel value, as it<br>
> seems bellow:<br>
><br>
> InputImageType::Pointer image = filter_rescale->GetOutput();<br>
> InputImageType::IndexType index =<br>
> filter_rescale->GetOutput()->GetLargestPossibleRegion().GetIndex();<br>
><br>
> InputImageType::IndexType currentIndex;<br>
> currentIndex[0] = k2;<br>
> currentIndex[1] = k1;<br>
> currentIndex[2] =<br>
> ui->verticalScrollBar_z->value();<br>
> InputImageType::PixelType currentValue =<br>
> image->GetPixel(currentIndex);<br>
><br>
> But when I get the values of currentIndex, I get for example a value<br>
> 113.581. I want to know in this case which rounding would be correct, the<br>
> 113 value or the 114 value.And how I could achieve this rounding?<br>
><br>
> Thanks in advance<br>
<br>
<br>
</div></div>You could set the OutputImageType of the RescaleImageFilter to<br>
unsigned char or int or something and it would cast it for you, so you<br>
wouldn't have to deal with rounding. And what do you mean the<br>
"correct" rounding? According to any rounding I know, 113.581 would be<br>
rounded to 114.<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>