[ITK-users] How to abort execution of ImageRegistrationMethodv4 / Optimizer

Bryn Lloyd lloyd at itis.ethz.ch
Thu Dec 4 17:48:09 EST 2014


At a first glance it seems that ImageRegistrationMethodv4 does not check 
for the abort flag:

ImageRegistrationMethodv4<TFixedImage, TMovingImage, TTransform, 
TVirtualImage>
::GenerateData()
{
   this->AllocateOutputs();
   for( this->m_CurrentLevel = 0; this->m_CurrentLevel < 
this->m_NumberOfLevels; this->m_CurrentLevel++ )
     {
     this->InitializeRegistrationAtEachLevel( this->m_CurrentLevel );

     this->m_Metric->Initialize();

     this->m_Optimizer->StartOptimization();
     }
}

If I modify this code to check for m_AbortGenerateData, the registration 
terminates as expected.


In addition it seems that the members m_CurrentMetricValue, 
m_CurrentIteration etc. are never updated during optimization.

Best regards
Bryn



On 04.12.2014 23:18, Bryn Lloyd wrote:
> Hi
>
> I recently started using ITK again and am trying out the ITK 
> registration framework v4.
>
>
> I am trying to gracefully abort/stop the ImageRegistrationMethodv4 
> process, however it just continues.
>
> In my Command class, which observes an IterationEvent of the 
> ImageRegistrationMethodv4 and Optimizer  I call
> 1.  registration_method_v4->SetAbortGenerateData( true ); // object of 
> type ImageRegistrationMethodv4<...>
>
> 2. optimizer->StopOptimization();
>
> However, the process just continues to execute. Is this supposed to 
> work? What am I doing wrong?
>
> Thanks and best regards
> Bryn
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users



More information about the Insight-users mailing list