[Insight-users] ICP progress monitoring still not working(?)
Benedikt Birkenbach
birkenbach at rrz.uni-koeln.de
Mon May 29 10:01:19 EDT 2006
Hi Luis,
I am sorry, but I can't get this running. I've updated the latest CVS and installed it, but still there is no
iterationEvent in relation with the LevenbergMarquardtOptimizer.
Maybe something is wrong, but I did as said in the Textbook. Here is the source, maybe somthing wents wrong.
--------------------------------------------------------------------------------------------------------
// THE OBSERVER CLASS FOR ITK
class CommandIterationUpdate : public itk::Command
{
public:
typedef CommandIterationUpdate Self;
typedef itk::Command Superclass;
typedef itk::SmartPointer<Self> Pointer;
itkNewMacro( Self );
protected:
CommandIterationUpdate() {};
public:
typedef itk::LevenbergMarquardtOptimizer OptimizerType;
typedef const OptimizerType *OptimizerPointer;
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 ))
{
cout << "wrong" << endl;
return;
}
cout << "Position : " << optimizer->GetCurrentPosition() << endl;
}
};
--------------------------------------------------------------------------------------------------------
And -->
--------------------------------------------------------------------------------------------------------
CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();
optimizer->AddObserver( itk::EndEvent(), observer );
try
{
registration->StartRegistration();
}
catch( itk::ExceptionObject & e )
{
cout << e << endl;
}
--------------------------------------------------------------------------------------------------------
Any hints, regards
Benedikt
Luis Ibanez wrote:
>
> Hi Patrick,
>
> You are right, the ITK adapters to MutlipleValued VNL optimizers
> were not yet reporting iteration events during the optimization.
>
> We just committed a fix for this lack of support. Mainly copying it
> from the Single Valued optimizers, that already have it implemented.
>
> You may have to update you CVS checkout of ITK in order to get access
> to this functionality.
>
--
____ ____ ____ _ ________________________________________
/ __ \/ __ \|__ || |/ / Benedikt Birkenbach |
| __/| __/ / / | / RRZK/ZAIK der Universitaet zu Koeln |
| | \ | | \ / /_ | \ |
|_|\_\|_|\_\|____||_|\_\ http://www.uni-koeln.de/RRZK/ |
______________________________________________________________/
More information about the Insight-users
mailing list