[Insight-users] Bug in itkFloodFilledFunctionConditionalIterator

Damion Shelton dmshelto@andrew.cmu.edu
Fri, 06 Sep 2002 15:15:46 -0400


Hi,

Thanks for the fix. It turns out this fix was applied to 
itkFloodFilledFunctionConditionalConstIterator but not the non-const 
version. Both base classes are functionally identical except for the 
const enforcement, so it can be a bit of challenge keeping both in sync. 
I've committed the changes you requested to CVS.

Let me know if you have any more problems with flood fill code.

Cheers,
-Damion-

Alberto Bert wrote:

>On Sep 06 at 03:42PM+0200, Alberto Bert wrote:
>  
>
>>>I think I found a little bug in the
>>>itkFloodFilledFunctionConditionalIterator.txx file.
>>>
>>>This bug prevent the floodfill iterator to work correctly when used on
>>>boundaries,
>>>if you use the iterator on the first slice it will only stay on this slice
>>>because as soon as an index in one dimension is considered invalid the other
>>>is also considered invalid.
>>>      
>>>
>>I've found the same problem. I'm using that class, so please warn me when it
>>will be fixed.
>>    
>>
>
>I've watched to the code, and I've seen the bug (thanks Yann.)
>The problem was the initialization of the m_IsValidIndex variable, isn't it?
>For other users, the following code seems to work:
>
>...
>for(int i=0; i<NDimensions; i++)
>	  {
>	    // IndexType tempIndex;
>	    // m_IsValidIndex = true;
>	  
>	    // The j loop establishes either left or right neighbor (+-1)
>	    for(int j=-1; j<=1; j+=2)
>	      {
>	        IndexType tempIndex;
>		m_IsValidIndex = true;
>		// build the index of a neighbor
>		for(int k=0; k<NDimensions; k++)
>                        ... 
>
>Bye,
>Alberto
>_______________________________________________
>Insight-users mailing list
>Insight-users@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-users
>
>  
>