<br>Hi Sean,<br><br><br>It depends on what you want to do...<br><br><br>The methods<br><br>   itk::MultiThreader::SetGlobalDefaultNumberOfThreads(#);<br>
    itk::MultiThreader::SetGlobalMaximumNumberOfThreads(#)<br><br>Will set the number of threads for EVERYTHING,<br>not just the registration metrics.<br><br><br>Therefore, if you run, for example an AddImageFilter, <br>
the number of threads that this filter uses will be also<br>limited by the number that you set.<br><br><br>If you really want to control only the number of threads<br>used by the registration process, probably the best way<br>
to do it is by calling:<br><br>    registrationMethod-&gt;SetNumberOfThreads( N );<br><br>This value will be then (internally and automatically)<br>passed to the image metric.<br><br><br><br>    Regards,<br><br> <br>           Luis<br>
<br><br><br>--------------------------------------------------------------------------------------------------------<br><div class="gmail_quote">On Fri, Aug 27, 2010 at 4:01 PM, Sean Ziegeler <span dir="ltr">&lt;<a href="mailto:sean.ziegeler@nrlssc.navy.mil">sean.ziegeler@nrlssc.navy.mil</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">When building 3.20.0 with ITK_USE_OPTIMIZED_REGISTRATION_METHODS on, I&#39;m trying to figure out the latest recommended method for setting the number of threads for the entire registration process.<br>

<br>
There are a number of examples from the Testing/Code/Review directory, and each does it differently, i.e.,<br>
<br>
1. itkOptImageToImageMetricsTest uses:<br>
    itk::MultiThreader::SetGlobalDefaultNumberOfThreads(#);<br>
    itk::MultiThreader::SetGlobalMaximumNumberOfThreads(#);<br>
<br>
2. itkOptImageToImageMetricsTest2 uses:<br>
    metric-&gt;GetThreader()-&gt;SetGlobalDefaultNumberOfThreads(#);<br>
    metric-&gt;GetThreader()-&gt;SetGlobalMaximumNumberOfThreads(#);<br>
<br>
3. itkOptMattesMutualInformationImageToImageMetricThreadsTest1 uses:<br>
    metric-&gt;SetNumberOfThreads(#);<br>
<br>
Is any one better or more recent than the other?<br>
<br>
Thanks,<br>
Sean<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>