[ITK] [ITK-users] How to abort execution of ImageRegistrationMethodv4 / Optimizer
Bradley Lowekamp
blowekamp at mail.nih.gov
Mon Dec 8 12:51:42 EST 2014
Hello,
I think that the optimizer needs to be stopped or told to abort. Perhaps the registration method should forward the request to the optimizer?
Brad
On Dec 8, 2014, at 12:37 PM, Matt McCormick <matt.mccormick at kitware.com> wrote:
> 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
> _____________________________________
> 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 Community
mailing list