<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello everyone,<br>
<br>
I'm quite new in ITK world, and I'm currently doing few experiences
in order to learn its logic.<br>
<br>
After few easy exercices, I'm now at a step I want to multithread a
method.<br>
As I did in the past, I've been reading the ITK classes to get
"inspiration", and e- mails from here in case of troubles.<br>
<br>
I'm facing an issue at the moment, and I can't figure why, and how
to solve it.<br>
<br>
My filter works with<br>
<ul>
<li>One 3D InputImage (of any pixel type)<br>
</li>
<li>Two "tool" 3D images, respectively of float and unsigned char
pixel types</li>
</ul>
<p>From what I read, I've understood there are two main ways of
multithreading:</p>
<ul>
<li>The old fashioned one using
BeforeThreadedGenerateData/ThreadedGenerateData/AfterThreadedGenerateData</li>
<li>the one using itk::DomainThreader member.</li>
</ul>
<p>As I'm a bit old school, I used the first option.</p>
My problem remains here: (I changed my variables' name to make it
clearer)<br>
<br>
ThreadedComputation(const OutputImageRegionType
&outputRegionForThread, ThreadIdType threadId) {<br>
itk::ProgressReporter progress(this, threadId,
outputRegionForThread.GetNumberOfPixels());<br>
typename TOutputImage::Pointer image =
this->GetOutput(0);<br>
<br>
itk::ImageRegionIterator< TOutputImage > imgIt(image,
outputRegionForThread);<br>
itk::ImageRegionIterator< FloatImageType> floatIt
(m_MyFloatImage, outputRegionForThread);<br>
....<br>
<br>
When creating the floatIt iterator, I have a crash. Using a try
catch block, the issue is due to out of bound region.<br>
Everything is correct, but the index, for which it's completly crazy
([156245468,0,156245468] or something approching).<br>
<br>
I've tried different options to solve this, but rather than doing
witchcraft and at some point getting something working, I'd prefer
to improve my understanding thanks to your expertise.<br>
<br>
Thanks all,<br>
<br>
Nicolas Courtial<br>
<br>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>