[Insight-developers] ConditionalConstIterator Error?
Luis Ibanez
luis.ibanez@kitware.com
Tue, 15 Apr 2003 22:08:16 -0400
Hi John,
It is not a problem that the path does not cover all
the image. In fact, most iterator don't cove the full
image since they are conditioned to walk over a region.
You can safely derive your new iterator from the
ImageConstIterator (or the ImageConstIteratorWithIndex).
There is no advantage in deriving from the
ConditionalConstIterator. As a matter of fact you just
encountered that the conditional iterator has additional
functionality that is not needed in your path iterator.
Please note also that Josh recently added a chapter on
iterators to the SoftwareGuide.pdf.
Hope that helps
Luis
--------------------------------------
John M. Galeotti wrote:
> Hello, I am working on an iterator to walk through an image following
> any type of path. Since most paths will not cover all image indices, it
> would be logical for this iterator to descend from
> ConditionalConstIterator, but there is one small problem.
> ConditionalConstIterator includes the pure virtual function
> IsPixelIncluded(), which would be almost useless and prohibitively
> expensive to calculate for some types of paths (paths are almost always
> traveled linearly), and so I really do not want to implement the
> exhaustive search required for it. The documentation in
> ConditionalConstIterator states that this function is used to "Compute
> whether the index of interest should be included in the flood."
> Therefore, it seems that this pure virtual function should be introduced
> into the ITK class hierarchy in its child
> FloodFilledFunctionConditionalConstIterator, not in
> ConditionalConstIterator. A quick look at the ConditionalConstIterator
> inheritance diagram seems to indicate that this would not be a problem,
> and FloodFilledFunctionConditionalConstIterator.h would not even have to
> be modified.
>
> Could someone please remove the IsPixelIncluded() function from
> ConditionalConstIterator.h?
>
> Thank you,
> John Galeotti
> jgaleotti@cmu.edu
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>