[Insight-developers] Re: FloodFilledFunctionConditionalConstIterator

Luis Ibanez luis.ibanez@kitware.com
Mon, 25 Mar 2002 17:37:29 -0500


Yeap,
the class was copied from the non-cost version,
and the following changes were made :

1) the pointer to image was made const

2) the Set() method was removed

3) the Get() method was changed to return a const &.
    (in fact this last one should be const & also in the
     non-const version of the iterator !)

I agree with you in that the duplication of code is not a
good thing.

The algorithmic part ot the FloodFill is independent
of what we do with the indices, so that can easily be
factorized in a base class.  

The same comment is valid for *all* the iterators.
We should probaly made base classes for the part that
encodes the walking algorithm and leave two front
end classes one for const and the other for non-const
images.  This can be done by using derivation or
also by using a Functor mechanism.


     Luis

=================================

Miller, James V (CRD) wrote:

> Luis,
>
>  
>
> When you put in the FloodFilledFunctionConditionalConstIterator, you 
> basically copied the original class.
>
>  
>
> This results not only in code duplication but also now means that if 
> we want to modify the flood fill algorithm, we need to change it 
> multiple places.  This is a bad design.
>
>  
>
> We need to consolidate the implementations: either through 
> inheritance, delegation, or by removing the ConstIterator.
>
>
> *Jim Miller*
> */_____________________________________/*
> /Visualization & Computer Vision
> GE Corporate Research & Development
> Bldg. KW, Room C218B
> P.O. Box 8, Schenectady NY 12301
>
> _millerjv@crd.ge.com <mailto:millerjv@crd.ge.com >_/
> /(518) 387-4005, Dial Comm: 8*833-4005, /
> /Cell: (518) 505-7065, Fax: (518) 387-6981/
>
>
>  
>
> Miller, James V (CRD).vcf
>
> Content-Type:
>
> application/octet-stream
>
>