<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/">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="gmail-cp" style="color:rgb(0,136,0)">#include "iostream"</span>
<span class="gmail-cp" style="color:rgb(0,136,0)">#include "string.h"</span>
<span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">using</span> <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">namespace</span> <span class="gmail-n">std</span><span class="gmail-p">;</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkCurvatureAnisotropicDiffusionImageFilter.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"</span>
<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkSigmoidImageFilter.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkFastMarchingImageFilter.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkBinaryThresholdImageFilter.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkImageFileReader.h"</span>
<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkImageFileWriter.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkRescaleIntensityImageFilter.h"</span>
<span class="gmail-cp" style="color:rgb(0,136,0)">#include "QuickView.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkCastImageFilter.h"</span>

<span class="gmail-cp" style="color:rgb(0,136,0)">#include "itkGDCMImageIO.h"</span>

<span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">inputFile</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">],</span> <span class="gmail-n">iseedX</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">iseedY</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">isigma</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">isigmoidAlpha</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">isigmoidBeta</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">itimeThreshold</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">istoppingValue</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">],</span> <span class="gmail-n">inputType</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">];</span>
<span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">inputName</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">],</span> <span class="gmail-n">outputImage</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">],</span> <span class="gmail-n">smoothingOutputImage</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">],</span> <span class="gmail-n">gradientMagnitudeOutputImage</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">],</span> <span class="gmail-n">sigmoidOutputImage</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">];</span>

<span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">void</span> <span class="gmail-n">takeInput</span><span class="gmail-p">()</span>
<span class="gmail-p">{</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter file path: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">inputFile</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter seed in X position: "</span><span class="gmail-p">;</span>
        <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">iseedX</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter seed in Y position: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">iseedY</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter Sigma value: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">isigma</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter SigmoidAlpha value: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">isigmoidAlpha</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter SigmoidBeta value: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">isigmoidBeta</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter time-threshold value: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">itimeThreshold</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter stopping value: "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">istoppingValue</span><span class="gmail-p">;</span>
    <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">" Enter input file type '-IMAGE'/'-DICOM' : "</span><span class="gmail-p">;</span>
    <span class="gmail-n">cin</span><span class="gmail-o" style="color:rgb(102,102,102)">>></span><span class="gmail-n">inputType</span><span class="gmail-p">;</span>
<span class="gmail-p">}</span>

<span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">void</span> <span class="gmail-n">getFileName</span><span class="gmail-p">()</span>
<span class="gmail-p">{</span>
    <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="gmail-n">l</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">strlen</span><span class="gmail-p">(</span><span class="gmail-n">inputFile</span><span class="gmail-p">);</span>
    <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="gmail-n">x</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-mi" style="color:rgb(102,102,102)">0</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">for</span><span class="gmail-p">(</span><span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="gmail-n">i</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">l</span><span class="gmail-o" style="color:rgb(102,102,102)">-</span><span class="gmail-mi" style="color:rgb(102,102,102)">1</span><span class="gmail-p">;</span> <span class="gmail-n">i</span><span class="gmail-o" style="color:rgb(102,102,102)">>-</span><span class="gmail-mi" style="color:rgb(102,102,102)">1</span><span class="gmail-p">;</span> <span class="gmail-n">i</span><span class="gmail-o" style="color:rgb(102,102,102)">--</span><span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">if</span><span class="gmail-p">(</span><span class="gmail-n">inputFile</span><span class="gmail-p">[</span><span class="gmail-n">i</span><span class="gmail-p">]</span><span class="gmail-o" style="color:rgb(102,102,102)">==</span><span class="gmail-sc" style="color:rgb(187,68,68)">'\\'</span><span class="gmail-p">)</span>
            <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">break</span><span class="gmail-p">;</span>
        <span class="gmail-n">inputName</span><span class="gmail-p">[</span><span class="gmail-n">x</span><span class="gmail-p">]</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">inputFile</span><span class="gmail-p">[</span><span class="gmail-n">i</span><span class="gmail-p">];</span>
        <span class="gmail-n">x</span><span class="gmail-o" style="color:rgb(102,102,102)">++</span><span class="gmail-p">;</span>
    <span class="gmail-p">}</span>
    <span class="gmail-n">strrev</span><span class="gmail-p">(</span><span class="gmail-n">inputName</span><span class="gmail-p">);</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span>
<span class="gmail-p">}</span>


