# GradientMagnitudeImageFilter vs SobelEdgeDetectionImageFilter

**URL:** <https://discourse.itk.org/t/gradientmagnitudeimagefilter-vs-sobeledgedetectionimagefilter/382>\
**Category:** Algorithms\
**Created:** [November 2, 2017, 1:59pm UTC](https://discourse.itk.org/t/gradientmagnitudeimagefilter-vs-sobeledgedetectionimagefilter/382 "2017-11-02T13:59:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexRothberg](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@AlexRothberg](https://discourse.itk.org/u/AlexRothberg)\
**Post date:** [November 2, 2017, 1:59pm UTC](https://discourse.itk.org/t/gradientmagnitudeimagefilter-vs-sobeledgedetectionimagefilter/382/1 "2017-11-02T13:59:21Z")

</div>

There are a number of edge related filters list [here](https://itk.org/Wiki/ITK/Examples#Image_Edges.2C_Gradients.2C_and_Derivatives).

I am trying to understand the difference between `GradientMagnitudeImageFilter` and `SobelEdgeDetectionImageFilter`. `GradientMagnitudeImageFilter` can incorporate pixel spacing. Aside from that (ie assuming equal pixel spacing or `UseImageSpacing` is off), what is the difference between these filters? It seems to boil down to the difference between `DerivativeOperator` and `SobelOperator`.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [November 3, 2017, 10:57am UTC](https://discourse.itk.org/t/gradientmagnitudeimagefilter-vs-sobeledgedetectionimagefilter/382/2 "2017-11-03T10:57:11Z")

</div>

Hi Alex,

> [@AlexRothberg](#):
>
> It seems to boil down to the difference between DerivativeOperator and SobelOperator.

Yes, that is correct. The difference is detailed in the class documentation for the operators: [itk::DerivativeOperator](https://itk.org/Doxygen/html/classitk_1_1DerivativeOperator.html) and [itk::SobelOperator](https://itk.org/Doxygen/html/classitk_1_1SobelOperator.html).
