[Insight-developers] Non-global comparisons in FloodFill iterators
Jim Miller
millerjv at gmail.com
Tue Jun 7 22:01:19 EDT 2011
We have done essentially what you described in some our algorithms. Pass in two indices. One for the pixel you are evaluating and one for the pixel you are coming from. It was pretty simple to do but did require duplicating some code.
On Jun 6, 2011, at 5:24 PM, David Doria <daviddoria at gmail.com> wrote:
> Currently the FloodFill iterators call a IsPixelIncluded(index) which
> calls m_Function->EvaluateAtIndex(index) to determine if a pixel is
> suitable for inclusion. This only allows a "global" value test. There
> are cases when you might want to keep flooding if the pixel is similar
> to its neighbors, or keep going if the next pixels meets a criterion
> of a statistic on the current region. For this, it seems the call
> would need to be more like IsPixelIncluded(currentIndex,
> otherArguments) or at least IsPixelIncluded(currentIndex, testIndex).
>
> It would be easy to make a new class like
> itkFloodFilledImageFunctionConditionalConstIterator with the modified
> call to EvaluateAtIndex. However, the call to IsPixelIncluded is in
> the logic of itkFloodFilledFunctionConditionalConstIterator. Is the
> only way to do this to copy a big portion of the code from
> itkFloodFilledFunctionConditionalConstIterator into a new class called
> something like itkFloodFilledFunctionBoundaryConditionalConstIterator
> or similar?
>
> Any thoughts or suggestions?
>
> 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.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-developers
More information about the Insight-developers
mailing list