[ITK] [ITK-users] itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1)

Emma Ryan eryanvtk at yahoo.com
Thu Mar 27 12:51:24 EDT 2014


Thank you, Bill.  That worked.

Emma.





On Wednesday, March 26, 2014 11:48 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
 
Make this call in your main program:

itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1);




On Wed, Mar 26, 2014 at 10:40 AM, Emma Ryan <eryanvtk at yahoo.com> wrote:
> Hi ,
>
>   How does one set this variable within the code ?
>
> I use a bunch of itk filters to process some images. I have built ITK with
> default settings which I'm guessing includes multithreading.
>
> I have not explicitly declared itk::MultiThreader class in my application.
> but I know there is some multithreading going on and I would like to turn it
> off.  I read somewhere that I could use the command
> itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1) to do so.
>
> But using the above in my line in my code gives me redeclaration errors.
>
> Using extern also didn't help.
>
> Here's a snippet of what I tried...
>
> Following code included in my_itk_var.h
>
> ifndef _my_itk_var_h_
> #define _my_itk_var_h_
>
> extern itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1)
>
> #endif _my_itk_var_h_
>
>
> the file my_itk_var.h is included in many other c++ .h files.
>
> Any help is appreciated.
>
> thanks,
> Emma
>
>
> _____________________________________
> 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://www.itk.org/mailman/listinfo/insight-users
>



-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140327/ad0c8f9b/attachment-0002.html>
-------------- next part --------------
_____________________________________
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://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list