[Insight-users] Re: 1+1ES optimizer Maximize (compilation fault)

Luis Ibanez luis.ibanez@kitware.com
Tue May 4 15:00:49 EDT 2004


Hi Christos,

It doesn't look like you got the right version
of the OnePlusOne optimizer.

Please check in lines 92 and 93 of its header
file. It should have the following code:


   /** Set if the Optimizer should Maximize the metric */
   itkSetMacro( Maximize, bool );
   itkBooleanMacro( Maximize );



Also,...


What version of ITK are you using ?

Please go to the file:

   Insight/Code/Common/itkMacro.h

and look for

       itkBooleanMacro


It should have code like:

#define itkBooleanMacro(name) \
   virtual void name##On () { this->Set##name(true);} \
   virtual void name##Off () { this->Set##name(false);}



It it doesn't, you then have two options:


A)  In the Example, replace:

     MaximizeOff()  with  SetMaximize( false )


OR

B)  Upgrade your ITK to the CVS version.



I would *strongly* suggest you to opt for (B).



   Regards



      Luis



--------------------------
Christos Panagiotou wrote:
> Dear luis
> 
> i ve upgraded my one plus one evolutionary optimizer to your new cvs 
> entry 1.28
> 
> as i am using the Mattes MI metric i need to minimize the 1+1.
> so i  set
> m_Optimizer->MaximizeOff();
> as shown in the newly entered Examples/ImageRegistration11.cxx
> 
> however i get:
> 
> MIMRegistrator.txx:132: error: 'MaximizeOff' undeclared (first use this 
> function)
> 
> *MaximizeOn() compiles :) *
> i wonder if this is a configuration (?) error from my part...
> well SetMaximize(bool) is undeclared too!...
> 
> i dont understand how this is possible as the macros are defined 
> elsewhere and work for other classes...
> 
> 
> 
> thanks
> christos
> 
> 






More information about the Insight-users mailing list