[Insight-users] Multithreading in ITK

Dawood AlMasslawi masslawi at gmail.com
Wed Jul 27 08:57:38 EDT 2011


Hi Robert,

See the following presentation and code example,

http://www.vtk.org/Wiki/images/2/24/Insight-MultiThreading.ppt

http://www.vtk.org/Wiki/ITK/Examples/Developer/OilPaintingImageFilter

HTH,
Dawood


>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<

>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<


Hi there,

I am developing an application for reconstructing MRI images and
performing real time image processing ( i,e image processing ) as I
would like to explore the effect of mutlitthreading on execution speed

I am not exactly sure how multi-threading works in ITK so I would
appreciate some guidance on this. Please correct me if any of the
following is incorrect:.

I originally assumed the user would have to write the code themselves
if they want to implement multithreading, but as I understand it you
are only required to do this if you are writing your own custom
filter? In which case multithreading is already implicitly implemented
in a lot of the ITK filters and is automatically used if your code
runs on a multi-core processor?

For example, if I apply the FFT filter to some kspace data, will it
automatically execute on the 4 processors of my machine or do I need
to explicitly tell it to do do?

I presume if no multithreading libraries are specified when building
iTK in cmake then the code will automatically execute on one
processor?

I did build ITK and checked the CMAKE USE WIN32 THREADS so I think my
code should automatically run on the four processors but I am not sure
how to check this? I checked the windows task manager when I executed
my code and the four processors appear to fire up but I would like to
verify this somehow in ITK?

Also how can I set the number of processors I want my code to run on?

Any guidance would be much appreciated,

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110727/21688866/attachment.htm>


More information about the Insight-users mailing list