<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div id="yiv0528815673"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"><div id="yiv0528815673yui_3_13_0_ym1_1_1395854511244_4114">Hi ,</div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_13"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;" id="yiv0528815673yui_3_13_0_ym1_1_1395854511244_4135"> How does one set this variable within the code ?</div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_19" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;background-color:transparent;font-style:normal;"><br id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_24"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_21" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">I use a bunch of itk filters to process some images. I have built ITK with default settings which I'm guessing includes multithreading. <br id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_29"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_26" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_33"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_30" style="color:rgb(0, 0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">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.</div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_34" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_39"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_36" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">But using the above in my line in my code gives me redeclaration errors.<br><br>Using extern also didn't help.<br><br>Here's a snippet of what I tried...<br><br>Following code included in my_itk_var.h<br><br>ifndef _my_itk_var_h_<br>#define _my_itk_var_h_<br><br>extern
itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1) <br><br>#endif _my_itk_var_h_<br></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_41" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br><br>the file my_itk_var.h is included in many other c++ .h files.<br><br>Any help is appreciated.<br><br id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_50"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_47" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">thanks,</div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_52" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;background-color:transparent;font-style:normal;">Emma<br id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_46"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_43" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"></div><div id="yiv0528815673yui_3_13_0_ym1_8_1395854511244_30" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"> </div></div></div></div></div></body></html>