[Insight-users] Registration iteration output is always null?

Lodron, Gerald Gerald.Lodron at joanneum.at
Mon Jan 4 08:06:16 EST 2010


Hi,

I observe my registration via an Iteration Event. I don't know why but the output in the command prompt is zero at each parameter but the registration works (results look fine).
I use two 64*64*64 float pixel images with itk::ImageRegistrationMethod (linear interpolation, Bspline transform, Least squares metric, LBFS Optimizer)

Does anybody has a clue:




        template<class OptimizerType>
        class CommandIterationUpdate : public itk::Command
        {
        public:
                typedef  CommandIterationUpdate                                         Self;
                typedef  itk::Command                                                           Superclass;
                typedef  itk::SmartPointer<CommandIterationUpdate>  Pointer;
                itkNewMacro( CommandIterationUpdate );
        protected:
                CommandIterationUpdate()
                {
                };

                typedef   const OptimizerType   *           OptimizerPointer;
        public:

                void Execute(itk::Object *caller, const itk::EventObject & event)
                {
                        Execute( (const itk::Object *)caller, event);
                }

                void Execute(const itk::Object * object, const itk::EventObject & event)
                {
                        OptimizerPointer optimizer =   dynamic_cast< OptimizerPointer >( object );

                        if( itk::IterationEvent().CheckEvent( &event ) )
                        {
                                std::cout << "Iteration " << optimizer->GetCurrentIteration() << " \t";
                                std::cout << "Value "<< optimizer->GetValue() << " \t";
                                std::cout << "Position " << optimizer->GetCurrentPosition();
                                std::cout << std::endl;
                        }
                }
        };
}




More information about the Insight-users mailing list