[ITK] ProgressReporter and Multi-Threading

Wood, Tobias tobias.wood at kcl.ac.uk
Mon Jun 15 05:15:48 EDT 2015


Hello,


I am using ITK 4.7.2. I added a ProgressReporter to the ThreadedGenerateData() method of a filter I am writing, with the following definition:


ProgressReporter progress(this, threadId, region.GetNumberOfPixels(), 10);


as per the documentation here: http://www.itk.org/Doxygen/html/classitk_1_1ProgressReporter.html. I then added a simple itk::Command subclass to print progress in percent.


However, when I run the program, the progress quite quickly reaches 100%, then no further ProgressEvents are raised. The program continues to execute and does finish eventually. After looking at the code for ProgressReporter, I assume this is because thread 0 somehow out-competes the other threads and finishes its processing quite fast. The other threads then continue to run peacefully, but they don't touch the Progress counter.


Is there a way to get a more accurate Progress report with multi-threading? Am I missing something?


Thanks in advance,

Toby



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150615/eb01a825/attachment.html>


More information about the Community mailing list