<span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">void</span> <span class="gmail-n">fastMarchingSegmentation</span><span class="gmail-p">()</span>
<span class="gmail-p">{</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">takeInput</span><span class="gmail-p">();</span>
        <span class="gmail-n">getFileName</span><span class="gmail-p">();</span>
    <span class="gmail-p">}</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="gmail-p">(</span><span class="gmail-n">exception</span> <span class="gmail-n">e</span><span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">cout</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span><span class="gmail-s" style="color:rgb(187,68,68)">"Exception occurred in taking input"</span><span class="gmail-o" style="color:rgb(102,102,102)"><<</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
    <span class="gmail-p">}</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>   <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">float</span>           <span class="gmail-n">InternalPixelType</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span>     <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">unsigned</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span>    <span class="gmail-n">Dimension</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-mi" style="color:rgb(102,102,102)">2</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Image</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">InternalPixelType</span><span class="gmail-p">,</span> <span class="gmail-n">Dimension</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span>  <span class="gmail-n">InternalImageType</span><span class="gmail-p">;</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">unsigned</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span>                            <span class="gmail-n">OutputPixelType</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Image</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">OutputPixelType</span><span class="gmail-p">,</span> <span class="gmail-n">Dimension</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span> <span class="gmail-n">OutputImageType</span><span class="gmail-p">;</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">BinaryThresholdImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span> <span class="gmail-n">OutputImageType</span>    <span class="gmail-o" style="color:rgb(102,102,102)">></span>    <span class="gmail-n">ThresholdingFilterType</span><span class="gmail-p">;</span>
    <span class="gmail-n">ThresholdingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">thresholder</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">ThresholdingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">CastImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span> <span class="gmail-n">OutputImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span> <span class="gmail-n">CastingFilterType</span><span class="gmail-p">;</span>
    <span class="gmail-n">CastingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">caster</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">CastingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="gmail-n">InternalPixelType</span>  <span class="gmail-n">timeThreshold</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">atof</span><span class="gmail-p">(</span> <span class="gmail-n">itimeThreshold</span> <span class="gmail-p">);</span>

    <span class="gmail-n">thresholder</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetLowerThreshold</span><span class="gmail-p">(</span>  <span class="gmail-mf" style="color:rgb(102,102,102)">0.0</span>  <span class="gmail-p">);</span>
    <span class="gmail-n">thresholder</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetUpperThreshold</span><span class="gmail-p">(</span> <span class="gmail-n">timeThreshold</span>  <span class="gmail-p">);</span>

    <span class="gmail-n">thresholder</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutsideValue</span><span class="gmail-p">(</span>  <span class="gmail-mi" style="color:rgb(102,102,102)">0</span>  <span class="gmail-p">);</span>
    <span class="gmail-n">thresholder</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInsideValue</span><span class="gmail-p">(</span>  <span class="gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="gmail-p">);</span>

        <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">GDCMImageIO</span>           <span class="gmail-n">ImageIOType</span><span class="gmail-p">;</span>
        <span class="gmail-n">ImageIOType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">gdcmImageIO</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">ImageIOType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>  <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ImageFileReader</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">InternalImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span> <span class="gmail-n">ReaderType</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>  <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ImageFileWriter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span>  <span class="gmail-n">OutputImageType</span>  <span class="gmail-o" style="color:rgb(102,102,102)">></span> <span class="gmail-n">WriterType</span><span class="gmail-p">;</span>

    <span class="gmail-n">ReaderType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">reader</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">ReaderType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
    <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">writer</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-n">reader</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetFileName</span><span class="gmail-p">(</span> <span class="gmail-n">inputFile</span> <span class="gmail-p">);</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//outputImage = "Fast Marching Segmented ";// +inputFile;</span>
        <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">outputImage</span><span class="gmail-p">,</span> <span class="gmail-s" style="color:rgb(187,68,68)">"Fast_Marching_Segmented_"</span><span class="gmail-p">);</span>
        <span class="gmail-n">strcat</span><span class="gmail-p">(</span><span class="gmail-n">outputImage</span><span class="gmail-p">,</span> <span class="gmail-n">inputName</span><span class="gmail-p">);</span>
    <span class="gmail-n">writer</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetFileName</span><span class="gmail-p">(</span> <span class="gmail-n">outputImage</span> <span class="gmail-p">);</span>


        <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">for</span> <span class="gmail-p">(</span><span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">int</span> <span class="gmail-n">i</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-mi" style="color:rgb(102,102,102)">0</span><span class="gmail-p">;</span> <span class="gmail-n">inputType</span><span class="gmail-p">[</span><span class="gmail-n">i</span><span class="gmail-p">]</span> <span class="gmail-o" style="color:rgb(102,102,102)">!=</span> <span class="gmail-sc" style="color:rgb(187,68,68)">'\0'</span><span class="gmail-p">;</span> <span class="gmail-n">i</span><span class="gmail-o" style="color:rgb(102,102,102)">++</span><span class="gmail-p">)</span>
                <span class="gmail-n">inputType</span><span class="gmail-p">[</span><span class="gmail-n">i</span><span class="gmail-p">]</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">toupper</span><span class="gmail-p">(</span><span class="gmail-n">inputType</span><span class="gmail-p">[</span><span class="gmail-n">i</span><span class="gmail-p">]);</span>

        <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">if</span> <span class="gmail-p">(</span><span class="gmail-n">strcmp</span><span class="gmail-p">(</span><span class="gmail-n">inputType</span><span class="gmail-p">,</span><span class="gmail-s" style="color:rgb(187,68,68)">"-DICOM"</span><span class="gmail-p">)</span><span class="gmail-o" style="color:rgb(102,102,102)">==</span><span class="gmail-mi" style="color:rgb(102,102,102)">0</span><span class="gmail-p">)</span>
        <span class="gmail-p">{</span>
                <span class="gmail-n">reader</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetImageIO</span><span class="gmail-p">(</span><span class="gmail-n">gdcmImageIO</span><span class="gmail-p">);</span>
        <span class="gmail-p">}</span>
        <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
        <span class="gmail-p">{</span>
                <span class="gmail-n">reader</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>
        <span class="gmail-p">}</span>
        <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span> <span class="gmail-p">(</span><span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ExceptionObject</span> <span class="gmail-o" style="color:rgb(102,102,102)">&</span> <span class="gmail-n">e</span><span class="gmail-p">)</span>
        <span class="gmail-p">{</span>
                <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">"exception in file reader "</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">e</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span> <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">// EXIT_FAILURE;</span>
        <span class="gmail-p">}</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">RescaleIntensityImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span><span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span> <span class="gmail-n">OutputImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span>   <span class="gmail-n">CastFilterType</span><span class="gmail-p">;</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>   <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">CurvatureAnisotropicDiffusionImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span>
    <span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span>
    <span class="gmail-n">InternalImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span>  <span class="gmail-n">SmoothingFilterType</span><span class="gmail-p">;</span>

    <span class="gmail-n">SmoothingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">smoothing</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">SmoothingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>   <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">GradientMagnitudeRecursiveGaussianImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span><span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span> <span class="gmail-n">InternalImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span>  <span class="gmail-n">GradientFilterType</span><span class="gmail-p">;</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>   <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">SigmoidImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span><span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span> <span class="gmail-n">InternalImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span>  <span class="gmail-n">SigmoidFilterType</span><span class="gmail-p">;</span>

    <span class="gmail-n">GradientFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span>  <span class="gmail-n">gradientMagnitude</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">GradientFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
    <span class="gmail-n">SigmoidFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">sigmoid</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">SigmoidFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMinimum</span><span class="gmail-p">(</span>  <span class="gmail-mf" style="color:rgb(102,102,102)">0.0</span>  <span class="gmail-p">);</span>
    <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMaximum</span><span class="gmail-p">(</span>  <span class="gmail-mf" style="color:rgb(102,102,102)">1.0</span>  <span class="gmail-p">);</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span>  <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">FastMarchingImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">InternalImageType</span><span class="gmail-p">,</span><span class="gmail-n">InternalImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span>    <span class="gmail-n">FastMarchingFilterType</span><span class="gmail-p">;</span>

    <span class="gmail-n">FastMarchingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span>  <span class="gmail-n">fastMarching</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">FastMarchingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-n">smoothing</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">reader</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
    <span class="gmail-n">gradientMagnitude</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">smoothing</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
    <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">gradientMagnitude</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
    <span class="gmail-n">fastMarching</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
    <span class="gmail-n">thresholder</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">fastMarching</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
    <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//caster->SetInput( thresholder->GetOutput() );</span>
    <span class="gmail-n">writer</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span><span class="gmail-n">thresholder</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">());</span>

    <span class="gmail-n">smoothing</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetTimeStep</span><span class="gmail-p">(</span> <span class="gmail-mf" style="color:rgb(102,102,102)">0.125</span> <span class="gmail-p">);</span>
    <span class="gmail-n">smoothing</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetNumberOfIterations</span><span class="gmail-p">(</span>  <span class="gmail-mi" style="color:rgb(102,102,102)">5</span> <span class="gmail-p">);</span>
    <span class="gmail-n">smoothing</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetConductanceParameter</span><span class="gmail-p">(</span> <span class="gmail-mf" style="color:rgb(102,102,102)">9.0</span> <span class="gmail-p">);</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="gmail-n">sigma</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">atof</span><span class="gmail-p">(</span> <span class="gmail-n">isigma</span> <span class="gmail-p">);</span>

    <span class="gmail-n">gradientMagnitude</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetSigma</span><span class="gmail-p">(</span>  <span class="gmail-n">sigma</span>  <span class="gmail-p">);</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="gmail-n">alpha</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span>  <span class="gmail-n">atof</span><span class="gmail-p">(</span> <span class="gmail-n">isigmoidAlpha</span> <span class="gmail-p">);</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="gmail-n">beta</span>  <span class="gmail-o" style="color:rgb(102,102,102)">=</span>  <span class="gmail-n">atof</span><span class="gmail-p">(</span> <span class="gmail-n">isigmoidBeta</span> <span class="gmail-p">);</span>

    <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetAlpha</span><span class="gmail-p">(</span> <span class="gmail-n">alpha</span> <span class="gmail-p">);</span>
    <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetBeta</span><span class="gmail-p">(</span>  <span class="gmail-n">beta</span>  <span class="gmail-p">);</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">FastMarchingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">NodeContainer</span>           <span class="gmail-n">NodeContainer</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">FastMarchingFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">NodeType</span>                <span class="gmail-n">NodeType</span><span class="gmail-p">;</span>
    <span class="gmail-n">NodeContainer</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">seeds</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">NodeContainer</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>

    <span class="gmail-n">InternalImageType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">IndexType</span>  <span class="gmail-n">seedPosition</span><span class="gmail-p">;</span>

    <span class="gmail-n">seedPosition</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">0</span><span class="gmail-p">]</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">atoi</span><span class="gmail-p">(</span> <span class="gmail-n">iseedX</span> <span class="gmail-p">);</span>
    <span class="gmail-n">seedPosition</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1</span><span class="gmail-p">]</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">atoi</span><span class="gmail-p">(</span> <span class="gmail-n">iseedY</span> <span class="gmail-p">);</span>

    <span class="gmail-n">NodeType</span> <span class="gmail-n">node</span><span class="gmail-p">;</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="gmail-n">seedValue</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-mf" style="color:rgb(102,102,102)">0.0</span><span class="gmail-p">;</span>

    <span class="gmail-n">node</span><span class="gmail-p">.</span><span class="gmail-n">SetValue</span><span class="gmail-p">(</span> <span class="gmail-n">seedValue</span> <span class="gmail-p">);</span>
    <span class="gmail-n">node</span><span class="gmail-p">.</span><span class="gmail-n">SetIndex</span><span class="gmail-p">(</span> <span class="gmail-n">seedPosition</span> <span class="gmail-p">);</span>

    <span class="gmail-n">seeds</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Initialize</span><span class="gmail-p">();</span>
    <span class="gmail-n">seeds</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">InsertElement</span><span class="gmail-p">(</span> <span class="gmail-mi" style="color:rgb(102,102,102)">0</span><span class="gmail-p">,</span> <span class="gmail-n">node</span> <span class="gmail-p">);</span>

    <span class="gmail-n">fastMarching</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetTrialPoints</span><span class="gmail-p">(</span>  <span class="gmail-n">seeds</span>  <span class="gmail-p">);</span>


    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Image</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span><span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">unsigned</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span><span class="gmail-p">,</span> <span class="gmail-mi" style="color:rgb(102,102,102)">2</span><span class="gmail-o" style="color:rgb(102,102,102)">></span>  <span class="gmail-n">ImageType</span><span class="gmail-p">;</span>
    <span class="gmail-n">ImageType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">image</span><span class="gmail-p">;</span>
        <span class="gmail-n">QuickView</span> <span class="gmail-n">viewer</span><span class="gmail-p">;</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
    <span class="gmail-p">{</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">typedef</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">RescaleIntensityImageFilter</span><span class="gmail-o" style="color:rgb(102,102,102)"><</span> <span class="gmail-n">ImageType</span><span class="gmail-p">,</span> <span class="gmail-n">ImageType</span> <span class="gmail-o" style="color:rgb(102,102,102)">></span> <span class="gmail-n">RescaleFilterType</span><span class="gmail-p">;</span>
                <span class="gmail-n">RescaleFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">caster1</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">RescaleFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">writer1</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">caster</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">smoothing</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>

        <span class="gmail-n">image</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">caster</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">();</span>

        <span class="gmail-n">caster1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">image</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">caster1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer1->SetFileName("Smoothing Output Image "+inputFile);</span>
        <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">t1</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span><span class="gmail-s" style="color:rgb(187,68,68)">"Smoothing_Output_Image_"</span> <span class="gmail-p">);</span>
                <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">tmp</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">tmp</span><span class="gmail-p">,</span><span class="gmail-n">inputName</span><span class="gmail-p">);</span>
                <span class="gmail-n">strcat</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span> <span class="gmail-n">tmp</span><span class="gmail-p">);</span>
                <span class="gmail-n">writer1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetFileName</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">);</span>
        <span class="gmail-n">caster1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMinimum</span><span class="gmail-p">(</span>   <span class="gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="gmail-p">);</span>
        <span class="gmail-n">caster1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMaximum</span><span class="gmail-p">(</span> <span class="gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="gmail-p">);</span>
        <span class="gmail-n">caster1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>
        <span class="gmail-n">writer1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//QuickView viewer;</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//viewer.AddImage(image.GetPointer());</span>
        <span class="gmail-n">viewer</span><span class="gmail-p">.</span><span class="gmail-n">AddImage</span><span class="gmail-p">(</span><span class="gmail-n">caster1</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">());</span>

    <span class="gmail-p">}</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="gmail-p">(</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ExceptionObject</span> <span class="gmail-o" style="color:rgb(102,102,102)">&</span> <span class="gmail-n">err</span> <span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught in the kahini one !"</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">err</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span> <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">// EXIT_FAILURE;</span>
    <span class="gmail-p">}</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">CastFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">caster2</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">CastFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">writer2</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">caster2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">gradientMagnitude</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">caster2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer2->SetFileName("Gradient Magnitude Output Image "+inputFile);</span>
        <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">t1</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">];</span>
        <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span><span class="gmail-s" style="color:rgb(187,68,68)">"Gradient_Magnitude_Output_Image_"</span><span class="gmail-p">);</span>
                <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">tmp</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">tmp</span><span class="gmail-p">,</span> <span class="gmail-n">inputName</span><span class="gmail-p">);</span>
                <span class="gmail-n">strcat</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span> <span class="gmail-n">tmp</span><span class="gmail-p">);</span>
                <span class="gmail-n">writer2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetFileName</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">);</span>
        <span class="gmail-n">caster2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMinimum</span><span class="gmail-p">(</span>   <span class="gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="gmail-p">);</span>
        <span class="gmail-n">caster2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMaximum</span><span class="gmail-p">(</span> <span class="gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>

                <span class="gmail-n">image</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">caster2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">();</span>

                <span class="gmail-cm" style="color:rgb(0,136,0);font-style:italic">/*</span>
<span class="gmail-cm" style="color:rgb(0,136,0);font-style:italic">          QuickView viewer;</span>
<span class="gmail-cm" style="color:rgb(0,136,0);font-style:italic">          viewer.AddImage(image.GetPointer());*/</span>
                <span class="gmail-n">viewer</span><span class="gmail-p">.</span><span class="gmail-n">AddImage</span><span class="gmail-p">(</span><span class="gmail-n">caster2</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">());</span>
    <span class="gmail-p">}</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="gmail-p">(</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ExceptionObject</span> <span class="gmail-o" style="color:rgb(102,102,102)">&</span> <span class="gmail-n">err</span> <span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught !"</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">err</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span> <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
    <span class="gmail-p">}</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">CastFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">caster3</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">CastFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">writer3</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">caster3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">sigmoid</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">caster3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer3->SetFileName("Sigmoid Output Image"+inputFile);</span>

        <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">t1</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span><span class="gmail-s" style="color:rgb(187,68,68)">"Sigmoid_Output_Image_"</span><span class="gmail-p">);</span>
                <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">tmp</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">tmp</span><span class="gmail-p">,</span><span class="gmail-n">inputName</span><span class="gmail-p">);</span>
                <span class="gmail-n">strcat</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span> <span class="gmail-n">tmp</span><span class="gmail-p">);</span>
                <span class="gmail-n">writer3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetFileName</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">);</span>
        <span class="gmail-n">caster3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMinimum</span><span class="gmail-p">(</span>   <span class="gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="gmail-p">);</span>
        <span class="gmail-n">caster3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMaximum</span><span class="gmail-p">(</span> <span class="gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>

                <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//image = caster3->GetOutput();</span>
                <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//QuickView viewer;</span>
                <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//viewer.AddImage(image.GetPointer());</span>
                <span class="gmail-n">viewer</span><span class="gmail-p">.</span><span class="gmail-n">AddImage</span><span class="gmail-p">(</span><span class="gmail-n">caster3</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">());</span>
                <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//viewer.Visualize();</span>
    <span class="gmail-p">}</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="gmail-p">(</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ExceptionObject</span> <span class="gmail-o" style="color:rgb(102,102,102)">&</span> <span class="gmail-n">err</span> <span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught !"</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">err</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span> <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
    <span class="gmail-p">}</span>

    <span class="gmail-n">fastMarching</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputSize</span><span class="gmail-p">(</span> <span class="gmail-n">reader</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetBufferedRegion</span><span class="gmail-p">().</span><span class="gmail-n">GetSize</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">const</span> <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">double</span> <span class="gmail-n">stoppingTime</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">atof</span><span class="gmail-p">(</span> <span class="gmail-n">istoppingValue</span> <span class="gmail-p">);</span>

    <span class="gmail-n">fastMarching</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetStoppingValue</span><span class="gmail-p">(</span>  <span class="gmail-n">stoppingTime</span>  <span class="gmail-p">);</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">writer</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>
    <span class="gmail-p">}</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="gmail-p">(</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ExceptionObject</span> <span class="gmail-o" style="color:rgb(102,102,102)">&</span> <span class="gmail-n">excep</span> <span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">"Exception caught !"</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">excep</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span> <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
    <span class="gmail-p">}</span>

    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">try</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">CastFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">caster4</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">CastFilterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">Pointer</span> <span class="gmail-n">writer4</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-n">WriterType</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">New</span><span class="gmail-p">();</span>
        <span class="gmail-n">caster4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">fastMarching</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetInput</span><span class="gmail-p">(</span> <span class="gmail-n">caster4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">()</span> <span class="gmail-p">);</span>
        <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//writer4->SetFileName("Fast Marching Filter Output " + inputFile);</span>
        <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">t1</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">100</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span><span class="gmail-s" style="color:rgb(187,68,68)">"Fast_Marching_Filter_Output_"</span><span class="gmail-p">);</span>
                <span class="gmail-kt" style="color:rgb(170,34,255);font-weight:bold">char</span> <span class="gmail-n">tmp</span><span class="gmail-p">[</span><span class="gmail-mi" style="color:rgb(102,102,102)">1000</span><span class="gmail-p">];</span>
                <span class="gmail-n">strcpy</span><span class="gmail-p">(</span><span class="gmail-n">tmp</span><span class="gmail-p">,</span><span class="gmail-n">inputName</span><span class="gmail-p">);</span>
                <span class="gmail-n">strcat</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">,</span> <span class="gmail-n">tmp</span><span class="gmail-p">);</span>
                <span class="gmail-n">writer4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetFileName</span><span class="gmail-p">(</span><span class="gmail-n">t1</span><span class="gmail-p">);</span>
        <span class="gmail-n">caster4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMinimum</span><span class="gmail-p">(</span>   <span class="gmail-mi" style="color:rgb(102,102,102)">0</span> <span class="gmail-p">);</span>
        <span class="gmail-n">caster4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">SetOutputMaximum</span><span class="gmail-p">(</span> <span class="gmail-mi" style="color:rgb(102,102,102)">255</span> <span class="gmail-p">);</span>
        <span class="gmail-n">writer4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">Update</span><span class="gmail-p">();</span>

                <span class="gmail-n">viewer</span><span class="gmail-p">.</span><span class="gmail-n">AddImage</span><span class="gmail-p">(</span><span class="gmail-n">caster4</span><span class="gmail-o" style="color:rgb(102,102,102)">-></span><span class="gmail-n">GetOutput</span><span class="gmail-p">());</span>

    <span class="gmail-p">}</span>
    <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">catch</span><span class="gmail-p">(</span> <span class="gmail-n">itk</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">ExceptionObject</span> <span class="gmail-o" style="color:rgb(102,102,102)">&</span> <span class="gmail-n">err</span> <span class="gmail-p">)</span>
    <span class="gmail-p">{</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-s" style="color:rgb(187,68,68)">"ExceptionObject caught !"</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
        <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">cerr</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">err</span> <span class="gmail-o" style="color:rgb(102,102,102)"><<</span> <span class="gmail-n">std</span><span class="gmail-o" style="color:rgb(102,102,102)">::</span><span class="gmail-n">endl</span><span class="gmail-p">;</span>
                <span class="gmail-k" style="color:rgb(170,34,255);font-weight:bold">return</span><span class="gmail-p">;</span> <span class="gmail-c1" style="color:rgb(0,136,0);font-style:italic">//EXIT_FAILURE;</span>
    <span class="gmail-p">}</span>
        <span class="gmail-n">viewer</span><span class="gmail-p">.</span><span class="gmail-n">ShareCameraOff</span><span class="gmail-p">();</span>
        <span class="gmail-n">viewer</span><span class="gmail-p">.</span><span class="gmail-n">Visualize</span><span class="gmail-p">();</span>
<span class="gmail-p">}</span></pre> <br></div></div>