<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Rob, <br>
    <br>
    Check itkImageSource, this abstract class has the methods to create
    a multithreaded algorithm. <br>
    <br>
    virtual void ThreadedGenerateData(const OutputImageRegionType&amp;
    outputRegionForThread, int threadId );<br>
    &nbsp; virtual void AllocateOutputs();&nbsp; <br>
    &nbsp; virtual void BeforeThreadedGenerateData();&nbsp; <br>
    &nbsp; virtual void AfterThreadedGenerateData();<br>
    <br>
    If they are implemented then when update is called, the algorithm
    will divide the image and call the corresponding number of threads.<br>
    <br>
    bye,<br>
    <br>
    Le 26/07/2011 00:03, robert behan a &eacute;crit&nbsp;:
    <blockquote
cite="mid:CAP0zzh1LAH6-D9e-tUipvuW7Mf_O3BKGYcWTJVJ7b3gS3BnZvA@mail.gmail.com"
      type="cite">
      <pre wrap="">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 <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a>

Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      Juan Carlos Prieto
      <font face="arial" color="grey" size="2">
        <br>
        Phd Student
        <br>
        <a href="http://www.creatis.insa-lyon.fr">CREATIS</a>
        Tel:+33472438918
        <br>
        7 Av Jean Capelle
        <br>
        69621 Villeurbanne Cedex
        <br>
        France <br>
        <a href="http://www.creatis.insa-lyon.fr/%7Eprieto">Personal
          page</a>
      </font>
    </div>
  </body>
</html>