<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000;"><div>Hi,<br>I try to apply the discrete gaussian filter on a 3D dicom image. So i tried the code below. there's no errors on building step but the problem is after debugging. i don't have result.so i want to know where'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 "itkImage.h"<br>#include "itkImageFileReader.h"<br>#include "itkImageFileWriter.h"<br>#include "itkRescaleIntensityImageFilter.h"<br><br><br>#include "itkDiscreteGaussianImageFilter.h"<br><br>int main( int argc, char * argv[] )<br>{argc = 2;<br>&nbsp;&nbsp;&nbsp; argv[1] = "003F87DA.png";<br>&nbsp;&nbsp;&nbsp; argv[2] = "DA.png";
 <br>&nbsp; /*if( argc &lt; 3 ) <br>&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Usage: " &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; argv[0] &lt;&lt; "&nbsp; inputImageFile&nbsp; outputImageFile&nbsp; variance&nbsp; maxKernelWidth " &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp;&nbsp; }*/<br><br>&nbsp;<br>&nbsp; typedef&nbsp;&nbsp;&nbsp; float&nbsp;&nbsp;&nbsp; InputPixelType;<br>&nbsp; typedef&nbsp;&nbsp;&nbsp; float&nbsp;&nbsp;&nbsp; OutputPixelType;<br><br>&nbsp; typedef itk::Image&lt; InputPixelType,&nbsp; 3 &gt;&nbsp;&nbsp; InputImageType;<br>&nbsp; typedef itk::Image&lt; OutputPixelType, 3 &gt;&nbsp;&nbsp; OutputImageType;<br>&nbsp; <br>&nbsp; typedef itk::ImageFileReader&lt; InputImageType &gt;&nbsp; ReaderType;<br><br><br>&nbsp; <br>&nbsp; typedef
 itk::DiscreteGaussianImageFilter&lt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InputImageType, OutputImageType &gt;&nbsp; FilterType;<br><br>&nbsp; FilterType::Pointer filter = FilterType::New();<br>&nbsp; <br>&nbsp; ReaderType::Pointer reader = ReaderType::New();<br>&nbsp; reader-&gt;SetFileName( argv[1] );<br>&nbsp;<br>&nbsp; filter-&gt;SetInput( reader-&gt;GetOutput() );<br>&nbsp;<br>&nbsp; const double gaussianVariance = atof( argv[3] );<br>&nbsp; const unsigned int maxKernelWidth = atoi( argv[4] );<br><br>&nbsp; filter-&gt;SetVariance( gaussianVariance );<br>&nbsp; filter-&gt;SetMaximumKernelWidth( maxKernelWidth );<br>&nbsp;<br>&nbsp; <br>&nbsp; filter-&gt;Update();<br>&nbsp; <br>&nbsp; typedef unsigned char WritePixelType;<br>&nbsp; typedef itk::Image&lt; WritePixelType, 2 &gt; WriteImageType;<br>&nbsp; typedef itk::RescaleIntensityImageFilter&lt;
 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OutputImageType, WriteImageType &gt; RescaleFilterType;<br>&nbsp; RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<br><br>&nbsp; rescaler-&gt;SetOutputMinimum(&nbsp;&nbsp; 0 );<br>&nbsp; rescaler-&gt;SetOutputMaximum( 255 );<br><br>&nbsp; typedef itk::ImageFileWriter&lt; WriteImageType &gt;&nbsp; WriterType;<br>&nbsp; WriterType::Pointer writer = WriterType::New();<br>&nbsp; writer-&gt;SetFileName( argv[2] );<br>&nbsp;<br>&nbsp; // Software Guide : BeginCodeSnippet<br>&nbsp; rescaler-&gt;SetInput( filter-&gt;GetOutput() );<br>&nbsp; writer-&gt;SetInput( rescaler-&gt;GetOutput() );<br>&nbsp; writer-&gt;Update();<br>&nbsp; <br>&nbsp; return EXIT_SUCCESS;<br>}<br><br>Thanks<br><br><br></div></div><br>



      </body></html>