Create Gaussian Derivative Kernel

Synopsis

Create a Gaussian derivative kernel.

Results

Output:

Size: [3, 3]
Neighborhood:
Radius:[1, 1]
Size:[3, 3]
DataBuffer:NeighborhoodAllocator { this = 0x7ffee86419a8, begin = 0x7fb16bc5cc50, size=9 }
[-1, -1] 0
[0, -1] 0
[1, -1] 0
[-1, 0] 0.208375
[0, 0] 0
[1, 0] -0.208375
[-1, 1] 0
[0, 1] 0
[1, 1] 0

Code

C++

#include <itkGaussianDerivativeOperator.h>

int
main(int, char *[])
{
  using GaussianDerivativeOperatorType = itk::GaussianDerivativeOperator<float, 2>;
  GaussianDerivativeOperatorType gaussianDerivativeOperator;
  gaussianDerivativeOperator.SetDirection(0); // Create the operator for the X axis derivative
  itk::Size<2> radius;
  radius.Fill(1);
  gaussianDerivativeOperator.CreateToRadius(radius);

  std::cout << "Size: " << gaussianDerivativeOperator.GetSize() << std::endl;

  std::cout << gaussianDerivativeOperator << std::endl;

  for (unsigned int i = 0; i < 9; i++)
  {
    std::cout << gaussianDerivativeOperator.GetOffset(i) << " " << gaussianDerivativeOperator.GetElement(i)
              << std::endl;
  }
  return EXIT_SUCCESS;
}

Classes demonstrated