Hello to everyone,<br><br>I am trying to run the DerivativeImageFilter.cxx from the filter examples of itk. My project is built corectly but when I run the command prompt window giving the following parametres: <i>DerivativeImageFilter input.png output.png normalize.png 1 0</i>, I get a Debug error. Does anybody know what is the problem? Also, what is the <i>order </i>in a derivative image filter and what values does it get in the command prompt window?<br>
<br>Thanks<br><br>\\\\\\\\\\\\\\\\\\\\DerivativeImageFilter.cxx\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br><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>#include &quot;itkDerivativeImageFilter.h&quot;<br><br><br><br>int main( int argc, char * argv[] )<br>{<br>  if( argc &lt; 6 )<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  normalizedOutputImageFile &quot;;<br>    std::cerr &lt;&lt; &quot; derivativeOrder direction&quot; &lt;&lt; std::endl;<br>    return EXIT_FAILURE;<br>
    }<br><br>  typedef   float  InputPixelType;<br>  typedef   float  OutputPixelType;<br><br>  const unsigned int Dimension = 2;<br><br>  typedef itk::Image&lt; InputPixelType,  Dimension &gt;   InputImageType;<br>  typedef itk::Image&lt; OutputPixelType, Dimension &gt;   OutputImageType;<br>
<br><br>  typedef itk::ImageFileReader&lt; InputImageType  &gt;  ReaderType;<br>  typedef itk::ImageFileWriter&lt; OutputImageType &gt;  WriterType;<br><br>  ReaderType::Pointer reader = ReaderType::New();<br>  WriterType::Pointer writer = WriterType::New();<br>
<br>  reader-&gt;SetFileName( argv[1] );<br>  writer-&gt;SetFileName( argv[2] );<br><br><br>  typedef itk::DerivativeImageFilter&lt;<br>               InputImageType, OutputImageType &gt;  FilterType;<br><br>  FilterType::Pointer filter = FilterType::New();<br>
  // Software Guide : EndCodeSnippet<br><br><br>  filter-&gt;SetOrder(     atoi( argv[4] ) );<br>  filter-&gt;SetDirection( atoi( argv[5] ) );<br><br>  filter-&gt;SetInput( reader-&gt;GetOutput() );<br>  writer-&gt;SetInput( filter-&gt;GetOutput() );<br>
  writer-&gt;Update();<br><br><br><br>  typedef itk::Image&lt; unsigned char, Dimension &gt;  WriteImageType;<br><br>  typedef itk::RescaleIntensityImageFilter&lt; <br>                                  OutputImageType,<br>
                                  WriteImageType &gt;    NormalizeFilterType;<br><br>  typedef itk::ImageFileWriter&lt; WriteImageType &gt;       NormalizedWriterType;<br><br>  NormalizeFilterType::Pointer normalizer = NormalizeFilterType::New();<br>
  NormalizedWriterType::Pointer normalizedWriter = NormalizedWriterType::New();<br><br>  normalizer-&gt;SetInput( filter-&gt;GetOutput() );<br>  normalizedWriter-&gt;SetInput( normalizer-&gt;GetOutput() );<br><br>  normalizer-&gt;SetOutputMinimum(   0 );<br>
  normalizer-&gt;SetOutputMaximum( 255 );<br><br>  normalizedWriter-&gt;SetFileName( argv[3] );<br>  normalizedWriter-&gt;Update();<br><br>  return EXIT_SUCCESS;<br>}<br><br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>