[Insight-users] information back from threads for writing multi-threaded filters

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Aug 3 23:21:44 EDT 2011


Hello Arindam,

The itkStatisticsImageFilter would be a good filter to examine. In uses arrays of the size of the number of threads. Allocating them in BeforeThreadedGenerateData, and then gathering the computation in the AfterThreadedGenerateData methods.

Brad

On Aug 3, 2011, at 10:42 PM, iamrndm b wrote:

> hi all, 
> 
> I am writing a filter which goes through two images(input)  and finds the number of pixels in which both images have the same value at same locations.Thanks to a lot of help , I now have a working code which is multi-threaded and goes through the two images.The next problem i face deals with getting back the information being processed in the threads 
> 
> Is there a way to have variables which belong to each individual threads and then access them at end , or do I have to use mutex. Is there an example anywhere which does this.
> 
> Thanks 
> 
> Arindam
> _____________________________________
> 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.html
> 
> 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://www.itk.org/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110803/5db982f9/attachment.htm>


More information about the Insight-users mailing list