Hi Alaa<div>It&#39;s your image viewer rescaling the intensity <div>values, making you think that it is brighter. <br><div>Set function does not accumulate, it Sets </div><div>(replaces) whatever it was there. </div><div><br>
</div><div>Cheers, </div><div>Cagatay</div><div><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 6:52 AM, alaamegawer <span dir="ltr">&lt;<a href="mailto:alaamegawer@yahoo.com" target="_blank">alaamegawer@yahoo.com</a>&gt;</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>
after set all value greater than 1100 to 1100 i had more Brighter image than<br>
original so i told that is<br>
Unexpected result  but i have another question Set function accumulate or<br>
replace new value with old one?<br>
<br>
thanks in advance<br>
Alaa<br>
<div><div class="h5"><br>
alaamegawer wrote:<br>
&gt;<br>
&gt; Hi All<br>
&gt;<br>
&gt; i wanna iterate over 3D image and during that check for some value i want<br>
&gt; to change. but unfortunately<br>
&gt; i had unexpected result my image property is<br>
&gt; size 512*512*148<br>
&gt; pixel size  2 byte<br>
&gt;<br>
&gt; my code is :<br>
&gt;<br>
&gt; const char * inputFilename  =<br>
&gt; &quot;C:/Users/Administrator/Desktop/Data/CT/ImageSet_4.mha&quot;;<br>
&gt;       ReaderType::Pointer reader= ReaderType::New();<br>
&gt;       reader-&gt;SetFileName( inputFilename);<br>
&gt;       reader-&gt;Update();<br>
&gt;<br>
&gt;       imageWriter::Pointer writer = imageWriter::New();<br>
&gt;<br>
&gt;       writer-&gt;SetFileName(&quot;C:/Users/Administrator/Desktop/Data/CT/55.mha&quot;);<br>
&gt;<br>
&gt;<br>
&gt;       InputImageType::Pointer image = reader-&gt;GetOutput();<br>
&gt;       ConstIteratorType in( image, image-&gt;GetRequestedRegion() );<br>
&gt;       IteratorType out( image, image-&gt;GetRequestedRegion() );<br>
&gt;<br>
&gt;       for ( in.GoToBegin(), out.GoToBegin(); !in.IsAtEnd(); ++in, ++out )<br>
&gt;       {<br>
&gt;               if (in.Get() &gt;1100)<br>
&gt;               {<br>
&gt;                       out.Set(100 );<br>
&gt;               }<br>
&gt;<br>
&gt;               else if (in.Get()&lt;50)<br>
&gt;               {<br>
&gt;                       out.Set(50);<br>
&gt;               }<br>
&gt;               else<br>
&gt;                               out.Set(in.Get());<br>
&gt;       }<br>
&gt;<br>
&gt;       writer-&gt;SetInput(image);<br>
&gt;       writer-&gt;Update();<br>
&gt;<br>
--<br>
</div></div>View this message in context: <a href="http://old.nabble.com/3D-image-iterator-problem-tp33963588p33964184.html" target="_blank">http://old.nabble.com/3D-image-iterator-problem-tp33963588p33964184.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></div></div>