[Insight-users] Couple small bug fixes I'd like to contribute!

Luis Ibanez luis.ibanez at kitware.com
Wed Jun 18 11:50:13 EDT 2008


Hi Bradley,

Please look at the Wiki page describing the mechanisms
for contributing bug fixes:

http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes



However,
I would rather encourage you to join the "Adopt a bug" program:

     http://www.itk.org/Wiki/ITK_Adopt_a_Bug_Program

In this program you will receive write access to the CVS repository
and you will be able to commit the bug fixes directly.


Note that the expectaion for bug fixes is that a test
will be included with the fix.


    Regards,


       Luis


--------------------------
Bradley Lowekamp wrote:
> Hello!
> 
> I have run into a couple small bug in ITK and posted the problems and 
> solution, but I have not seen the fixes make it into the repository. Is 
> there a better way to do post fixes then I have been? Should I post diffs?
> 
> I have discovered a divide by zero error in the CovarianceCalculator 
> classes:
> 
> Something to the effect of:
> 
> if (frequency == 0) {
>  ++iter;
>  continue;
> }
> 
> needs to be added early on in this loop in 
> the CovarianceCalculator::ComputeCovarianceWithoutGivenMean method. 
> 
> 
>  //
>  // fills the lower triangle and the diagonal cells in the covariance matrix
>   while (iter != end)
>     {
>     frequency = iter.GetFrequency() ;
>     totalFrequency += frequency ;
>     measurements = iter.GetMeasurementVector() ;
>     for ( i = 0 ; i < measurementVectorSize ; ++i )
>       {
>       diff[i] = measurements[i] - (*m_InternalMean)[i] ;
>       }
> 
>     // updates the mean vector
>     double tempWeight = frequency / totalFrequency ;
>     for ( i = 0 ; i < measurementVectorSize ; ++i )
>       {
>       (*m_InternalMean)[i] += tempWeight * diff[i] ;
>       }
> 
>     // updates the covariance matrix
>     tempWeight = tempWeight * ( totalFrequency - frequency ) ;
>     for ( row = 0; row < measurementVectorSize ; row++ )
>       {
>       for ( col = 0; col < row + 1 ; col++)
>         {
>         m_Output(row,col) += 
>           tempWeight * diff[row] * diff[col] ;
>         }
>       }
>     ++iter ;
>     }
> 
> The itkWeightedCovarianceCalculator class looks like it has this bug as 
> well but in two places in similar loops.
> 
> 
> 
> Secondly, the method CannyEdgeDetectionImageFilter::SetMaximumError  has 
> a small mistake in it. It looks like it should be checking to see if the 
> value v is different the the current value before setting it.
> 
> if (m_Variance[i] != v)
> 
> should be:
> 
> if (m_MaximumError[i] != v)
> 
> Thank,
> Brad
> 
> 
> ========================================================
> 
> Bradley Lowekamp  
> 
> Lockheed Martin Contractor for
> 
> Office of High Performance Computing and Communications
> 
> National Library of Medicine 
> 
> blowekamp at mail.nih.gov <mailto:blowekamp at mail.nih.gov>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list