[Insight-users] Stopping registration
Karthik Krishnan
karthik.krishnan at kitware.com
Sun Nov 11 10:25:48 EST 2007
Almost all registration methods check if they've been halted/aborted after
every iteration and then return with the last computed parameters.
The base class itk::FiniteDifferenceImageFilter 's GenerateData() method
looks like this :
while (!this->Halt())
{
// Do interation
}
You will just need to override this method in your registration method to
check for some flag, just like PDEDeformableRegistration::StopRegistration()
does .
--
Karthik Krishnan
R&D Engineer,
Kitware Inc.
On 11/11/07, Monica Hernandez <mhg at unizar.es> wrote:
>
> 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.
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071111/9daa8c94/attachment-0001.htm
More information about the Insight-users
mailing list