<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><base href="x-msg://8/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>OpenMP can't auto parallelize that type of loop.</div><div><br></div><div>Have you looked into the standard ITK image filter's ThreadedGenerateData methods? Is there any particular reason you are looking into this approach vs the the standard ITK one?</div><div><br></div><div>Here is the basic example of how to write a multi-threaded filter:</div><div><br></div><div><a href="http://www.vtk.org/Wiki/ITK/Examples/Developer/MultiThreadedImageFilter">http://www.vtk.org/Wiki/ITK/Examples/Developer/MultiThreadedImageFilter</a></div><div><br></div><div><br></div><div>For your specific question, I would try creating a outter loop of an integer type to iterate over the slices in the image, which should able to be parallelized by OpenMP. Then create utilize a Slicer iterator.</div><div><br></div><div>Hope that works for you,</div><div>Brad</div><div><br><div><div>On Aug 23, 2012, at 6:25 AM, Vikash Gupta <<a href="mailto:vikash.gupta@inria.fr">vikash.gupta@inria.fr</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Hello everyone, <div><br></div><div>Is it possible to use itk::ImageRegionIterator with OpenMP for ITK 3.2 </div><div>I want to have something like this</div><div><pre style="background-color: rgb(255, 255, 255); "><i> #pragma omp parallel for</i></pre><pre style="background-color: rgb(255, 255, 255); "><i>IteratorType it(Image, Image->GetLargestPossibleRegion() )
</i><i>for(it.GoToBegin(); !it.IsAtEnd(); ++it)
</i><i>{
</i><i>it->compute();
</i><i>}</i></pre><pre style="background-color: rgb(255, 255, 255); ">If not can anyone suggest a good alternative.</pre><pre style="background-color: rgb(255, 255, 255); ">Thanks</pre><pre style="background-color: rgb(255, 255, 255); ">Vikash</pre></div></div>_____________________________________<br>Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></div></blockquote></div><br></div></body></html>