<div dir="ltr">Hi Jim,<div><br><div>It had a different problem when using float. It would show a NAN on the results. That's why I changed to short. <div>The card has 4GB ram. </div></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 7:40 PM, Jim Miller <span dir="ltr"><<a href="mailto:millerjv@gmail.com" target="_blank">millerjv@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>Does the test for GPUDiscreteGaussian run on your platform?</div><div><br></div><div>The test uses a pixel type of float. Your code does not. You might try float. </div><div><br></div><div>The Gaussian filter will require much more GPU memory than the mean filter. How much memory does your GPU have?<br>
<br>Jim</div><div><div class="h5"><div><br>On Apr 15, 2014, at 11:18 AM, Jose Ignacio Prieto <<a href="mailto:joseignacio.prieto@gmail.com" target="_blank">joseignacio.prieto@gmail.com</a>> wrote:<br><br></div><blockquote type="cite">
<div><div dir="ltr">Hi all, I am having trouble using GPUdiscretegaussian. It works for me on CPU but GPU version gives output 0. I tried running the test code but no help. I do run GPUMean filter. My card is AMDw7000 and using opencl 1.2, itk 4.6<div>

<br></div><div>Here is the code and the output. The images are vtk files of 320x320x231, ushort.</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">/*=========================================================================</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">Copyright</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Insight</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Software</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Consortium</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">Licensed</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">under</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Apache</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">License,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Version</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">2.0</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"License");</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">you</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">may</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">use</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">this</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">file</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">except</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">in</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">compliance</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">with</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">License.</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">You</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">may</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">obtain</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">a</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">copy</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">of</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">License</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">at</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">         </span><span style="color:rgb(0,128,0)"><a href="http://www.apache.org/licenses/LICENSE-2.0.txt" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.txt</a></span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">Unless</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">required</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">by</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">applicable</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">law</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">or</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">agreed</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">in</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">writing,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">software</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">distributed</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">under</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">License</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">distributed</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">on</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">an</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"AS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">IS"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">BASIS,</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">WITHOUT</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">WARRANTIES</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OR</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CONDITIONS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OF</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">ANY</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">KIND,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">either</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">express</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">or</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">implied.</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">See</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">License</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">for</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">specific</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">language</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">governing</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">permissions</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">and</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">limitations</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">under</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">License.</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">*=========================================================================*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkImageFileReader.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkImageFileWriter.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUImage.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUKernelManager.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUContextManager.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUImageToImageFilter.h"</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUNeighborhoodOperatorImageFilter.h"</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkTimeProbe.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGaussianOperator.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkDiscreteGaussianImageFilter.h"</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUDiscreteGaussianImageFilter.h"</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkMeanImageFilter.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkGPUMeanImageFilter.h"</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">float</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">InputPixelType;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">float</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OutputPixelType;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">short</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">InputPixelType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">short</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">OutputPixelType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">GPUImage</span><span style><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">InputPixelType</span><span style>,</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(192,192,192)"> </span><span style>></span><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,128)">InputImageType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">GPUImage</span><span style><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">OutputPixelType</span><span style>,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(192,192,192)"> </span><span style>></span><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,128)">OutputImageType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">ImageFileReader</span><span style><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">InputImageType</span><span style="color:rgb(192,192,192)">  </span><span style>></span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,0,128)">ReaderType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">ImageFileWriter</span><span style><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">OutputImageType</span><span style="color:rgb(192,192,192)"> </span><span style>></span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,0,128)">WriterType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style>main</span><span style>(</span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style>argc</span><span style>,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">char</span><span style="color:rgb(192,192,192)"> </span><span style>*</span><span style>argv</span><span style>[])</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">if</span><span style>(!</span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style>IsGPUAvailable</span><span style>())</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cerr<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"OpenCL-enabled</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">present."</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">EXIT_FAILURE</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">if</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>argc</span><span style="color:rgb(192,192,192)"> </span><span style><</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(192,192,192)"> </span><span style>)</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cerr<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"Error:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">missing</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">arguments"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cerr<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"inputfile</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">outputfile</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">[num_dimensions]"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">EXIT_FAILURE</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">std</span><span style>::</span><span style="color:rgb(128,0,128)">string</span><span style="color:rgb(192,192,192)"> </span><span style>inFile</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>argv</span><span style>[</span><span style="color:rgb(0,0,128)">1</span><span style>]</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">std</span><span style>::</span><span style="color:rgb(128,0,128)">string</span><span style="color:rgb(192,192,192)"> </span><span style>outFile</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>argv</span><span style>[</span><span style="color:rgb(0,0,128)">2</span><span style>]</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style>dim</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">3</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">ReaderType</span><span style>::</span><span style="color:rgb(128,0,128)">Pointer</span><span style="color:rgb(192,192,192)"> </span><span style>reader</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">WriterType</span><span style>::</span><span style="color:rgb(128,0,128)">Pointer</span><span style="color:rgb(192,192,192)"> </span><span style>writer</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>reader</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ReaderType</span><span style>::</span><span style>New</span><span style>();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>writer</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WriterType</span><span style>::</span><span style>New</span><span style>();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>reader</span><span style>-></span><span style="font-style:italic">SetFileName</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>inFile</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>writer</span><span style>-></span><span style="font-style:italic">SetFileName</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>outFile</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">float</span><span style="color:rgb(192,192,192)"> </span><span style>variance</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">4.0</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">test</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">1~8</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">threads</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">for</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CPU</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style>nThreads</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">DiscreteGaussianImageFilter</span><span style><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">InputImageType</span><span style>,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">OutputImageType</span><span style>></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">CPUFilterType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">CPUFilterType</span><span style>::</span><span style="color:rgb(128,0,128)">Pointer</span><span style="color:rgb(192,192,192)"> </span><span style>CPUFilter</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">CPUFilterType</span><span style>::</span><span style="color:rgb(128,0,0)">New</span><span style>();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">TimeProbe</span><span style="color:rgb(192,192,192)"> </span><span style>cputimer</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>cputimer</span><span style>.</span><span style>Start</span><span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>CPUFilter</span><span style>-></span>SetNumberOfThreads<span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>nThreads</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>CPUFilter</span><span style>-></span>SetInput<span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>reader</span><span style>-></span><span style>GetOutput</span><span style>()</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>CPUFilter</span><span style>-></span>SetMaximumKernelWidth<span style>(</span><span style="color:rgb(0,0,128)">10</span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>CPUFilter</span><span style>-></span>SetUseImageSpacingOff<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>CPUFilter</span><span style>-></span>SetVariance<span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>variance</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>CPUFilter</span><span style>-></span>Update<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>cputimer</span><span style>.</span><span style>Stop</span><span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">itk::MeanImageFilter<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">InputImageType,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OutputImageType></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CPUFilterType;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">CPUFilterType::Pointer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CPUFilter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CPUFilterType::New();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">itk::TimeProbe</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">cputimer;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">cputimer.Start();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">CPUFilter->SetNumberOfThreads(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">nThreads</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">CPUFilter->SetInput(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">reader->GetOutput()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">CPUFilter->SetMaximumKernelWidth(10);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">CPUFilter->SetUseImageSpacingOff();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">CPUFilter->SetRadius(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">variance</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">CPUFilter->Update();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">cputimer.Stop();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"CPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Gaussian</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Filter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">took</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style>cputimer</span><span style>.</span><span style>GetMean</span><span style>()</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">seconds</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">with</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">              </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style>CPUFilter</span><span style>-></span>GetNumberOfThreads<span style>()</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">threads.\n"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-------</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">GPUDiscreteGaussianImageFilter</span><span style><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">InputImageType</span><span style>,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">OutputImageType</span><span style>></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GPUFilterType</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">GPUFilterType</span><span style>::</span><span style="color:rgb(128,0,128)">Pointer</span><span style="color:rgb(192,192,192)"> </span><span style>GPUFilter</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GPUFilterType</span><span style>::</span><span style="color:rgb(128,0,0)">New</span><span style>();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">TimeProbe</span><span style="color:rgb(192,192,192)"> </span><span style>gputimer</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>gputimer</span><span style>.</span><span style>Start</span><span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>SetInput<span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>reader</span><span style>-></span><span style>GetOutput</span><span style>()</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>SetVariance<span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>variance</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>SetMaximumKernelWidth<span style>(</span><span style="color:rgb(0,0,128)">10</span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>SetUseImageSpacingOff<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilter->DebugOn();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilter->GPUEnabledOff();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>Print<span style>(</span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>Update<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>GPUFilter</span><span style>-></span>GetOutput<span style>()-></span>UpdateBuffers<span style>();</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">synchronization</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">point</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(GPU->CPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">memcpy)</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>gputimer</span><span style>.</span><span style>Stop</span><span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"GPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Gaussian</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Filter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">took</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style>gputimer</span><span style>.</span><span style>GetMean</span><span style>()</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">seconds.\n"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">itk::GPUMeanImageFilter<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">InputImageType,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OutputImageType></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPUFilterType;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilterType::Pointer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPUFilter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPUFilterType::New();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">itk::TimeProbe</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">gputimer;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">gputimer.Start();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilter->SetInput(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">reader->GetOutput()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">GPUFilter->SetVariance(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">variance</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">GPUFilter->SetMaximumKernelWidth(10);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">GPUFilter->SetUseImageSpacingOff();</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">GPUFilter->DebugOn();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">////</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">GPUFilter->Print(std::cout);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilter->SetRadius(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">variance</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilter->Update();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">GPUFilter->GetOutput()->UpdateBuffers();</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">synchronization</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">point</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(GPU->CPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">memcpy)</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">gputimer.Stop();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">std::cout</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"GPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Gaussian</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Filter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">took</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">gputimer.GetMean()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">seconds.\n"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">std::endl;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">---------------</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">RMS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Error</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">check</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">---------------</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style>diff</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style>nPix</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">ImageRegionIterator</span><span style><</span><span style="color:rgb(128,0,128)">OutputImageType</span><span style>></span><span style="color:rgb(192,192,192)"> </span><span style>cit</span><span style>(</span><span style>CPUFilter</span><span style>-></span>GetOutput<span style>(),</span><span style="color:rgb(192,192,192)"> </span><span style>CPUFilter</span><span style>-></span>GetOutput<span style>()-></span>GetLargestPossibleRegion<span style>());</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">itk</span><span style>::</span><span style="color:rgb(128,0,128)">ImageRegionIterator</span><span style><</span><span style="color:rgb(128,0,128)">OutputImageType</span><span style>></span><span style="color:rgb(192,192,192)"> </span><span style>git</span><span style>(</span><span style>GPUFilter</span><span style>-></span>GetOutput<span style>(),</span><span style="color:rgb(192,192,192)"> </span><span style>GPUFilter</span><span style>-></span>GetOutput<span style>()-></span>GetLargestPossibleRegion<span style>());</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">for</span><span style>(</span><span style>cit</span><span style>.</span><span style>GoToBegin</span><span style>(),</span><span style="color:rgb(192,192,192)"> </span><span style>git</span><span style>.</span><span style>GoToBegin</span><span style>();</span><span style="color:rgb(192,192,192)"> </span><span style>!</span><span style>cit</span><span style>.</span><span style>IsAtEnd</span><span style>();</span><span style="color:rgb(192,192,192)"> </span><span style>++</span><span style>cit</span><span style>,</span><span style="color:rgb(192,192,192)"> </span><span style>++</span><span style>git</span><span style>)</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style>err</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style>(</span><span style="color:rgb(128,128,0)">double</span><span style>)(</span><span style>cit</span><span style>.</span><span style>Get</span><span style>())</span><span style="color:rgb(192,192,192)"> </span><span style>-</span><span style="color:rgb(192,192,192)"> </span><span style>(</span><span style="color:rgb(128,128,0)">double</span><span style>)(</span><span style>git</span><span style>.</span><span style>Get</span><span style>());</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">         </span><span style="color:rgb(0,128,0)">if(err</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0.1</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">||</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(double)cit.Get()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0.1)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">std::cout</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"CPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(double)(cit.Get())</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">",</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(double)(git.Get())</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">std::endl;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style>diff</span><span style="color:rgb(192,192,192)"> </span><span style>+=</span><span style="color:rgb(192,192,192)"> </span><span style>err</span><span style>*</span><span style>err</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style>nPix</span><span style>++;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>writer</span><span style>-></span><span style>SetInput</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>GPUFilter</span><span style>-></span>GetOutput<span style>()</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,128,0)">writer->SetInput(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CPUFilter->GetOutput()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>writer</span><span style>-></span><span style="font-style:italic">Update</span><span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style>(</span><span style>nPix</span><span style="color:rgb(192,192,192)"> </span><span style>></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style>)</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style>RMSError</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style>sqrt</span><span style>(</span><span style="color:rgb(192,192,192)"> </span><span style>diff</span><span style="color:rgb(192,192,192)"> </span><span style>/</span><span style="color:rgb(192,192,192)"> </span><span style>(</span><span style="color:rgb(128,128,0)">double</span><span style>)</span><span style>nPix</span><span style="color:rgb(192,192,192)"> </span><span style>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"RMS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Error</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style>RMSError</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">filter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">operator</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">has</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">type</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">double</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">but</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">precision</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">well-supported</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">on</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">most</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPUs</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">and</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">by</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">most</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">drivers</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">at</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">this</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">time.</span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,128,0)">Therefore,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GPU</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">filter</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">operator</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">has</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">type</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">float</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">relax</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">RMS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">threshold</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">here</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">allow</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">for</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">errors</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">due</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">differences</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">in</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">precision</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">NOTE:</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(0,128,0)">a</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">threshold</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">of</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">1.2e-5</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">worked</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">on</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">linux</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">and</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Mac,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">but</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Windows</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(0,128,0)">why?</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style>RMSThreshold</span><span style="color:rgb(192,192,192)"> </span><span style>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">1.7e-5</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style>(</span><span style>vnl_math_isnan</span><span style>(</span><span style>RMSError</span><span style>))</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"RMS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Error</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">NaN!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">nPix:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style>nPix</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">EXIT_FAILURE</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style>(</span><span style>RMSError</span><span style="color:rgb(192,192,192)"> </span><span style>></span><span style="color:rgb(192,192,192)"> </span><span style>RMSThreshold</span><span style>)</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"RMS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Error</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">exceeds</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">threshold</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">("</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style>RMSThreshold</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">")"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">EXIT_FAILURE</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">else</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>cout<span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"No</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pixels</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">in</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">output!"</span><span style="color:rgb(192,192,192)"> </span><span style><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style>::</span>endl<span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">EXIT_FAILURE</span><span style>;</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre></div><div><br></div><div>OUTPUT</div><div><br></div><div><p style="margin:0px"><br></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:10pt;font-weight:600;color:rgb(0,0,170)">Starting C:\DocsMaracuya\Build\Ejemplos\Gpu\GPUTest.exe...</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Platform  : AMD Accelerated Parallel Processing</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Platform  : AMD Accelerated Parallel Processing</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Pitcairn</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Maximum Work Item Sizes : { 256, 256, 256 }</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Maximum Work Group Size : 256</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Alignment in bits of the base address : 2048</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Smallest alignment in bytes for any data type : 128</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_atomic_counters_32 cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_d3d10_sharing cl_amd_bus_addressable_memory cl_amd_c1x_atomics </span></p>


