[Insight-users] Complementary Image: is there something in itk

robert tamburo robert.tamburo at gmail.com
Fri Aug 6 10:32:47 EDT 2010


itkInvertIntensityImageFilter subtracts pixel intensities from a 'maximum
value', which you can manually set.

On Fri, Aug 6, 2010 at 10:23 AM, Sergiy Volkovych <volkovych at gmail.com>wrote:

>
> Suppose your current image pointer is CurrentImage. Then to obtain it's
> complementary image you may use code like this:
>
> ImageType::Pointer ComplementaryImage = ImageType::New();
> ComplementaryImage->SetBufferedRegion(ComplementaryImage
> ->GetRequestedRegion());
> ComplementaryImage->Allocate();
>
> typedef itk::ImageRegionIterator<ImageType> IteratorType;
> typedef itk::ImageRegionConstIterator<ImageType> ConstIteratorType;
>
> IteratorType ComplementaryImageIt (ComplementaryImage,
> ComplementaryImage->GetRequestedRegion());
> ConstIteratorType CurrentImageIt (CurrentImage,
> CurrentImage->GetRequestedRegion());
>
> for (ComplementaryImageIt.GoToBegin(), CurrentImageIt.GoToBegin();
> !CurrentImageIt.IsAtEnd(); ++ComplementaryImageIt, ++CurrentImageIt)
>  ComplementaryImageIt.Set(1 - CurrentImageIt.Get());
>
> Feel yourself free to use iterators - it gives you possibility to do
> anything you want :)
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/Complementary-Image-is-there-something-in-itk-tp5380665p5380739.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100806/6a03e9d0/attachment.htm>


More information about the Insight-users mailing list