[Insight-developers] Misleading ImageRegionConstIterator example
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu May 31 14:17:59 EDT 2012
That sounds good to me!
Thanks for your efforts to improve the documentation of ITK!
Brad
On May 31, 2012, at 2:16 PM, David Doria wrote:
> On this page:
>
> http://www.itk.org/Doxygen/html/classitk_1_1ImageRegionConstIterator.html
>
> there is an example that shows the use of an iterator:
>
> it = it.Begin();
> for (; !it.IsAtEnd(); ++it)
> {
> *it += 100.0;
> }
>
> There are two problems with this. First, the iterators don't seem to
> provide this * operator for dereferencing. Second, it is the const
> iterator page, and the data is being modified.
>
> I propose changing this to:
>
> it = it.Begin();
> for (; !it.IsAtEnd(); ++it)
> {
> std::cout << it.Get();
> }
>
> or similar. Seem reasonable?
>
> David
> _______________________________________________
> 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://kitware.com/products/protraining.php
>
> 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-developers
========================================================
Bradley Lowekamp
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120531/9d64a7f2/attachment.htm>
More information about the Insight-developers
mailing list