[Insight-users] Exception thrown when trying to abort itk::GridImageSource with ITK4

Rajon,Didier Alain didier at ufl.edu
Wed Oct 3 12:47:20 EDT 2012


Hello,

When I try to abort the execution of the filter itk::GridImageSource, the filter generates an exception which is NOT an itk::ProcessAbort (as it should be).
Note that if, instead, I use itk::GaussianImageSource, it works fine: the abort generates an itk::ProcessAbort exception.
These 2 filters are both subclasses of itk::GenerateImageSource. The difference is that itk::GaussianImageSource is not multi-threaded (it overloads GenerateData()) whereas itk::GridImageSource is multi-threaded (it overloads (ThreadedGenerateData()). Is there any issue with aborting multi-threaded filters? Note that I used to do the same with ITK3 and it has always worked fine.

I have attached a short C++ program that reproduces the issue. The program sets an observer (an itk::CStyleCommand) on the Progress event of the filter. The callback function aborts the filter when the progress reaches 10%. This scheme is reproduced for both an itk::GaussianImageSource and an itk::GridImageSource. Running the program will show the different behaviors of the two filters: the itk::ProcessAbort is caught properly when using itk::GaussianImageSource whereas it is not when using itk::GridImageSource.

I am using ITK-4.2.1 under Linux

Thanks,

Didier.



Didier Rajon 
Neurosurgery Department
University of Florida
L2-100 MBI
PO Box 100265
Gainesville, FL, 32610
USA
Tel (1) 352 273 6987
Fax (1) 352 392 8413

This email, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this email is not the intended recipient or their authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this email in error, please notify the sender by replying to this message and deleting the email immediately.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestITK4.cpp
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121003/54cc1b2e/attachment.asc>


More information about the Insight-users mailing list