<br>Hi Syrine,<br><br>You should use the SeriesImageReader in order <br>to load a 3D DICOM series from a directory.<br><br><br>Please see the Example:<br><br>      Insight/Examples/IO/DicomSeriesReadImageWriter2.cxx<br><br>
<br>   Regards,<br><br><br>         Luis<br><br><br>------------------------------------------------------------------------------------------<br><div class="gmail_quote">On Mon, Jul 27, 2009 at 9:19 AM, Syrine Sahmim <span dir="ltr">&lt;<a href="mailto:syrine.sahmim@yahoo.fr">syrine.sahmim@yahoo.fr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div>Hi,<br>I try to apply the discrete gaussian filter on a 3D dicom image. So i tried the code below. there&#39;s no errors on building step but the problem is after debugging. i don&#39;t have result.so i want to know where&#39;s the error or even i must do or add some codes to succeed execution.<br>
the code is:<br>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif<br><br>#ifdef __BORLANDC__<br>#define ITK_LEAN_AND_MEAN<br>#endif<br><br>#include &quot;itkImage.h&quot;<br>#include &quot;itkImageFileReader.h&quot;<br>
#include &quot;itkImageFileWriter.h&quot;<br>#include &quot;itkRescaleIntensityImageFilter.h&quot;<br><br><br>#include &quot;itkDiscreteGaussianImageFilter.h&quot;<br><br>int main( int argc, char * argv[] )<br>{argc = 2;<br>
    argv[1] = &quot;003F87DA.png&quot;;<br>    argv[2] = &quot;DA.png&quot;;
 <br>  /*if( argc &lt; 3 ) <br>    { <br>    std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;<br>    std::cerr &lt;&lt; argv[0] &lt;&lt; &quot;  inputImageFile  outputImageFile  variance  maxKernelWidth &quot; &lt;&lt; std::endl;<br>
    return EXIT_FAILURE;<br>    }*/<br><br> <br>  typedef    float    InputPixelType;<br>  typedef    float    OutputPixelType;<br><br>  typedef itk::Image&lt; InputPixelType,  3 &gt;   InputImageType;<br>  typedef itk::Image&lt; OutputPixelType, 3 &gt;   OutputImageType;<br>
  <br>  typedef itk::ImageFileReader&lt; InputImageType &gt;  ReaderType;<br><br><br>  <br>  typedef
 itk::DiscreteGaussianImageFilter&lt;<br>                 InputImageType, OutputImageType &gt;  FilterType;<br><br>  FilterType::Pointer filter = FilterType::New();<br>  <br>  ReaderType::Pointer reader = ReaderType::New();<br>
  reader-&gt;SetFileName( argv[1] );<br> <br>  filter-&gt;SetInput( reader-&gt;GetOutput() );<br> <br>  const double gaussianVariance = atof( argv[3] );<br>  const unsigned int maxKernelWidth = atoi( argv[4] );<br><br>  filter-&gt;SetVariance( gaussianVariance );<br>
  filter-&gt;SetMaximumKernelWidth( maxKernelWidth );<br> <br>  <br>  filter-&gt;Update();<br>  <br>  typedef unsigned char WritePixelType;<br>  typedef itk::Image&lt; WritePixelType, 2 &gt; WriteImageType;<br>  typedef itk::RescaleIntensityImageFilter&lt;
 <br>               OutputImageType, WriteImageType &gt; RescaleFilterType;<br>  RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<br><br>  rescaler-&gt;SetOutputMinimum(   0 );<br>  rescaler-&gt;SetOutputMaximum( 255 );<br>
<br>  typedef itk::ImageFileWriter&lt; WriteImageType &gt;  WriterType;<br>  WriterType::Pointer writer = WriterType::New();<br>  writer-&gt;SetFileName( argv[2] );<br> <br>  // Software Guide : BeginCodeSnippet<br>  rescaler-&gt;SetInput( filter-&gt;GetOutput() );<br>
  writer-&gt;SetInput( rescaler-&gt;GetOutput() );<br>  writer-&gt;Update();<br>  <br>  return EXIT_SUCCESS;<br>}<br><br>Thanks<br><br><br></div></div><br>



      </div><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>
Please keep messages on-topic and check the ITK FAQ at: <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>