Change this line:<div><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">  if( argc &lt;4 );</span></div><div><font face="arial, sans-serif">to</font></div><div><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">  if( argc &lt;4 )</span></div>
<div><font face="arial, sans-serif"><br></font><br><div class="gmail_quote">On Tue, Sep 18, 2012 at 6:23 AM, shirani kannangara <span dir="ltr">&lt;<a href="mailto:mangalika673@gmail.com" target="_blank">mangalika673@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>Hi vtk/itk users<br><div class="gmail_quote">I am constructing a program to read and write medical image(3D) data set ,<div>
 image data(raw data -VHPAbdomen.mhd)in ITk version 4.2 ,CMake2.8.9. IT built with 2 warnings.</div>
<div> itk codes are as follows.But it does not display output properly. It is as follows.My raw data file is attached herewith.I used ImageSeriesReadWrite.cxx</div><div><b><br></b></div><div><b><br></b></div><div><b>codes</b></div>

<div><div><span style="white-space:pre-wrap">        </span>#include &quot;itkImage.h&quot;</div><div><span style="white-space:pre-wrap">        </span>#include &quot;itkImageSeriesReader.h&quot;</div><div><span style="white-space:pre-wrap">        </span>#include &quot;itkImageFileWriter.h&quot;</div>

<div><span style="white-space:pre-wrap">        </span>#include &quot;itkNumericSeriesFileNames.h&quot;</div><div><span style="white-space:pre-wrap">        </span>#include &quot;itkPNGImageIO.h&quot;</div><div>   <span style="white-space:pre-wrap">        </span>#include &lt;iostream&gt;</div>

<div>        #include &lt;string&gt;</div><div>   <span style="white-space:pre-wrap">        </span>using namespace std;</div><div>    </div><div><span style="white-space:pre-wrap">        </span></div><div> int main(  int argc, char **argv[])</div>

<div><br></div><div>{</div><div>    if( argc &lt;4 );</div><div>    </div><div>  {std::cout &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;</div><div>    std::cout&lt;&lt;argv[0] &lt;&lt;  &quot; firstSliceValue lastSliceValue  outputImageFile &quot; &lt;&lt; std::endl;</div>

<div>   return EXIT_FAILURE;</div><div>    }<span style="white-space:pre-wrap">        </span></div><div>   </div><div>  //std::cout&lt;&lt;&quot;sliceValue:&quot;&lt;&lt;std::endl;</div><div>  typedef unsigned char                       PixelType;</div>

<div>  const unsigned int<span style="white-space:pre-wrap">                                        </span>  Dimension = 3;</div><div><br></div><div>  typedef itk::Image&lt; PixelType, Dimension&gt;  ImageType;</div><div><br></div><div>  typedef itk::ImageSeriesReader&lt; ImageType &gt;  ReaderType;</div>

<div>  typedef itk::ImageFileWriter&lt;   ImageType &gt;  WriterType;</div><div><br></div><div><br></div><div>  ReaderType::Pointer reader = ReaderType::New();</div><div>  WriterType::Pointer writer = WriterType::New();</div>

<div><br></div><div>  const unsigned int first = 1;</div><div>  const unsigned int last  = 450;</div><div>  //char * outputFilename = argv[3];</div><div>   char**outputFilename=  argv[3];</div><div>  </div><div>  typedef itk::NumericSeriesFileNames NameGeneratorType;</div>

<div><br></div><div>  NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();</div><div>  </div><div>  nameGenerator-&gt;SetSeriesFormat( &quot;D:\\To_SMK\\VHPAbdomen%03d.mhd&quot; );</div><div>  nameGenerator-&gt;SetStartIndex( first );</div>

<div>  nameGenerator-&gt;SetEndIndex( last);</div><div>  nameGenerator-&gt;SetIncrementIndex(1);</div><div><br></div><div>  reader-&gt;SetImageIO( itk::PNGImageIO::New() );</div><div><br></div><div>  reader-&gt;SetFileNames( nameGenerator-&gt;GetFileNames()  );</div>

<div>  writer-&gt;SetInput( reader-&gt;GetOutput() );</div><div>  writer-&gt;SetFileName(&quot;test.mhd&quot;);</div><div>try</div><div>    {</div><div>    writer-&gt;Update();</div><div>    }</div><div>  catch( itk::ExceptionObject &amp; err )</div>

<div>    {</div><div>    std::cerr &lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; std::endl;</div><div>    std::cerr &lt;&lt; err &lt;&lt; std::endl;</div><div>    return EXIT_FAILURE;</div><div>    };</div><div>
  </div>
<div>  return 0;</div><div><br></div><div>  }</div><div>  </div></div><div><b>OUTPUT</b> </div><div><br></div><div>D:\image\Debug&gt;ImageReadWrite.exe</div><div>Usage:</div><div>0022D9E0 firstSliceValue lastSliceValue  outputImageFile</div>

<div><br></div><div>D:\image\Debug&gt;ImageReadWrite.exe(1 450 test.mhd)</div><div>Usage:</div><div>00E71324 firstSliceValue lastSliceValue  outputImageFile</div><div><br></div><div>D:\image\Debug&gt;ImageReadWrite.exe(1,450,test.mhd)</div>

<div>Usage:</div><div>0115131C firstSliceValue lastSliceValue  outputImageFile</div><div><br></div><div>D:\image\Debug&gt;</div><div><br></div><div>PL help me to get it corrected</div><div>Thankas </div><span class="HOEnZb"><font color="#888888"><span><font color="#888888"><div>

<br></div><div>Shirani</div></font></span></font></span></div><br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div>