MantisBT - ITK
View Issue Details
0010421ITKpublic2010-03-15 12:152010-11-07 01:36
fbudin 
xiaoxiao 
normalminoralways
assignedopen 
ITK-3-16 
 
0010421: Computation of the FA with itkDiffusionTensor3D returns NaN
In some cases, FA should be 0 but 3.0 * isp - trace * trace is negative instead of being equal to 0 (very small value). This appends on my computer if I use doubles (if I use floats it works properly).

The current code is:
 const RealValueType isp = this->GetInnerScalarProduct();

  if( isp > 0.0 )
    {
    const RealValueType trace = this->GetTrace();
    const RealValueType anisotropy = 3.0 * isp - trace * trace;
    const RealValueType fractionalAnisotropy =
        static_cast< RealValueType >( vcl_sqrt(anisotropy / ( 2.0 * isp ) ) );
    return fractionalAnisotropy;
    }
It does not check that anisotropy is positive. In some cases, it ends up being negative and the function returns NaN.
If anisotropy is negative, it should probably be set to 0.
No tags attached.
Issue History
2010-03-15 12:15fbudinNew Issue
2010-03-15 17:05Luis IbanezStatusnew => assigned
2010-03-15 17:05Luis IbanezAssigned To => Luis Ibanez
2010-11-07 01:36Luis IbanezAssigned ToLuis Ibanez => xiaoxiao

There are no notes attached to this issue.