[Insight-users] Programming own Floodfill Using Iterators

Luis Ibanez luis.ibanez at kitware.com
Thu Dec 18 08:49:25 EST 2008



Hi Oliver,


Thanks for your additional information.


A couple of questions:


1) By "fast" do you mean:


     a) that you have a short calendar time
        for completing your project ?

      or

     b) that you need this flood fill operation to
        run using a small amount of computation time ?


    If (b) then:
    Have you profiled the time that the flood fill iterator
    needs for running in your specific case ?

    If so:
    Did you profile that computation time using a Release build ?



2) It will require a minimum modification to obtain a list
    of the filled indices:

    Simply add, just after line 205 of the file:

    Insight/Code/Common/
      itkFloodFilledFunctionConditionalConstIterator.txx

    A line where you insert that index into a std::vector<>
    ( or any other container that you may prefer).

    And then add a "Get" method for getting access to this container.

    In less than an hour of coding (and testing) you should
    have functional version.



Please let us know if you find any problems during the modification
or the profiling of this iterator.


     Thanks



        Luis



------------------------
Oliver Trebbe wrote:
> Hi Luis,
> 
> first reason was, i needed floodfill fast :)
> and an other was: is it possbile to generate a list out of it with the 
> 'filled' indizes?
> or how can i just generate lists with my indizes which passt my 'test?
> 
> Regards
> 
> Oliver
> 
> 
> Luis Ibanez schrieb:
> 
>>
>> Hi Oliver,
>>
>> Is there a particular reason why you are not simply using
>> the existing ITK FloodFill Iterator ?
>>
>> http://www.itk.org/Insight/Doxygen/html/classitk_1_1FloodFilledImageFunctionConditionalIterator.html 
>>
>>
>>
>> This is the class used by the Region Growing filters.
>>
>>    itkConfidenceConnectedImageFilter.txx
>>    itkConnectedThresholdImageFilter.txx
>>    itkIsolatedConnectedImageFilter.txx
>>    itkNeighborhoodConnectedImageFilter.txx
>>    itkVectorConfidenceConnectedImageFilter.txx
>>
>>
>>
>>   Please let us know,
>>
>>
>>      Thanks
>>
>>
>>         Luis
>>
>>
>> --------------------
>> Oliver Trebbe wrote:
>>
>>> Hello Guys,
>>>
>>> I have a problem with my Iterators. :)
>>> I tried to programm a 3 Dimensional Floodfill, but now the problem 
>>> is, when i use
>>> NextLine() or NextSlice() the Iterator jumps automatically to the 
>>> start, is there a workaround to get the next Pixel in the next Line 
>>> or Slice or both instead of iterating just the whole steps to it? :(
>>> or do i need to see my 3D construct again as 1D array? without using 
>>> the Iterators?
>>>
>>> Would be nice for some Help
>>>
>>> Regards
>>>
>>> Oliver
>>>
>>
> 
> 


More information about the Insight-users mailing list