[Insight-developers] TernaryFunctorImageFilter::SetFunctor() broken(at least with gcc)

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Aug 9 12:04:03 EDT 2005


On Tuesday 09 August 2005 14:48, you wrote:
> Gaetan,
> What filter is not compiling? 

TernaryAddImageFilter, TernaryMagnitudeImageFilter and 
TernaryMagnitudeSquaredImageFilter

> The functors should provide a != operator. 
> Actually, the Unary and Binary versions should be doing the same thing that
> the ternary is doing.

but in Ternary version, SetFunctor() is defined as follow :

  void SetFunctor(const FunctorType& functor)
  {
    if ( m_Functor != functor )
      {
      m_Functor = functor;
      this->Modified();
      }
  }

and in Unary and Binary version, SetFunctor() is :

  void SetFunctor(const FunctorType& functor)
  {
    m_Functor = functor;
    this->Modified();
  }

So perhap's the test should not be removed in Ternary version, but in that 
case, it should be added in Unary and Binary versions to be consistent with 
Ternary version.
It seems a good idea to add a test : no need to call Modified() if the functor 
is the same, but adding a test would force to define operator!= for all 
functors...

Gaetan

>
> We'll look into this.
>
> Bill
>
> -----Original Message-----
> From: insight-developers-bounces+lorensen=crd.ge.com at itk.org
> [mailto:insight-developers-bounces+lorensen=crd.ge.com at itk.org]On Behalf
> Of Gaetan Lehmann
> Sent: Tuesday, August 09, 2005 7:31 AM
> To: insight-developers at itk.org
> Subject: [Insight-developers] TernaryFunctorImageFilter::SetFunctor()
> broken(at least with gcc)
>
>
>
> Hi,
>
> TernaryFunctorImageFilter::SetFunctor() can't be build with gcc because of
> lack of operator!= for functor.
>    void SetFunctor(const FunctorType& functor)
>    {
>      if ( m_Functor != functor )
>        {
>        m_Functor = functor;
>        this->Modified();
>        }
>    }
>
> In UnaryFunctorImageFilter and BinaryFunctorImageFilter, SetFunctor()
> method don't make the test m_Functor != functor, so everything works fine.
> Can someone remove the test in TernaryFunctorImageFilter ?
>
> Thanks,
>
> Gaetan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20050809/26409d01/attachment.pgp


More information about the Insight-developers mailing list