Hi Alaa<div>It'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"><<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>
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>
><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>
</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>