:name: ComputeGradientMagnitude

Compute Gradient Magnitude of Grayscale Image
=============================================

.. index::
   single: GradientMagnitudeImageFilter, gradient

Synopsis
--------

This example demonstrates how to compute the magnitude of the gradient of an image.


Results
-------

.. figure:: Gourds.png
  :scale: 50%
  :alt: Input image

  Input image

.. figure:: ComputeGradientMagnitudeTestOutput.png
  :scale: 50%
  :alt: Output image

  Output image


Code
----

C++
...

.. literalinclude:: Code.cxx
   :lines: 18-


Classes demonstrated
--------------------

.. breathelink:: itk::GradientMagnitudeImageFilter
