<div dir="ltr">Do you mean ask the user to input a number (always different) for each thread ?<div><br></div><div>Thank you.</div><div>-Laurent</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 4:32 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I haven't looked at the classes closely. But would expect these filters have a user settable seed, to make the results reproduce able, and be the same independent with the number of threads.<div>
<br></div><div>The trick would be to have each thread has a random number generator object, then at the beginning of each line seed it with a combination of the user defined seed, and the starting index of the scan-line ( perhaps multiplied by a prime number).</div>
<div><br></div><div>Hope that some help... I just have some ideas in my head about some ways to do it...</div><div><br></div><div>Brad</div><div><div class="h5"><div><br><div><div>On Mar 6, 2014, at 4:26 PM, Laurent Chauvin <<a href="mailto:lchauvin@bwh.harvard.edu" target="_blank">lchauvin@bwh.harvard.edu</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">It actually works but you have to force the filter to only use 1 thread.<div><br></div><div>I think otherwise all threads got the same "random" values, which generate same output for all threads.</div>
<div>My guess is the image is divided in 'lines' or 'column', each of them managed by a separated thread. If all threads have same random values, then the output will be patterned.</div><div><br></div><div>
If it's possible to have different random values for each threads, then it should be possible to run it with multiple threads.</div><div>I think one possibility would be to use a timestamp as seed for the NormalVariateGenerator filter.</div>
<div>I tried with GetTimeStamp(), but this is the same timestamp for all threads.</div><div>I tried with GetNumberOfThreads(), but still the same number for all threads.</div><div>I tried with GetMTime(), same.</div><div>
I tried with 'this', but this is the same pointer too.</div><div><br></div><div>I'm not sure which variable could be different in each thread.</div><div><br></div><div>Thank you.</div><div>-Laurent</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 3:56 PM, Laurent Chauvin <span dir="ltr"><<a href="mailto:lchauvin@bwh.harvard.edu" target="_blank">lchauvin@bwh.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I tried to use the itkAdditiveGaussianNoiseFilter, but on the output image I obtain, the noise seems really patterned.<div>
<br></div><div>I compiled the code from the article, and run exactly the same example with same parameters and I don't have the same results as on the article.</div>
<div>As I mentionned, the noise I obtain seems really patterned.</div><div><br></div><div>I enclosed the picture I obtain after running the 'gauss' example with the same parameters as the article.</div><div><br></div>
<div>Is it possible that the 'NormalVariateGenerator' used in the AdditiveGaussianNoiseFilter changed since the article has been written ?</div><div>I noticed that the gaussian filter does not call Initialize of the NormalVariateGenerator, but I tried to add it, and it doesn't make any difference.</div>
<div><br></div><div>Thank you.</div><span><font color="#888888">-Laurent</font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 1:19 PM, Laurent Chauvin <span dir="ltr"><<a href="mailto:lchauvin@bwh.harvard.edu" target="_blank">lchauvin@bwh.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I didn't look in the article for now.<div><br></div><div>I was first trying to compile the code. There is a minor modification to do to be compatible with ITKv4, but otherwise it's pretty straight forward.</div>
<div>So far I only tested itkAdditiveGaussianNoiseFilter.</div><div><br></div><div>Thank you.</div><span><font color="#888888">-Laurent</font></span></div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 1:11 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It would be great if you could to a brief review of the IJ article to facilitate integrating it into ITK.<div>
<br></div><div>Brad<div><br><div><div>On Mar 6, 2014, at 12:17 PM, Laurent Chauvin <<a href="mailto:lchauvin@bwh.harvard.edu" target="_blank">lchauvin@bwh.harvard.edu</a>> wrote:</div><br><blockquote type="cite">
<div dir="ltr">Thank you Bradley.<div><br></div><div>Indeed I saw this article, but as it is from 2010, I thought maybe now it would have been integrated into ITK.</div><div>I will look into that.</div><div><br></div><div>
Thank you.</div><div>-Laurent</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 11:59 AM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Have a look at this insight journal article:<div><br></div><div><a href="http://www.insight-journal.org/browse/publication/721" target="_blank">http://www.insight-journal.org/browse/publication/721</a></div>
<div><br></div><div>I would also find this quite useful, and have been thinking about adding it to ITK.</div><div>Brad<br><div><div><div>On Mar 6, 2014, at 11:55 AM, Laurent Chauvin <<a href="mailto:lchauvin@bwh.harvard.edu" target="_blank">lchauvin@bwh.harvard.edu</a>> wrote:</div>
<br></div><blockquote type="cite"><div><div dir="ltr">Hello,<div><br></div><div>I'm trying to develop a filter, but in order to test it, I need to add some gaussian noise to my image.</div><div>I looked for it but I couldn't find a ITK filter to generate noise.</div>
<div><br></div><div>Is there a way to do this ?</div><div><br></div><div>Thank you very much.</div><div>-Laurent</div><div><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div>
<div>Brigham And Women's Hospital, Harvard Medical School<br></div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div></div></div>
_____________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div><div><br></div><p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div><div>Brigham And Women's Hospital, Harvard Medical School<br>
</div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>
</blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div>
<div>Brigham And Women's Hospital, Harvard Medical School<br></div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>
</div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div><div>Brigham And Women's Hospital, Harvard Medical School<br>
</div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div><div>Brigham And Women's Hospital, Harvard Medical School<br>
</div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div>
<div>Brigham And Women's Hospital, Harvard Medical School<br></div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>