<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; ">Hello, </div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; ">I am an amateur at ITK programming and I would like to do the following for which I have written some code looking at the ITK examples. However it is throwing an error. The details are as given below:</div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; ">Mainly the code is trying to perform a region-connected thresholding segmentation using 2D series dicom images( close to 133 dicom images in total in the series). I have written the code as below but it is throwing an error.
Could you please help as soon as possible to debug it. </div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; ">Any help is highly appreciated and needed.</div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; ">
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><font class="Apple-style-span" color="#008000"><br></font></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#if</span><span style=" color:#c0c0c0;"> </span>defined(_MSC_VER)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#pragma</span><span style=" color:#c0c0c0;"> </span>warning<span style=" color:#c0c0c0;"> </span>(<span style=" color:#c0c0c0;"> </span>disable<span style=" color:#c0c0c0;"> </span>:<span style=" color:#c0c0c0;"> </span>4786<span style=" color:#c0c0c0;"> </span>)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#endif</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#ifdef</span><span style=" color:#c0c0c0;"> </span>__BORLANDC__</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#define</span><span style=" color:#c0c0c0;"> </span>ITK_LEAN_AND_MEAN</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#endif</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><font class="Apple-style-span" color="#008000"><br></font></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkGDCMImageIO.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkGDCMSeriesFileNames.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkImageSeriesReader.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkImageSeriesWriter.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#008000;">//#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkImageFileReader.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#008000;">//#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkImageFileWriter.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkConnectedThresholdImageFilter.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkImage.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkCastImageFilter.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"itkCurvatureFlowImageFilter.h"</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><vector></span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#000080;">#include</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><itksys/SystemTools.hxx></span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span>main(<span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span>argc,<span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">char</span>*<span style=" color:#c0c0c0;"> </span>argv[]<span style=" color:#c0c0c0;"> </span>)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; ">{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">if</span>(<span style=" color:#c0c0c0;"> </span>argc<span style=" color:#c0c0c0;"> </span><<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">7</span><span style=" color:#c0c0c0;"> </span>)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"Missing</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">Parameters</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"Usage:</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">0</span>];</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">inputDicomDir</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">outputDicomDir</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">seedX</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">seedY</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">lowerThreshold</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">upperThreshold"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">return</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">As</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">a</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">second</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">step,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">define</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">image</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">type</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">to</span><span style=" color:#c0c0c0;"> </span><span style="
color:#008000;">be</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">used</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">this</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">example.</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">This</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">is</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">done</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">by</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">explicitly</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">selecting</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">a</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">pixel</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">type</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">and</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">a</span><span style=" color:#c0c0c0;"> </span><span
style=" color:#008000;">dimension.</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">Using</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">image</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">type</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">can</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">define</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">type</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">of</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">series</span><span style=" color:#c0c0c0;"> </span><span
style=" color:#008000;">reader.</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">signed</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">short</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">PixelType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">unsigned</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span>Dimension<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">3</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::Image<<span style=" color:#c0c0c0;"> </span>PixelType,<span style=" color:#c0c0c0;"> </span>Dimension<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ImageType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::ImageSeriesReader<<span style=" color:#c0c0c0;"> </span>ImageType<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ReaderType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::GDCMImageIO<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ImageIOType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::GDCMSeriesFileNames<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">NamesGeneratorType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>ImageIOType::Pointer<span style=" color:#c0c0c0;"> </span>gdcmIO<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>ImageIOType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>NamesGeneratorType::Pointer<span style=" color:#c0c0c0;"> </span>namesGenerator<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>NamesGeneratorType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>namesGenerator->SetInputDirectory(<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">1</span>]<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span>ReaderType::FileNamesContainer<span style=" color:#c0c0c0;"> </span>&<span style=" color:#c0c0c0;"> </span>filenames<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>namesGenerator->GetInputFileNames();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">unsigned</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span>numberOfFilenames<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>filenames.size();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cout<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>numberOfFilenames<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;<span style=" color:#c0c0c0;"> </span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">for</span>(<span style=" color:#808000;">unsigned</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span>fni<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span>;<span style=" color:#c0c0c0;"> </span>fni<numberOfFilenames;<span style=" color:#c0c0c0;"> </span>fni++)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cout<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"filename</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">#</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>fni<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cout<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>filenames[fni]<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">We</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">construct</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">one</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">instance</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">of</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">series</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">reader</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">object.</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">Set</span><span style=" color:#c0c0c0;">
</span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">DICOM</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">image</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">IO</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">object</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">to</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">be</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">used</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">with</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">it,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">and</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">set</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style="
color:#008000;">list</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">of</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">filenames</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">to</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">read.</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>ReaderType::Pointer<span style=" color:#c0c0c0;"> </span>reader<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>ReaderType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>reader->SetImageIO(<span style=" color:#c0c0c0;"> </span>gdcmIO<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>reader->SetFileNames(<span style=" color:#c0c0c0;"> </span>filenames<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">We</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">can</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">trigger</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">reading</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">process</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">by</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">calling</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">\code{Update()}</span><span style=" color:#c0c0c0;">
</span><span style=" color:#008000;">method</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">on</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">series</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">reader.</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">It</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">is</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">wise</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">to</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">put</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">this</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">invocation</span><span style=" color:#c0c0c0;"> </span><span
style=" color:#008000;">inside</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">a</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">\code{try/catch}</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">block</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">since</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">process</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">may</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">eventually</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">throw</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">exceptions.</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">try</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>reader->Update();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">catch</span><span style=" color:#c0c0c0;"> </span>(itk::ExceptionObject<span style=" color:#c0c0c0;"> </span>&excp)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"Exception</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">thrown</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">while</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">writing</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">image"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>excp<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">return</span><span style=" color:#c0c0c0;"> </span>EXIT_FAILURE;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">At</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">this</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">point</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">would</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">have</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">volumetric</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">data</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">loaded</span><span style=" color:#c0c0c0;"> </span><span
style=" color:#008000;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">memory</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">and</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">can</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">get</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">access</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">to</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">it</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">by</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">invoking</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">\code{GetOutput()}</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">method</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">in</span><span style=" color:#c0c0c0;">
</span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">reader.</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//Now</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">apply</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">segmentation</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">InternalPixelType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">unsigned</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">Dimension</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">2;</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::Image<<span style=" color:#c0c0c0;"> </span>InternalPixelType,<span style=" color:#c0c0c0;"> </span>Dimension<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">InternalImageType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">unsigned</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">char</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">OutputPixelType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::Image<<span style=" color:#c0c0c0;"> </span>OutputPixelType,<span style=" color:#c0c0c0;"> </span>Dimension<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">OutputImageType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::CastImageFilter<<span style=" color:#c0c0c0;"> </span>InternalImageType,<span style=" color:#c0c0c0;"> </span>OutputImageType<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">CastingFilterType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>CastingFilterType::Pointer<span style=" color:#c0c0c0;"> </span>caster<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>CastingFilterType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::CurvatureFlowImageFilter<<span style=" color:#c0c0c0;"> </span>InternalImageType,<span style=" color:#c0c0c0;"> </span>InternalImageType<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">CurvatureFlowImageFilterType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>CurvatureFlowImageFilterType::Pointer<span style=" color:#c0c0c0;"> </span>smoothing<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>CurvatureFlowImageFilterType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::ConnectedThresholdImageFilter<<span style=" color:#c0c0c0;"> </span>InternalImageType,InternalImageType<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ConnectedFilterType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>ConnectedFilterType::Pointer<span style=" color:#c0c0c0;"> </span>connectedThreshold<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>ConnectedFilterType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">Now</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">can</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">prepare</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">process</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">for</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">writing</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">dataset.</span><span style=" color:#c0c0c0;">
</span><span style=" color:#008000;">First,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">take</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">name</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">of</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">output</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">directory</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">from</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">command</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">line</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">arguments.</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">char</span><span style=" color:#c0c0c0;"> </span>*<span style=" color:#c0c0c0;"> </span>outputDirectory<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">2</span>];</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>itksys::SystemTools::MakeDirectory(<span style=" color:#c0c0c0;"> </span>outputDirectory<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//typedef</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">signed</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">short</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">OutputPixelType;</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">unsigned</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span>OutputDimension<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::Image<<span style=" color:#c0c0c0;"> </span>OutputPixelType,<span style=" color:#c0c0c0;"> </span>OutputDimension<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">Image2DType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span>itk::ImageSeriesWriter<<span style=" color:#c0c0c0;"> </span>ImageType,<span style=" color:#c0c0c0;"> </span>Image2DType<span style=" color:#c0c0c0;"> </span>><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">SeriesWriterType</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>SeriesWriterType::Pointer<span style=" color:#c0c0c0;"> </span>seriesWriter<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>SeriesWriterType::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//seriesWriter->SetInput(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">reader->GetOutput()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">);</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//seriesWriter->SetImageIO(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">gdcmIO</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">);</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>namesGenerator->SetOutputDirectory(<span style=" color:#c0c0c0;"> </span>outputDirectory<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>seriesWriter->SetFileNames(<span style=" color:#c0c0c0;"> </span>namesGenerator->GetOutputFileNames()<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>seriesWriter->SetMetaDataDictionaryArray(<span style=" color:#c0c0c0;"> </span>reader->GetMetaDataDictionaryArray()<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//smoothing->SetInput(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">reader->GetOutput()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">);</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//connectedThreshold->SetInput(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">smoothing->GetOutput()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">);</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>connectedThreshold->SetInput(<span style=" color:#c0c0c0;"> </span>reader->GetOutput()<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>caster->SetInput(<span style=" color:#c0c0c0;"> </span>connectedThreshold->GetOutput()<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//writer->SetInput(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">caster->GetOutput()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">);</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>seriesWriter->SetInput(<span style=" color:#c0c0c0;"> </span>caster->GetOutput()<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>seriesWriter->SetImageIO(<span style=" color:#c0c0c0;"> </span>gdcmIO<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>smoothing->SetNumberOfIterations(<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">5</span><span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>smoothing->SetTimeStep(<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0.125</span><span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">InternalPixelType</span><span style=" color:#c0c0c0;"> </span>lowerThreshold<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>atof(<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">5</span>]<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">InternalPixelType</span><span style=" color:#c0c0c0;"> </span>upperThreshold<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>atof(<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">6</span>]<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>connectedThreshold->SetLower(<span style=" color:#c0c0c0;"> </span>lowerThreshold<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>connectedThreshold->SetUpper(<span style=" color:#c0c0c0;"> </span>upperThreshold<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>connectedThreshold->SetReplaceValue(<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">255</span><span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>InternalImageType::IndexType<span style=" color:#c0c0c0;"> </span>index;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>index[<span style=" color:#000080;">0</span>]<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>atoi(<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">3</span>]<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>index[<span style=" color:#000080;">1</span>]<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>atoi(<span style=" color:#c0c0c0;"> </span>argv[<span style=" color:#000080;">4</span>]<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>connectedThreshold->SetSeed(<span style=" color:#c0c0c0;"> </span>index<span style=" color:#c0c0c0;"> </span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#008000;">/*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">try</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">{</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">writer->Update();</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">}</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">catch(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">itk::ExceptionObject</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">&</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">excep</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">)</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">{</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">std::cerr</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><<</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"Exception</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">caught</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">!"</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><<</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">std::endl;</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">std::cerr</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><<</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">excep</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><<</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">std::endl;</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">}</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">return</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">0;</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#008000;">}</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#008000;">*/</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">try</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>seriesWriter->Update();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">catch</span>(<span style=" color:#c0c0c0;"> </span>itk::ExceptionObject<span style=" color:#c0c0c0;"> </span>&<span style=" color:#c0c0c0;"> </span>excp<span style=" color:#c0c0c0;"> </span>)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"Exception</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">thrown</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">while</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">writing</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">series</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>std::cerr<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>excp<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>std::endl;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">return</span><span style=" color:#c0c0c0;"> </span>EXIT_FAILURE;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><font class="Apple-style-span" color="#c0c0c0"><br></font></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">return</span><span style=" color:#c0c0c0;"> </span>EXIT_SUCCESS;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; ">}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px; "></pre></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; ">The code is throwing this following error: </div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div><div><font class="Apple-style-span" face="verdana, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 13px;">error C2664: 'void itk::ImageToImageFilter<TInputImage,TOutputImage>::SetInput(const itk::Image<TPixel,VImageDimension> *)' </span></font></div><div><span class="Apple-style-span" style="font-family: verdana, helvetica, sans-serif; font-size: 13px; ">: cannot convert parameter 1 from 'itk::Image<TPixel,VImageDimension> *' to 'const itk::Image<TPixel,VImageDimension> *'</span><br></div><div><span class="Apple-style-span"
style="font-family: verdana, helvetica, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: verdana, helvetica, sans-serif; font-size: 13px; ">Can anyone please help to debug this?</span></div><div><span class="Apple-style-span" style="font-family: verdana, helvetica, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: verdana, helvetica, sans-serif; font-size: 13px; ">Any help as soon as possible is highly appreciated.</span></div><div><span class="Apple-style-span" style="font-family: verdana, helvetica, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="font-family: verdana, helvetica, sans-serif; font-size: 13px; ">Thanking you,</span></div><div><font class="Apple-style-span" face="verdana, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 13px;">debbanerje.</span></font></div><div
style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; "><br></div></div></body></html>