<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">CPU Gaussian Filter took 1.70355 seconds with 8 threads.</span></p>
<p style="font-size:10pt;font-family:Courier;margin:0px"><br></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Defines: #define DIM_3</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define INTYPE short</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define OUTTYPE short</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define OPTYPE short</span></p>
<p style="font-size:10pt;font-family:Courier;margin:0px"><br></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Defines: #define DIM_3</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define INTYPE short</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define OUTTYPE short</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define OPTYPE short</span></p>
<p style="font-size:10pt;font-family:Courier;margin:0px"><br></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">Defines: #define DIM_3</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define INTYPE short</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define OUTTYPE short</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">#define OPTYPE short</span></p>
<p style="font-size:10pt;font-family:Courier;margin:0px"><br></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">GPUDiscreteGaussianImageFilter (0000000002205DF0)</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  RTTI typeinfo:   class itk::GPUDiscreteGaussianImageFilter<class itk::GPUImage<short,3>,class itk::GPUImage<short,3> ></span></p>


<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Reference Count: 1</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Modified Time: 560</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Debug: Off</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Object Name: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Observers: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    none</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Inputs: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Primary: (000000000216E560) *</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Indexed Inputs: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    0: Primary (000000000216E560)</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Required Input Names: Primary</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  NumberOfRequiredInputs: 1</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Outputs: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Primary: (000000000218A070)</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Indexed Outputs: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    0: Primary (000000000218A070)</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  NumberOfRequiredOutputs: 1</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Number Of Threads: 8</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  ReleaseDataFlag: Off</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  ReleaseDataBeforeUpdateFlag: Off</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  AbortGenerateData: Off</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Progress: 0</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Multithreader: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    RTTI typeinfo:   class itk::MultiThreader</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Reference Count: 1</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Modified Time: 499</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Debug: Off</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Object Name: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Observers: </span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">      none</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Thread Count: 8</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Global Maximum Number Of Threads: 128</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">    Global Default Number Of Threads: 8</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  CoordinateTolerance: 1e-006</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  DirectionTolerance: 1e-006</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  Variance: [4, 4, 4]</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  MaximumError: [0.01, 0.01, 0.01]</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  MaximumKernelWidth: 10</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  FilterDimensionality: 3</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  UseImageSpacing: 0</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  InternalNumberOfStreamDivisions: 9</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">  GPU: Enabled</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">GPU Gaussian Filter took 0.111351 seconds.</span></p>
<p style="font-size:10pt;font-family:Courier;margin:0px"><br></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">RMS Error : 26.4279</span></p>
<p style="margin:0px"><span style="font-size:10pt;font-family:Courier">RMS Error exceeds threshold (1.7e-005)</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:10pt;font-weight:600;color:rgb(0,0,170)">C:\DocsMaracuya\Build\Ejemplos\Gpu\GPUTest.exe exited with code 1</span></p></div><div><br></div><div><br>-- <br>José Ignacio Prieto<br>

celular(nuevo): 94348182
</div></div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_____________________________________</span><br><span>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a></span><br><span></span><br>
<span>Visit other Kitware open-source projects at</span><br><span><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a></span><br><span></span><br>
<span>Kitware offers ITK Training Courses, for more information visit:</span><br><span><a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a></span><br>
<span></span><br><span>Please keep messages on-topic and check the ITK FAQ at:</span><br><span><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br>
<span><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a></span><br></div></blockquote></div></blockquote></div><br><br clear="all"><div><br></div>
-- <br>José Ignacio Prieto<br>celular(nuevo): 94348182
</div>