<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      try to add reader-&gt;Update() after reader-&gt;SetFileName().
      Otherwise you don't know whether your image could successfully be
      read.<br>
      <br>
      Christina Rossmanith<br>
      --<br>
      <span
style="font-size:10pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"
        lang="EN-GB">Dept. of Neurology</span> <br>
      <span
style="font-size:10pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"
        lang="EN-GB">University Medical Center Mannheim</span><br>
      <br>
      Am 21.08.2012 10:59, schrieb D, Yamini:<br>
    </div>
    <blockquote
cite="mid:3F77CD4DD85BA545A968CC371FC60B18013348DA@011-DB3MPN2-112.MGDPHG.emi.philips.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Consolas}
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}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
        {}
-->
</style>
      <div class="WordSection1">
        <p class="MsoNormal">Hi,</p>
        <p class="MsoNormal">I am trying to run a program for erosion,
          after building the project, I run the same in cmd window. I
          find its failing at &#8220; writer-&gt; update();&#8221; &nbsp;line.</p>
        <p class="MsoNormal">The following is the code and the error
          displayed .</p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">#include</span><span
            style="font-size:9.5pt; font-family:Consolas">
            <span style="color:#A31515">"stdafx.h"</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">#include</span><span
            style="font-size:9.5pt; font-family:Consolas">
            <span style="color:#A31515">"itkImage.h"</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">#include</span><span
            style="font-size:9.5pt; font-family:Consolas">
            <span style="color:#A31515">"itkImageFileReader.h"</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">#include</span><span
            style="font-size:9.5pt; font-family:Consolas">
            <span style="color:#A31515">"itkImageFileWriter.h"</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">#include</span><span
            style="font-size:9.5pt; font-family:Consolas">
            <span style="color:#A31515">"itkBinaryErodeImageFilter.h"</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">#include</span><span
            style="font-size:9.5pt; font-family:Consolas">
            <span style="color:#A31515">"itkBinaryBallStructuringElement.h"</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas; color:blue">int</span><span
            style="font-size:9.5pt; font-family:Consolas"> main(
            <span style="color:blue">int</span> argc, <span
              style="color:blue">char</span>* argv[] )</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">{</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">if</span>( argc &lt; 4 )</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; {</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; std::cerr
            &lt;&lt;
            <span style="color:#A31515">"Usage: "</span> &lt;&lt;
            std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; std::cerr
            &lt;&lt; argv[0] &lt;&lt;
            <span style="color:#A31515">" inputImage outputImage radius"</span>;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; std::cerr
            &lt;&lt; std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;
            <span style="color:blue">return</span> EXIT_FAILURE;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; }</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">typedef</span> <span
              style="color:blue">unsigned</span> <span
              style="color:blue">
              char</span> PixelType;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">const</span> <span
              style="color:blue">unsigned</span> <span
              style="color:blue">
              int</span> Dimension = 2;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">typedef</span> itk::Image&lt;
            PixelType, Dimension &gt;&nbsp;&nbsp;&nbsp; ImageType;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">typedef</span>
            itk::ImageFileReader&lt; ImageType &gt;&nbsp;&nbsp;&nbsp;&nbsp; ReaderType;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            ReaderType::Pointer reader = ReaderType::New();</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            reader-&gt;SetFileName( argv[1] );</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            std::cout&lt;&lt;<span style="color:#A31515">"reader passed"</span>&lt;&lt;std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">typedef</span>
            itk::BinaryBallStructuringElement&lt; PixelType, Dimension
            &gt;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;
            StructuringElementType;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            StructuringElementType structuringElement;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            structuringElement.SetRadius( atoi( argv[3] ) );</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            structuringElement.CreateStructuringElement();</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">typedef</span>
            itk::BinaryErodeImageFilter&lt; ImageType, ImageType,</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;
            StructuringElementType &gt; BinaryErodeImageFilterType;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            BinaryErodeImageFilterType::Pointer dilateFilter =</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;
            BinaryErodeImageFilterType::New();</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            dilateFilter-&gt;SetInput( reader-&gt;GetOutput() );</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            dilateFilter-&gt;SetKernel( structuringElement );</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            std::cout&lt;&lt;<span style="color:#A31515">"filter passed"</span>&lt;&lt;std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">typedef</span>
            itk::ImageFileWriter&lt; ImageType &gt; WriterType;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            WriterType::Pointer writer = WriterType::New();</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            writer-&gt;SetInput( dilateFilter-&gt;GetOutput() );</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            writer-&gt;SetFileName( argv[2] );</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            std::cout&lt;&lt;<span style="color:#A31515">"writer passed"</span>&lt;&lt;std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">try</span></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; {</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;
            writer-&gt;Update();</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            std::cout&lt;&lt;<span style="color:#A31515">"writer update
              passed"</span>&lt;&lt;std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; }</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">catch</span>( itk::ExceptionObject
            )</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; {</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; std::cerr
            &lt;&lt;
            <span style="color:#A31515">"Error: "</span> &lt;&lt;
            std::endl;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp;
            <span style="color:blue">return</span> EXIT_FAILURE;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;&nbsp;&nbsp; }</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">&nbsp;
            <span style="color:blue">return</span> EXIT_SUCCESS;</span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt; font-family:Consolas">}</span></p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal">"C:\Users\Documents\Visual Studio
          2010\Projects\myNew\Debug\Yam.exe" d:\gray.jpg &nbsp;d:\output.jpg
          &nbsp;2</p>
        <p class="MsoNormal">reader passed</p>
        <p class="MsoNormal">filter passed</p>
        <p class="MsoNormal">writer passed</p>
        <p class="MsoNormal">Error:</p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal">&nbsp;</p>
        <p class="MsoNormal">Thank you,</p>
        <p class="MsoNormal">Yamini.D</p>
        <p class="MsoNormal">&nbsp;</p>
      </div>
      <br>
      <hr>
      <font color="Gray" face="Arial" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a>

Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>