Hi Jordan,<br>
<br>
Thank's by you help, but I think that's not solve completely the
problem. For example: the black background will not every time 0 value,
but 0,1,2.. and another low scalar values. <br>
That's will complicate this aproach. I think in use some algorithms to make something like:<br>
1 - How much are the gradient scalar change in this image?<br>
2 - Where are the area with most relevant changes in gray scale values?
Of cource, this are will be the image area, not background.<br>
3 - Replace this area using the high value of this grayscale. ( 4096 or 255 ).<br>
<br>
I think this approach are better, but I don't know the correct filters and pipeline to make that.<br>
<br>
Regards,<br>
<br>
Wagner<br>
<br><br><div><span class="gmail_quote">2005/6/15, Jordan Soet <<a href="mailto:jds@interchange.ubc.ca">jds@interchange.ubc.ca</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm not sure about the correct way to do this, but I think that a pretty<br>simple way would just to be an image iterator and check each pixel to<br>see if it is a 0, and if not to set the value to 255 or 4096. You should
<br>look at section 11.3 for a good example that you could modify to make<br>your filter. I think you could just change this section of code:<br><br>for ( inputIt.GoToBegin(), outputIt.GoToBegin(); !inputIt.IsAtEnd();<br>
++inputIt, ++outputIt)<br>{<br>outputIt.Set( inputIt.Get() );<br>}<br><br>to something like this:<br><br>for ( inputIt.GoToBegin(), outputIt.GoToBegin(); !inputIt.IsAtEnd();<br>++inputIt, ++outputIt)<br>{<br> if( !( inputIt.Get
() == 0 ) )<br> {<br> outputIt.Set(255);<br> }<br> else<br> {<br> outputIt.set(0);<br> }<br>}<br><br>Hope that helps,<br>Jordan<br><br><br>Wagner Sales wrote:<br><br>> Hi all,<br>><br>> I need to replace every data in that's are NOT background ( black
<br>> background ) in a 8 bit or 12 bin grayscale image by the higher<br>> grayscale scalar value ( 255 or 4096). The purpose to do that are to<br>> create an iso-surface of the object.<br>> I was searched in ITK filters, but I'm little confused.
<br>> May be my explanation are confused ( :( ) and, because that, I was<br>> atached two images, before and after the desired operation. I was erased<br>> the data manually, by using Gimp, just to show a before/after example.
<br>> If someone have an example, tips or steps to do that, tks in a advance.<br>><br>> Regards<br>><br>> Wagner<br>><br>> ------------------------------------------------------------------------<br>>
<br>><br>> ------------------------------------------------------------------------<br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________
<br>>Insight-users mailing list<br>><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br>><br>><br><br></blockquote></div><br>