[Insight-users] more efficient way to set pixels than SetPixel() and GetPixel() from RGBImage

cagatay bilgin bilgincc at gmail.com
Thu Feb 9 21:52:26 EST 2012


Hi Daniel,

You would want to use iterators instead of SetPixel
and GetPixel. Chapter 11 of the itk manual explains
how to use them. Also, a simple example is given here

http://www.vtk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator

Regards,
Cagatay

On Thu, Feb 9, 2012 at 6:19 PM, <danieljohnsonusa at netscape.net> wrote:

> I'm developing an application using itk libraries where I need to set
> Pixels in regions of a 3D MRI image.  I started by building an application
> that based off of RGBImage where I use the SetPixel command from the itk
> libraries, but I noticed in the code that there is a comment stating that
> SetPixel()}and GetPixel() are inefficient and should only be used for
> debugging purposes.  However, I've looked at a few other examples and have
> had a hard time finding the portion of the code where pixels are set.  For
> example, I've been studying the DiscreteGaussianImageFilter in the itk
> libraries but I've had a hard time finding the part of the code where
> individual pixels are set.  I would greatly appreciate if someone could
> help explain to me where in the code for filters like the
> DiscreteGaussianImageFilter that individual pixels are set so I can find a
> more efficient way than the SetPixel and GetPixel functions from RGBImage.
>
>
> Thanks,
>
> Daniel
>
>
>
> ______________________________**_______
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/**opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/**products/protraining.html<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 <http://www.itk.org/Wiki/ITK_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/**listinfo/insight-users<http://www.itk.org/mailman/listinfo/insight-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120209/ffb1c218/attachment.htm>


More information about the Insight-users mailing list