MantisBT - ITK
View Issue Details
0011098ITKpublic2010-08-05 04:452010-10-21 12:31
roodzeek 
Bradley Lowekamp 
normalmajoralways
closedfixed 
ITK-3-20 
ITK-3-20 
0011098: itkHessianToObjectnessMeasureImageFilter.h incorrect sorting of eigenvalues
Tested for 3D case.
Obtained completely different final filter results compared with MATLAB implementation of the same algorithm.

According to the Frangi's article where the methodology is described, the eigenvalues are to be sorted |l1|<=|l2|<=|l3|, then parameters rA = |l2|/|l3| and rB = |l1|/(|l2|*|l3|)^(1/2) can be calculated.

Line 148 of itkHessianToObjectnessMeasureImageFilter.h defines sorting function
[...]
return vnl_math_abs(a) > vnl_math_abs(b);
[...]
for sorting the eignevalues in itkHessianToObjectnessMeasureImageFilter.txx line 95 using std::sort().

This causes the eigenvalues to be sorted |l1|>=|l2|>=|l3| thus giving improper filter results.
Attached files in dicom format:

vedbase.vtk.dcm - source image.
Processed using: sigma = 1.25, alpha = 0.5, beta = 0.5, gamma = 30.

INCORRECT_vedbase.vtk-vess,s1.25,a0.5,b0.5,g30.dcm - results obtained using original implementation of the filter from ITK 3.20.

CORRECT_vedbase.vtk-vess,s1.25,a0.5,b0.5,g30.dcm - results obtained after correcing line 148 of itkHessianToObjectnessMeasureImageFilter.h file.

No tags attached.
zip datafiles.zip (2,001,340) 2010-08-05 04:45
https://public.kitware.com/Bug/file/3302/datafiles.zip
Issue History
2010-08-05 04:45roodzeekNew Issue
2010-08-05 04:45roodzeekFile Added: datafiles.zip
2010-08-05 04:50roodzeekNote Added: 0021660
2010-08-05 08:26Bradley LowekampStatusnew => assigned
2010-08-05 08:26Bradley LowekampAssigned To => Bradley Lowekamp
2010-08-05 08:27Bradley LowekampNote Added: 0021661
2010-08-05 10:26Bradley LowekampNote Added: 0021663
2010-08-11 10:02Bradley LowekampNote Added: 0021706
2010-08-11 10:03Bradley LowekampNote Added: 0021707
2010-08-11 10:03Bradley LowekampStatusassigned => resolved
2010-08-11 10:03Bradley LowekampFixed in Version => ITK-3-20
2010-08-11 10:03Bradley LowekampResolutionopen => fixed
2010-10-21 12:31Gabe HartStatusresolved => closed

Notes
(0021660)
roodzeek   
2010-08-05 04:50   
Forgot to write the suggested solution that worked:
Line 148 of itkHessianToObjectnessMeasureImageFilter.h should be:

return vnl_math_abs(a) < vnl_math_abs(b);
(0021661)
Bradley Lowekamp   
2010-08-05 08:27   
Presumably these results were correct with ITK 3.18?
(0021663)
Bradley Lowekamp   
2010-08-05 10:26   
On Aug 5, 2010, at 9:01 AM, Luca Antiga wrote:

Hi Brad,
 I confirm. In fact, with the comparison function currently in the
code the vector is sorted in descending order, not ascending.
If you fix it, it might be worth fixing any affected release (probably
only the latest).
Thanks for the feedback

Luca
(0021706)
Bradley Lowekamp   
2010-08-11 10:02   
The patch was committed and test was added:
http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=73f66bdba383a14f32868bf5695c60710f3b48bd;hp=eb1ee9cd4251a55406444387328b7d7fe1c4fc50 [^]

This work has been integrated into the 3.20.0 "release" branch along with the development "master" branch.
(0021707)
Bradley Lowekamp   
2010-08-11 10:03   
This fix has been committed to the 3.20.0 release, along with the master.