# Computing Hessian Eigenvalues in Python: How to interpret output of SymmetricEigenAnalysisImageFilter

**URL:** <https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517>\
**Category:** Algorithms\
**Created:** [March 14, 2024, 9:27pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517 "2024-03-14T21:27:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chuck\_Hatt](https://discourse.itk.org/user_avatar/discourse.itk.org/chuck_hatt/32/3955_2.png) [@Chuck\_Hatt](https://discourse.itk.org/u/Chuck_Hatt)\
**Post date:** [March 14, 2024, 9:27pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/1 "2024-03-14T21:27:40Z")

</div>

Why would the output of SymmetricEigenAnalysisImageFilter have 6 channels, and at each pixel there are more than 3 non-zero values (there should only be three eigenvalues)?

This is my code for computing the hessian eigenvalues using python

```auto
import itk
hessian_image = itk.hessian_recursive_gaussian_image_filter(
            itk_image, sigma=2.0
        )
#hessian_image size = (6, 188, 217, 259)
        eigen_values_image = itk.SymmetricEigenAnalysisImageFilter(hessian_image)
        #eigen_values_image size = (6, 188, 217, 259)

eigen_values_array = itk.GetArrayFromImage(eigen_values_image, keep_axes=True)
print( eigen_values_array[:,100,100,100] )

```

array([ -3.0928779 , 1.86561006, 0. , -11.97670084,  
6.26783045, 0. ])

Why are there more than 3 non-zero eigenvalues?

---

<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:** [March 15, 2024, 1:14pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/2 "2024-03-15T13:14:18Z")

</div>

Maybe the problem is in [wrapping specification](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageIntensity/wrapping/itkSymmetricEigenAnalysisImageFilter.wrap#L9)? [The test](https://github.com/InsightSoftwareConsortium/ITK/blob/be79ceb0a9343c02dba310f5faee371941f6fa40/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx#L319) instantiates the filter with `<SSRT<3>, FixedArray<3> >`, whereas the wrapping instantiates with `<SSRT<3>, SSRT<3> >`.

---

<div class="post-metadata">

**Author:** ![Chuck\_Hatt](https://discourse.itk.org/user_avatar/discourse.itk.org/chuck_hatt/32/3955_2.png) [@Chuck\_Hatt](https://discourse.itk.org/u/Chuck_Hatt)\
**Post date:** [March 15, 2024, 1:21pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/3 "2024-03-15T13:21:31Z")

</div>

Does that mean it’s likely wrapped incorrectly and there’s nothing I can do about it at the moment? Or am I using it incorrectly?

---

<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:** [March 15, 2024, 1:23pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/4 "2024-03-15T13:23:48Z")

</div>

I think it is likely wrapped incorrectly.

---

<div class="post-metadata">

**Author:** ![Chuck\_Hatt](https://discourse.itk.org/user_avatar/discourse.itk.org/chuck_hatt/32/3955_2.png) [@Chuck\_Hatt](https://discourse.itk.org/u/Chuck_Hatt)\
**Post date:** [March 15, 2024, 1:34pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/5 "2024-03-15T13:34:17Z")

</div>

Sorry I’m new here. Can I create a ticket for fixing this, or report it so that a ticket is created?

---

<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:** [March 15, 2024, 1:43pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/6 "2024-03-15T13:43:21Z")

</div>

Yes, opening a ticket [here](https://github.com/InsightSoftwareConsortium/ITK/issues) will make sure we don’t forget about this. In description, link to this forum thread, and potentially provide further information.

---

<div class="post-metadata">

**Author:** ![Chuck\_Hatt](https://discourse.itk.org/user_avatar/discourse.itk.org/chuck_hatt/32/3955_2.png) [@Chuck\_Hatt](https://discourse.itk.org/u/Chuck_Hatt)\
**Post date:** [March 15, 2024, 2:06pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517/7 "2024-03-15T14:06:28Z")

</div>

Thanks, done.
