[Insight-users] Demons observer

Josiane Yankam Njiwa--DEA Clarysse--Fin 11/04 njiwa at creatis.insa-lyon.fr
Tue Jun 8 04:02:01 EDT 2004



Hi,

I want to see how the demons registration compute the displacement at each
iteration and i like to add to the program an obsever, but i have this
message error during the compilation:error C2680: 'class
itk::DemonsRegistrationFilter<class itk::Image<float,2>,class
itk::Image<float,2>,class itk::Image<class itk::Vector<float,2>,2> >' :
invalid target type for dynamic_cast
Error executing cl.exe.

I don't how to overpass my problem. Thanks for your help.

Regards

Josiane


Here is my code:



#include "itkCommand.h"
class CommandIterationUpdate : public itk::Command
{
public:
  typedef  CommandIterationUpdate   Self;
  typedef  itk::Command             Superclass;
  typedef itk::SmartPointer<Self>  Pointer;
  itkNewMacro( Self );
protected:
  CommandIterationUpdate() {};
public:

  typedef float InternalPixelType;
  typedef itk::Image< InternalPixelType, 2 > InternalImageType;
  typedef itk::Vector< float, 2 >    VectorPixelType;
  typedef itk::Image<  VectorPixelType, 2 > DeformationFieldType;
  typedef itk::DemonsRegistrationFilter<
                                InternalImageType,
                                InternalImageType,
                                DeformationFieldType>
RegistrationFilterType;



  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)
    {

          RegistrationFilterType::Pointer filter=
                  dynamic_cast< RegistrationFilterType>( object );

      if( typeid( event ) != typeid( itk::IterationEvent ) )
        {
        return;
        }
      std::cout << filter->GetElapsedIterations()<< "   ";








More information about the Insight-users mailing list