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

Matt McCormick matt.mccormick at kitware.com
Mon Dec 8 12:37:42 EST 2014


Hi Bryn,

Thanks for looking into these issues.

Could a patches please be created to address them? [1].  I think a
separate patch could be created for each member.  The check for
AbortGenerateData should use the method:

  this->GetAbortGenerateData()

Thanks,
Matt

[1] https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html

On Thu, Dec 4, 2014 at 5:48 PM, Bryn Lloyd <lloyd at itis.ethz.ch> wrote:
> 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
>
>
> _____________________________________
> 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