[Insight-users] Recommended method for setting threads for optimized registration

Luis Ibanez luis.ibanez at kitware.com
Sun Sep 12 17:48:54 EDT 2010


Hi Sean,


It depends on what you want to do...


The methods

   itk::MultiThreader::SetGlobalDefaultNumberOfThreads(#);
   itk::MultiThreader::SetGlobalMaximumNumberOfThreads(#)

Will set the number of threads for EVERYTHING,
not just the registration metrics.


Therefore, if you run, for example an AddImageFilter,
the number of threads that this filter uses will be also
limited by the number that you set.


If you really want to control only the number of threads
used by the registration process, probably the best way
to do it is by calling:

    registrationMethod->SetNumberOfThreads( N );

This value will be then (internally and automatically)
passed to the image metric.



    Regards,


           Luis



--------------------------------------------------------------------------------------------------------
On Fri, Aug 27, 2010 at 4:01 PM, Sean Ziegeler <
sean.ziegeler at nrlssc.navy.mil> wrote:

> When building 3.20.0 with ITK_USE_OPTIMIZED_REGISTRATION_METHODS on, I'm
> trying to figure out the latest recommended method for setting the number of
> threads for the entire registration process.
>
> There are a number of examples from the Testing/Code/Review directory, and
> each does it differently, i.e.,
>
> 1. itkOptImageToImageMetricsTest uses:
>    itk::MultiThreader::SetGlobalDefaultNumberOfThreads(#);
>    itk::MultiThreader::SetGlobalMaximumNumberOfThreads(#);
>
> 2. itkOptImageToImageMetricsTest2 uses:
>    metric->GetThreader()->SetGlobalDefaultNumberOfThreads(#);
>    metric->GetThreader()->SetGlobalMaximumNumberOfThreads(#);
>
> 3. itkOptMattesMutualInformationImageToImageMetricThreadsTest1 uses:
>    metric->SetNumberOfThreads(#);
>
> Is any one better or more recent than the other?
>
> Thanks,
> Sean
> _____________________________________
> 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/20100912/0fdcac9c/attachment.htm>


More information about the Insight-users mailing list