<div><span class="Apple-style-span" style>This is the only part of your code </span></div><div><span class="Apple-style-span" style>that will make the image brighter </span></div><div><span class="Apple-style-span" style>than it is. </span></div>
<div><span class="Apple-style-span" style><br></span></div><div><span class="Apple-style-span" style> else if (in.Get()<50)<br> {<br> out.Set(50);<br> }</span><br><br><div>
<span class="Apple-style-span" style>I am </span><span class="Apple-style-span" style>assuming that you are expecting </span></div><div><span class="Apple-style-span" style>to see an </span><span class="Apple-style-span" style>increase here. This is not </span></div>
<div><span class="Apple-style-span" style>unexpected increase in brightness :) </span></div><div><br></div><div>Let us know, </div>Cagatay</div><div><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 10:28 AM, alaamegawer <span dir="ltr"><<a href="mailto:alaamegawer@yahoo.com" target="_blank">alaamegawer@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi All<br>
<br>
No my viewer doesn't rescale it .<br>
<div><div class="h5"><br>
<br>
<br>
alaamegawer wrote:<br>
><br>
> Hi All<br>
><br>
> i wanna iterate over 3D image and during that check for some value i want<br>
> to change. but unfortunately<br>
> i had unexpected result my image property is<br>
> size 512*512*148<br>
> pixel size 2 byte<br>
><br>
> my code is :<br>
><br>
> const char * inputFilename =<br>
> "C:/Users/Administrator/Desktop/Data/CT/ImageSet_4.mha";<br>
> ReaderType::Pointer reader= ReaderType::New();<br>
> reader->SetFileName( inputFilename);<br>
> reader->Update();<br>
><br>
> imageWriter::Pointer writer = imageWriter::New();<br>
><br>
> writer->SetFileName("C:/Users/Administrator/Desktop/Data/CT/55.mha");<br>
><br>
><br>
> InputImageType::Pointer image = reader->GetOutput();<br>
> ConstIteratorType in( image, image->GetRequestedRegion() );<br>
> IteratorType out( image, image->GetRequestedRegion() );<br>
><br>
> for ( in.GoToBegin(), out.GoToBegin(); !in.IsAtEnd(); ++in, ++out )<br>
> {<br>
> if (in.Get() >1100)<br>
> {<br>
> out.Set(100 );<br>
> }<br>
><br>
> else if (in.Get()<50)<br>
> {<br>
> out.Set(50);<br>
> }<br>
> else<br>
> out.Set(in.Get());<br>
> }<br>
><br>
> writer->SetInput(image);<br>
> writer->Update();<br>
><br>
<br>
--<br>
</div></div>View this message in context: <a href="http://old.nabble.com/3D-image-iterator-problem-tp33963588p33965447.html" target="_blank">http://old.nabble.com/3D-image-iterator-problem-tp33963588p33965447.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the ITK - Users mailing list archive at Nabble.com.<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>