ITK icon indicating copy to clipboard operation
ITK copied to clipboard

A question about itk filter multithread.

Open xiaohoua opened this issue 2 years ago • 3 comments

When I use a filter, how can I know where this filter class turn on multithread. such as itkSimilarityIndexImageFilter, does it turn on the multithread when using FilterType = itk::SimilarityIndexImageFilter<Image1Type, Image2Type>; FilterType::Pointer filter = FilterType::New(); ? Does the filter turn on multithreading in the constructor when it is declared?

xiaohoua avatar May 21 '23 06:05 xiaohoua

Another question, how can i set the number of threads and work units in my filter.

xiaohoua avatar May 21 '23 13:05 xiaohoua

filter->GetNumberOfWorkUnits() and filter->GetMultiThreader()->GetMaximumNumberOfThreads(). There is also a Set version of both methods.

Most filters set up multithreading in the constructor. The rest are not easily threaded.

dzenanz avatar May 22 '23 13:05 dzenanz

Also, you could have found this out via the documentation: DocsBrowsing

dzenanz avatar May 22 '23 13:05 dzenanz