[Insight-users] Multithreading in ITK
Juan Carlos Prieto
prieto at creatis.insa-lyon.fr
Tue Jul 26 04:27:33 EDT 2011
Hi Rob,
Check itkImageSource, this abstract class has the methods to create a
multithreaded algorithm.
virtual void ThreadedGenerateData(const OutputImageRegionType&
outputRegionForThread, int threadId );
virtual void AllocateOutputs();
virtual void BeforeThreadedGenerateData();
virtual void AfterThreadedGenerateData();
If they are implemented then when update is called, the algorithm will
divide the image and call the corresponding number of threads.
bye,
Le 26/07/2011 00:03, robert behan a écrit :
> 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
> _____________________________________
> 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
--
Juan Carlos Prieto
Phd Student
CREATIS <http://www.creatis.insa-lyon.fr> Tel:+33472438918
7 Av Jean Capelle
69621 Villeurbanne Cedex
France
Personal page <http://www.creatis.insa-lyon.fr/%7Eprieto>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110726/b84d05b5/attachment.htm>
More information about the Insight-users
mailing list