[Insight-users] how to choose different method in run-time?

Luis Ibanez luis.ibanez at kitware.com
Thu, 18 Mar 2004 07:31:47 -0500


Hi Wavelethe,

It is certainly possible to switch components of
the registration framework at run-time.

You are probably trying to do polymorphism with
SmartPointers while you should do it with raw
pointers.

Please post the compilation errors that you get....

Those little messages are usually useful  :-)


Thanks


   Luis


------------------------------------
wavelethe at pku.org.cn wrote:

> i want to use different method for registration, and maybe make the dicision in runtime.
> i had tried such as:
> 
>    typedef itk::Optimizer       OptimizerType;
>    typedef itk::RegularStepGradientDescentOptimizer       GradientOptimizerType;
>    OptimizerType::Pointer      optimizer     = GradientOptimizerType::New();
>    registration->SetOptimizer(     optimizer     );
>  
>  unluckily, these codes produce many errors.
>  what should i do? please help me!
>  
>  best regards!
> 
> ---------------------------------------------------------------
> 欢迎使用北京大学校友网(PKUAA)电子邮件系统 http://www.pku.org.cn
> "{"n标鞕ē妜%娝H炄爢郜z"禞+m鹈瓛娻?f?X)撸(!峨rs==