<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
span.PlainTextChar
        {font-family:"Calibri","sans-serif"}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
        {}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Hi,</p>
<p class="MsoPlainText">Thanks for responding. Yes reader-&gt;Update() was one thing which I tried, the actual mistake was in the CMakelist, altering it solved the problem.</p>
<p class="MsoPlainText">&nbsp;</p>
<p class="MsoPlainText">Thank you</p>
<p class="MsoPlainText"></p>
<p class="MsoPlainText">&gt;Hi,</p>
<p class="MsoPlainText">&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;try to add reader-&gt;Update() after reader-&gt;SetFileName(). Otherwise you don't know whether your image could successfully be read.</p>
<p class="MsoPlainText">&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;Christina Rossmanith</p>
<p class="MsoPlainText">&gt;--</p>
<p class="MsoPlainText">&gt;Dept. of Neurology</p>
<p class="MsoPlainText">&gt;University Medical Center Mannheim</p>
<p class="MsoPlainText">&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;Am 21.08.2012 10:59, schrieb D, Yamini:</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; Hi,</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; I am trying to run a program for erosion, after building the project,
</p>
<p class="MsoPlainText">&gt;&gt; I run the same in cmd window. I find its failing at &quot; writer-&gt;
</p>
<p class="MsoPlainText">&gt;&gt;update();&quot;&nbsp; line.</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; The following is the code and the error displayed .</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; #include&quot;stdafx.h&quot;</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; #include&quot;itkImage.h&quot;</p>
<p class="MsoPlainText">&gt;&gt; #include&quot;itkImageFileReader.h&quot;</p>
<p class="MsoPlainText">&gt;&gt; #include&quot;itkImageFileWriter.h&quot;</p>
<p class="MsoPlainText">&gt;&gt; #include&quot;itkBinaryErodeImageFilter.h&quot;</p>
<p class="MsoPlainText">&gt;&gt; #include&quot;itkBinaryBallStructuringElement.h&quot;</p>
<p class="MsoPlainText">&gt;&gt; intmain( int argc, char* argv[] )</p>
<p class="MsoPlainText">&gt;&gt; {</p>
<p class="MsoPlainText">&gt;&gt; if( argc &lt; 4 )</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; argv[0] &lt;&lt; &quot; inputImage outputImage radius&quot;;</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; std::endl;</p>
<p class="MsoPlainText">&gt;&gt; return EXIT_FAILURE;</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p class="MsoPlainText">&gt;&gt; typedef unsigned char PixelType;</p>
<p class="MsoPlainText">&gt;&gt; const unsigned int Dimension = 2;</p>
<p class="MsoPlainText">&gt;&gt; typedef itk::Image&lt; PixelType, Dimension &gt;&nbsp;&nbsp;&nbsp; ImageType;</p>
<p class="MsoPlainText">&gt;&gt; typedef itk::ImageFileReader&lt; ImageType &gt;&nbsp;&nbsp;&nbsp;&nbsp; ReaderType;</p>
<p class="MsoPlainText">&gt;&gt; ReaderType::Pointer reader = ReaderType::New();</p>
<p class="MsoPlainText">&gt;&gt; reader-&gt;SetFileName( argv[1] );</p>
<p class="MsoPlainText">&gt;&gt; std::cout&lt;&lt;&quot;reader passed&quot;&lt;&lt;std::endl;</p>
<p class="MsoPlainText">&gt;&gt; typedef itk::BinaryBallStructuringElement&lt; PixelType, Dimension &gt;</p>
<p class="MsoPlainText">&gt;&gt; StructuringElementType;</p>
<p class="MsoPlainText">&gt;&gt; StructuringElementType structuringElement;</p>
<p class="MsoPlainText">&gt;&gt; structuringElement.SetRadius( atoi( argv[3] ) );</p>
<p class="MsoPlainText">&gt;&gt; structuringElement.CreateStructuringElement();</p>
<p class="MsoPlainText">&gt;&gt; typedef itk::BinaryErodeImageFilter&lt; ImageType, ImageType,</p>
<p class="MsoPlainText">&gt;&gt; StructuringElementType &gt; BinaryErodeImageFilterType;</p>
<p class="MsoPlainText">&gt;&gt; BinaryErodeImageFilterType::Pointer dilateFilter =</p>
<p class="MsoPlainText">&gt;&gt; BinaryErodeImageFilterType::New();</p>
<p class="MsoPlainText">&gt;&gt; dilateFilter-&gt;SetInput( reader-&gt;GetOutput() );</p>
<p class="MsoPlainText">&gt;&gt; dilateFilter-&gt;SetKernel( structuringElement );</p>
<p class="MsoPlainText">&gt;&gt; std::cout&lt;&lt;&quot;filter passed&quot;&lt;&lt;std::endl;</p>
<p class="MsoPlainText">&gt;&gt; typedef itk::ImageFileWriter&lt; ImageType &gt; WriterType;</p>
<p class="MsoPlainText">&gt;&gt; WriterType::Pointer writer = WriterType::New();</p>
<p class="MsoPlainText">&gt;&gt; writer-&gt;SetInput( dilateFilter-&gt;GetOutput() );</p>
<p class="MsoPlainText">&gt;&gt; writer-&gt;SetFileName( argv[2] );</p>
<p class="MsoPlainText">&gt;&gt; std::cout&lt;&lt;&quot;writer passed&quot;&lt;&lt;std::endl;</p>
<p class="MsoPlainText">&gt;&gt; try</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p class="MsoPlainText">&gt;&gt; writer-&gt;Update();</p>
<p class="MsoPlainText">&gt;&gt; std::cout&lt;&lt;&quot;writer update passed&quot;&lt;&lt;std::endl;</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p class="MsoPlainText">&gt;&gt; catch( itk::ExceptionObject )</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Error: &quot; &lt;&lt; std::endl;</p>
<p class="MsoPlainText">&gt;&gt; return EXIT_FAILURE;</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p class="MsoPlainText">&gt;&gt; return EXIT_SUCCESS;</p>
<p class="MsoPlainText">&gt;&gt; }</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; &quot;C:\Users\Documents\Visual Studio 2010\Projects\myNew\Debug\Yam.exe&quot;
</p>
<p class="MsoPlainText">&gt;&gt; d:\gray.jpg&nbsp; d:\output.jpg&nbsp; 2</p>
<p class="MsoPlainText">&gt;&gt; reader passed</p>
<p class="MsoPlainText">&gt;&gt; filter passed</p>
<p class="MsoPlainText">&gt;&gt; writer passed</p>
<p class="MsoPlainText">&gt;&gt; Error:</p>
<p class="MsoPlainText">&gt;&gt;&nbsp;</p>
<p class="MsoPlainText">&gt;&gt; Thank you,</p>
<p class="MsoPlainText">&gt;&gt; Yamini.D</p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified
 that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.<br>
</font>
</body>
</html>