[Insight-users] multi-threading in ITK
Matt McCormick
matt at mmmccormick.com
Wed Aug 11 17:57:48 EDT 2010
>label maps.Would anyone be able to give me some hint of how to get ITK to
>recognize the number of processors on a computer and then subdivide the
>segmenting of different regions to run on different processors?Thank you,John
>
>
Hi John,
ITK conveniently does all these tasks for you. The default behavior is to set
the number of threads in a multi-threaded filter to the number of processors on
the system. The splitting of regions is done by itk::ImageSource in the
SplitRequestedRegion(), which generates the output region for
ThreadedGenerateData(). Therefore, all you must do is create an
ImageToImageFilter that performs your seeded work in the ThreadedGenerateData().
Sewing the seeds back together can be done in AfterThreadedGenerateData(). For
more information, see section 13.4 Threaded Filter Execution in the ITK Software
Guide.
Regards,
Matt
More information about the Insight-users
mailing list