<div>itkInvertIntensityImageFilter subtracts pixel intensities from a &#39;maximum value&#39;, which you can manually set.</div><div><br><div class="gmail_quote">On Fri, Aug 6, 2010 at 10:23 AM, Sergiy Volkovych <span dir="ltr">&lt;<a href="mailto:volkovych@gmail.com">volkovych@gmail.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>
Suppose your current image pointer is CurrentImage. Then to obtain it&#39;s<br>
complementary image you may use code like this:<br>
<br>
ImageType::Pointer ComplementaryImage = ImageType::New();<br>
ComplementaryImage-&gt;SetBufferedRegion(ComplementaryImage<br>
-&gt;GetRequestedRegion());<br>
ComplementaryImage-&gt;Allocate();<br>
<br>
typedef itk::ImageRegionIterator&lt;ImageType&gt; IteratorType;<br>
typedef itk::ImageRegionConstIterator&lt;ImageType&gt; ConstIteratorType;<br>
<br>
IteratorType ComplementaryImageIt (ComplementaryImage,<br>
ComplementaryImage-&gt;GetRequestedRegion());<br>
ConstIteratorType CurrentImageIt (CurrentImage,<br>
CurrentImage-&gt;GetRequestedRegion());<br>
<br>
for (ComplementaryImageIt.GoToBegin(), CurrentImageIt.GoToBegin();<br>
!CurrentImageIt.IsAtEnd(); ++ComplementaryImageIt, ++CurrentImageIt)<br>
  ComplementaryImageIt.Set(1 - CurrentImageIt.Get());<br>
<br>
Feel yourself free to use iterators - it gives you possibility to do<br>
anything you want :)<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Complementary-Image-is-there-something-in-itk-tp5380665p5380739.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Complementary-Image-is-there-something-in-itk-tp5380665p5380739.html</a><br>

Sent from the ITK Insight Users mailing list archive at Nabble.com.<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</blockquote></div><br></div>