[Insight-users] Stopping registration

Monica Hernandez mhg at unizar.es
Sun Nov 11 06:43:54 EST 2007


Dear ITK users,

I am working with a child class of a PDEDeformableRegistrationFilter
that uses a sum of squared differences of the images for the energy
metric. I would like to stop registration when some condition on the
energy curve is hold. In order to do that, my idea was to create a
Command Observer in order to track the energy values and see if my
condition holds and stop registration by invoking stopping registration
methods. The code would look like something like this

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

         if( cond )
        {
          cout << "Stopping algorithm at iteration " <<
filter->GetElapsedIterations() - 1 << ". Condition holds." <<endl;
 
         // Here I would like to invoke to a method stopping registration
       }
     }

Can registration classes at ITK be "externally" stopped?
If so, what is the correct way of doing that?
If not, what could be an alternative way?

Thank you very much in advance.
Monica Hernandez.



More information about the Insight-users mailing list