<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Ashef,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">have you looked at this <a href="https://itk.org/ITKExamples/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/Documentation.html">example</a>? If not, try it. Otherwise re-post this question on the <a href="https://discourse.itk.org/">forum</a>. There was already a similar <a href="https://discourse.itk.org/t/overlay-several-labels-on-top-of-an-image/1096">question</a>.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 12, 2018 at 10:53 AM Ashef Shahrior <<a href="mailto:ashahrior.91994@gmail.com">ashahrior.91994@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have followed the itk guide and implemented those segmentation methods. Using fast marching segmentation, I am getting this in the fourth box. I have used itk for segmentation and vtk for visualization with C++.<div><div><img src="cid:ii_jjio12n71" alt="image.png" width="345" height="452"><br></div>But what I actually want is something like this - </div><div><div><img src="cid:ii_jjio30cp2" alt="image.png" width="324" height="390"><br></div>I want to show the segmented portion right on top of the main image but with a different color to distinguish it. How can I do that?</div><div><br></div><div>This is my code:-</div><div><br></div><div><a href="https://paste.ubuntu.com/p/BRMrhys5J8/" target="_blank">https://paste.ubuntu.com/p/BRMrhys5J8/</a><br></div><div><br></div><div>
<pre style="color:rgb(0,0,0);text-decoration-style:initial;text-decoration-color:initial"><span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "iostream"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "string.h"</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">using</span> <span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">namespace</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkCurvatureAnisotropicDiffusionImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkSigmoidImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkFastMarchingImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkBinaryThresholdImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkImageFileReader.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkImageFileWriter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkRescaleIntensityImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "QuickView.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkCastImageFilter.h"</span>
<span class="m_-7413376260028793897gmail-cp" style="color:rgb(0,136,0)">#include "itkGDCMImageIO.h"</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">inputFile</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">iseedX</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">iseedY</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">isigma</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">isigmoidAlpha</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">isigmoidBeta</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">itimeThreshold</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">istoppingValue</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">inputType</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">outputImage</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">smoothingOutputImage</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">gradientMagnitudeOutputImage</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">],</span> <span class="m_-7413376260028793897gmail-n">sigmoidOutputImage</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">void</span> <span class="m_-7413376260028793897gmail-n">takeInput</span><span class="m_-7413376260028793897gmail-p">()</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter file path: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">inputFile</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter seed in X position: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">iseedX</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter seed in Y position: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">iseedY</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter Sigma value: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">isigma</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter SigmoidAlpha value: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">isigmoidAlpha</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter SigmoidBeta value: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">isigmoidBeta</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter time-threshold value: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">itimeThreshold</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter stopping value: "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">istoppingValue</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">" Enter input file type '-IMAGE'/'-DICOM' : "</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">cin</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>></span><span class="m_-7413376260028793897gmail-n">inputType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">void</span> <span class="m_-7413376260028793897gmail-n">getFileName</span><span class="m_-7413376260028793897gmail-p">()</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="m_-7413376260028793897gmail-n">l</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">strlen</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">inputFile</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="m_-7413376260028793897gmail-n">x</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">for</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="m_-7413376260028793897gmail-n">i</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">l</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">>-</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">--</span><span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">if</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">inputFile</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-p">]</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">==</span><span class="m_-7413376260028793897gmail-sc" style="color:rgb(187,68,68)">'\\'</span><span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">break</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-n">x</span><span class="m_-7413376260028793897gmail-p">]</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">inputFile</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">x</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">++</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-n">strrev</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">void</span> <span class="m_-7413376260028793897gmail-n">fastMarchingSegmentation</span><span class="m_-7413376260028793897gmail-p">()</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">takeInput</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">getFileName</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">exception</span> <span class="m_-7413376260028793897gmail-n">e</span><span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">cout</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span><span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Exception occurred in taking input"</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">float</span> <span class="m_-7413376260028793897gmail-n">InternalPixelType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">unsigned</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="m_-7413376260028793897gmail-n">Dimension</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">2</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Image</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">InternalPixelType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">Dimension</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">unsigned</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">OutputPixelType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Image</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">OutputPixelType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">Dimension</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">OutputImageType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">BinaryThresholdImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">OutputImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">ThresholdingFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">ThresholdingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">thresholder</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">ThresholdingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">CastImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">OutputImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">CastingFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">CastingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">caster</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">CastingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-n">InternalPixelType</span> <span class="m_-7413376260028793897gmail-n">timeThreshold</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atof</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">itimeThreshold</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">thresholder</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetLowerThreshold</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mf" style="color:rgb(102,102,102)">0.0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">thresholder</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetUpperThreshold</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">timeThreshold</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">thresholder</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutsideValue</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">thresholder</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInsideValue</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">GDCMImageIO</span> <span class="m_-7413376260028793897gmail-n">ImageIOType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">ImageIOType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">gdcmImageIO</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">ImageIOType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ImageFileReader</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">ReaderType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ImageFileWriter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">OutputImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">ReaderType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">reader</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">ReaderType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">writer</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">reader</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetFileName</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">inputFile</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//outputImage = "Fast Marching Segmented ";// +inputFile;</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">outputImage</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Fast_Marching_Segmented_"</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">strcat</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">outputImage</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetFileName</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">outputImage</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">for</span> <span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="m_-7413376260028793897gmail-n">i</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-n">inputType</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-p">]</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">!=</span> <span class="m_-7413376260028793897gmail-sc" style="color:rgb(187,68,68)">'\0'</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">++</span><span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-n">inputType</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-p">]</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">toupper</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">inputType</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-n">i</span><span class="m_-7413376260028793897gmail-p">]);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">if</span> <span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">strcmp</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">inputType</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"-DICOM"</span><span class="m_-7413376260028793897gmail-p">)</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">==</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span><span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">reader</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetImageIO</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">gdcmImageIO</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">reader</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span> <span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ExceptionObject</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">&</span> <span class="m_-7413376260028793897gmail-n">e</span><span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"exception in file reader "</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">e</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">// EXIT_FAILURE;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">RescaleIntensityImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span><span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">OutputImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">CurvatureAnisotropicDiffusionImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span>
<span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span>
<span class="m_-7413376260028793897gmail-n">InternalImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">SmoothingFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">SmoothingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">smoothing</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">SmoothingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">GradientMagnitudeRecursiveGaussianImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span><span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">GradientFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">SigmoidImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span><span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">SigmoidFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">GradientFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">gradientMagnitude</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">GradientFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">SigmoidFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">sigmoid</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">SigmoidFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMinimum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mf" style="color:rgb(102,102,102)">0.0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMaximum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mf" style="color:rgb(102,102,102)">1.0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">FastMarchingImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-n">InternalImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">FastMarchingFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">FastMarchingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">fastMarching</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">FastMarchingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">smoothing</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">reader</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">gradientMagnitude</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">smoothing</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">gradientMagnitude</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">fastMarching</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">thresholder</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">fastMarching</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//caster->SetInput( thresholder->GetOutput() );</span>
<span class="m_-7413376260028793897gmail-n">writer</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">thresholder</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">());</span>
<span class="m_-7413376260028793897gmail-n">smoothing</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetTimeStep</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mf" style="color:rgb(102,102,102)">0.125</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">smoothing</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetNumberOfIterations</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">5</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">smoothing</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetConductanceParameter</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mf" style="color:rgb(102,102,102)">9.0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="m_-7413376260028793897gmail-n">sigma</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atof</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">isigma</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">gradientMagnitude</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetSigma</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">sigma</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="m_-7413376260028793897gmail-n">alpha</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atof</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">isigmoidAlpha</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="m_-7413376260028793897gmail-n">beta</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atof</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">isigmoidBeta</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetAlpha</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">alpha</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetBeta</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">beta</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">FastMarchingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">NodeContainer</span> <span class="m_-7413376260028793897gmail-n">NodeContainer</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">FastMarchingFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">NodeType</span> <span class="m_-7413376260028793897gmail-n">NodeType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">NodeContainer</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">seeds</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">NodeContainer</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">InternalImageType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">IndexType</span> <span class="m_-7413376260028793897gmail-n">seedPosition</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">seedPosition</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span><span class="m_-7413376260028793897gmail-p">]</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atoi</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">iseedX</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">seedPosition</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1</span><span class="m_-7413376260028793897gmail-p">]</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atoi</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">iseedY</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">NodeType</span> <span class="m_-7413376260028793897gmail-n">node</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="m_-7413376260028793897gmail-n">seedValue</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-mf" style="color:rgb(102,102,102)">0.0</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">node</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">SetValue</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">seedValue</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">node</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">SetIndex</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">seedPosition</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">seeds</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Initialize</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">seeds</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">InsertElement</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">node</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">fastMarching</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetTrialPoints</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">seeds</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Image</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span><span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">unsigned</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">ImageType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">ImageType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">image</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">QuickView</span> <span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">RescaleIntensityImageFilter</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><</span> <span class="m_-7413376260028793897gmail-n">ImageType</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">ImageType</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">></span> <span class="m_-7413376260028793897gmail-n">RescaleFilterType</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">RescaleFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">caster1</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">RescaleFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">writer1</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">caster</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">smoothing</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">image</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">caster</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">caster1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">image</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">caster1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer1->SetFileName("Smoothing Output Image "+inputFile);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Smoothing_Output_Image_"</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">strcat</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetFileName</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMinimum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMaximum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">writer1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//QuickView viewer;</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//viewer.AddImage(image.GetPointer());</span>
<span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">AddImage</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">caster1</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">());</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ExceptionObject</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">&</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught in the kahini one !"</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">// EXIT_FAILURE;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">caster2</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">writer2</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">caster2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">gradientMagnitude</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">caster2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer2->SetFileName("Gradient Magnitude Output Image "+inputFile);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Gradient_Magnitude_Output_Image_"</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">strcat</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetFileName</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMinimum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMaximum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">image</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">caster2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-cm" style="color:rgb(0,136,0);font-style:italic">/*</span>
<span class="m_-7413376260028793897gmail-cm" style="color:rgb(0,136,0);font-style:italic"> QuickView viewer;</span>
<span class="m_-7413376260028793897gmail-cm" style="color:rgb(0,136,0);font-style:italic"> viewer.AddImage(image.GetPointer());*/</span>
<span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">AddImage</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">caster2</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">());</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ExceptionObject</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">&</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught !"</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">caster3</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">writer3</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">caster3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">sigmoid</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">caster3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer3->SetFileName("Sigmoid Output Image"+inputFile);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Sigmoid_Output_Image_"</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">strcat</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetFileName</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMinimum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMaximum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//image = caster3->GetOutput();</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//QuickView viewer;</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//viewer.AddImage(image.GetPointer());</span>
<span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">AddImage</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">caster3</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">());</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//viewer.Visualize();</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ExceptionObject</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">&</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught !"</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-n">fastMarching</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputSize</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">reader</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetBufferedRegion</span><span class="m_-7413376260028793897gmail-p">().</span><span class="m_-7413376260028793897gmail-n">GetSize</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="m_-7413376260028793897gmail-n">stoppingTime</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">atof</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">istoppingValue</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">fastMarching</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetStoppingValue</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">stoppingTime</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">writer</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ExceptionObject</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">&</span> <span class="m_-7413376260028793897gmail-n">excep</span> <span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Exception caught !"</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">excep</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">caster4</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">CastFilterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">Pointer</span> <span class="m_-7413376260028793897gmail-n">writer4</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">=</span> <span class="m_-7413376260028793897gmail-n">WriterType</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">New</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">caster4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">fastMarching</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetInput</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">caster4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">()</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer4->SetFileName("Fast Marching Filter Output " + inputFile);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">100</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"Fast_Marching_Filter_Output_"</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">[</span><span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="m_-7413376260028793897gmail-p">];</span>
<span class="m_-7413376260028793897gmail-n">strcpy</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">,</span><span class="m_-7413376260028793897gmail-n">inputName</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">strcat</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">,</span> <span class="m_-7413376260028793897gmail-n">tmp</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetFileName</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">t1</span><span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMinimum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">caster4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">SetOutputMaximum</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="m_-7413376260028793897gmail-p">);</span>
<span class="m_-7413376260028793897gmail-n">writer4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">Update</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">AddImage</span><span class="m_-7413376260028793897gmail-p">(</span><span class="m_-7413376260028793897gmail-n">caster4</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">-></span><span class="m_-7413376260028793897gmail-n">GetOutput</span><span class="m_-7413376260028793897gmail-p">());</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="m_-7413376260028793897gmail-p">(</span> <span class="m_-7413376260028793897gmail-n">itk</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">ExceptionObject</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">&</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-p">)</span>
<span class="m_-7413376260028793897gmail-p">{</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught !"</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">cerr</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">err</span> <span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="m_-7413376260028793897gmail-n">std</span><span class="m_-7413376260028793897gmail-o" style="color:rgb(102,102,102)">::</span><span class="m_-7413376260028793897gmail-n">endl</span><span class="m_-7413376260028793897gmail-p">;</span>
<span class="m_-7413376260028793897gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="m_-7413376260028793897gmail-p">;</span> <span class="m_-7413376260028793897gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
<span class="m_-7413376260028793897gmail-p">}</span>
<span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">ShareCameraOff</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-n">viewer</span><span class="m_-7413376260028793897gmail-p">.</span><span class="m_-7413376260028793897gmail-n">Visualize</span><span class="m_-7413376260028793897gmail-p">();</span>
<span class="m_-7413376260028793897gmail-p">}</span></pre> <br></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>