# Sobel operator extended for 4D, legacy support for 3D, OK?

**URL:** <https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699>\
**Category:** Algorithms\
**Created:** [January 12, 2026, 5:44pm UTC](https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699 "2026-01-12T17:44:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Post date:** [January 12, 2026, 5:44pm UTC](https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699/1 "2026-01-12T17:44:15Z")

</div>

Please have a look at my pull request, which aims to improve our SobelOperator, and add ND support (including 4D):

> <https://github.com/InsightSoftwareConsortium/ITK/pull/5718>
>
> The old kernel coefficients for 3D appeared inconsistent with the coefficients f…or 2D. This pull request allows generating these coefficients consistently, inspired by the AI generated function \`make\_nd\_sobel\_kernels\`, presented by Hans Johnson (@hjmjohnson) at https://github.com/InsightSoftwareConsortium/ITK/issues/5702#issue-3748203291
> 
> The new coefficients are more commonly used by other toolkits, including SciPy's \`scipy.ndimage.sobel\`, and correspond with https://en.wikipedia.org/wiki/Sobel\_operator
> 
> This PR removes the reference to "An Isotropic 3x3x3 Volume Gradient Operator", Irwin Sobel, 1995, as it cannot be found anymore.
> 
> Added a \`UseLegacyCoefficients\` option to SobelOperator, which allows the user to specify whether or not \`SobelOperator::GenerateCoefficients()\` should still produce the old coefficients for a 3D kernel. Enabled by default.
> 
> Removed the \`static\_assert\` from \`SobelOperator\` that allowed only 2D and 3D. Added checks for 1D and 4D to the unit test.
> 
> 
> \- Superseding pull request #5715
> \- Addresses issue #5702

I think it is ready, but there are a few things to consider:

- The proposed new implementation of `SobelOperator::GenerateCoefficients()` is based on a function `make_nd_sobel_kernels` generated by AI, and presented by Hans (@hjmjohnson) at [A ND Sobel implementation is needed. · Issue #5702 · InsightSoftwareConsortium/ITK · GitHub](https://github.com/InsightSoftwareConsortium/ITK/issues/5702) . I don’t fully understand this function, but it appears to produce the same numbers as the original implementation of `itk::SobelOperator`, for 2D. So I think it’s OK, but an extra review might be helpful.

- The AI generated `make_nd_sobel_kernels` produces different coordinates for 3D than the original implementation of `itk::SobelOperator` (from ITK \<= 5.4). The pull request proposes to add an option `UseLegacyCoefficients`, to get the coordinates of the original ITK implementation. I guess, legacy code should use the original coordinates for 3D, and new code should use the coordinates from the AI generated function, right?

- The coordinates for 3D from the original implementation of `itk::SobelOperator` (from ITK \<= 5.4) were based on “Irwin Sobel. An Isotropic 3x3x3 Volume Gradient Operator. Technical report, Hewlett-Packard Laboratories, April 1995.” I propose to remove the reference to this publication, because I cannot find it. But is this report still available somewhere?

---

<div class="post-metadata">

**Author:** ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Post date:** [January 13, 2026, 7:53pm UTC](https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699/2 "2026-01-13T19:53:16Z")

</div>

> [@Niels\_Dekker](#):
>
> The coordinates for 3D from the original implementation of `itk::SobelOperator` (from ITK \<= 5.4) were based on “Irwin Sobel. An Isotropic 3x3x3 Volume Gradient Operator. Technical report, Hewlett-Packard Laboratories, April 1995.” I propose to remove the reference to this publication, because I cannot find it. But is this report still available somewhere?

For what it’s worth, I just found a “Technical Reports” page of HP Labs from 1995, archived at

> **[HP Labs : Technical Reports : 1995](https://shiftleft.com/mirrors/www.hpl.hp.com/techreports/95/)**
>
> HP Labs Technical Reports

As well as at [https://web.archive.org/web/20051219115308/http://hpl.hp.com/techreports/95/](https://web.archive.org/web/20051219115308/http://hpl.hp.com/techreports/95/)

Unfortunately, the technical report of Irwin Sobel, “An Isotropic 3x3x3 Volume Gradient Operator” (which is specifically about extending the operator to 3D) is not there!!!

This technical report was first mentioned in “itkSobelOperator.h” by Josh Cates (@joshcates) , June 24, 2003, commit [FIX: Fixed 3D implementation. The Sobel operator now works correctly… · InsightSoftwareConsortium/ITK@b4cc496 · GitHub](https://github.com/InsightSoftwareConsortium/ITK/commit/b4cc4961959d9ec89583071eddc24b3f4cad7075)

Has anyone seen the technical report?

* * *

Update: I just read in [CEASAR: A Smooth, Accurate and Robust Centerline Extraction Algorithm](https://www3.cs.stonybrook.edu/~bender/pub/ceasar.pdf) Ingmar Bitter et al., Stony Brook University:

> I. Sobel. An Isotropic 3x3x3 Volume Gradient Operator. Hewlett-Packard’s Voxelator V-3 CD-ROM, Aug. 1996. Online Information at [http://www.hp.com/info/voxelator](http://www.hp.com/info/voxelator) (Paper is only on CD, not online)

Does anyone still have the CD?!?

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [January 13, 2026, 9:51pm UTC](https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699/3 "2026-01-13T21:51:51Z")

</div>

I sent an email to Josh. Let’s see whether he responds, and whether he can find the report.

---

<div class="post-metadata">

**Author:** ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Post date:** [January 13, 2026, 10:04pm UTC](https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699/4 "2026-01-13T22:04:03Z")

</div>

Thanks @dzenanz

Looking at [archive.org](http://archive.org), it appears that HP’s Voxelator CD, containing the Sobel paper was distributed at the [SIGGRAPH 1996](https://history.siggraph.org/conference/siggraph-1996-23rd-annual-conference-on-computer-graphics-and-interactive-techniques/) conference! Unfortunately I wasn’t there 😃

> **[VOXELATOR: CD-ROM Errata](https://web.archive.org/web/19961225223749/http://www.hp.com/wsg/voxdocs/errata.html)**

---

<div class="post-metadata">

**Author:** ![hele](https://discourse.itk.org/letter_avatar_proxy/v4/letter/h/a698b9/32.png) [@hele](https://discourse.itk.org/u/hele)\
**Post date:** [February 4, 2026, 2:24pm UTC](https://discourse.itk.org/t/sobel-operator-extended-for-4d-legacy-support-for-3d-ok/7699/5 "2026-02-04T14:24:03Z")

</div>

This looks like the right move. the ND Sobel cleanup finally makes the 3D case behave like 2D instead of carrying historical quirks forward.

`UseLegacyCoefficients` is a good safety valve — there _will_ be code relying on the old 3D behavior, even if it was never mathematically clean. defaulting to the new ND Sobel and keeping legacy behind a flag is exactly how ITK should handle this.

on the Irwin Sobel report: if it’s effectively lost to a SIGGRAPH ’96 CD-ROM, it’s not a usable reference anymore. the implementation + documented construction logic matters more than a citation nobody can verify.

net: solid PR, sensible compatibility story, and the Sobel operator is better off without mystery math baked in.
