title: 1D Convolution with Gaussian Kernel using
body: <p>My goal is to calculate the calculation in each row of a 2D-image ( in the x-direction)
  After following the tip from Cory I am trying to use the ‘ConvolutionImageFilter’, and make a kernel with the Gaussian values I calculate before.
  I took a look to this example (http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ConvolutionImageFilter) and my question is how to include the values of the Gaussian filter to the kernel, I tried wit the code below and it compiles, but it seems the execution has no end when I update the convolutionFilter… Because of that I think that I am doing something wrong. My code is below and is not so much, if some can give some help I would appreciate that really a lot !!!!.</p>
  
  <pre><code>typedef itk::ConvolutionImageFilter &lt;ImageType&gt; ConvFilterType;
  
  ImageType::Pointer kernel = ImageType::New();
  CreateKernel(kernel, Gaussian , 256);
  
  //Convolve image with kernel
  ConvFilterType::Pointer convolutionFilter = ConvFilterType::New();
  convolutionFilter-&gt;SetInput(Li_itk);
  convolutionFilter-&gt;SetImageKernelInput(kernel);
  convolutionFilter-&gt;Update();
  
  void Reg_image_v2::CreateKernel(Reg_image_v2::ImageType::Pointer kernel, double *Gaussian, unsigned int width) {
  
  ImageType::IndexType start;
  start.Fill(0);
  
  ImageType::SizeType size;
      size[0] = width;
  size[1] = 1;
  
  ImageType::RegionType region;
  region.SetSize(size);
  region.SetIndex(start);
  
  kernel-&gt;SetRegions(region);
  kernel-&gt;Allocate();
  
  ImageType::IndexType pixelIndex;
  for (int i = 0 ; i &lt; width ; i ++){
      pixelIndex[0] = i ;
      pixelIndex[1] = 0 ;
      kernel-&gt;SetPixel(pixelIndex,Gaussian[i]);
  }
  
  itk::ImageRegionIterator&lt;ImageType&gt; imageIterator(kernel, region);
  
  while(!imageIterator.IsAtEnd()) 
  
  {
  //imageIterator.Set??
  
  ++imageIterator; //operator++  increments the iterator one position in the positive direction
  }
  
  
  } // end createKernel
  </code></pre>
  
  <p>Antonio</p>