<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello!</div><div><br></div><div>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?</div><div><br></div><div>I have discovered a divide by zero error in the CovarianceCalculator classes:</div><div><br></div><div>Something to the effect of:</div><div><div><br></div><div>if (frequency == 0) {</div><div> ++iter;<br></div><div> continue;</div><div>}</div><div><br></div><div>needs to be added early on in this loop in the CovarianceCalculator::ComputeCovarianceWithoutGivenMean method. </div><div><br></div><div><br></div><div><div> //</div><div> // fills the lower triangle and the diagonal cells in the covariance matrix</div><div> while (iter != end)</div><div> {</div><div> frequency = iter.GetFrequency() ;</div><div> totalFrequency += frequency ;</div><div> measurements = iter.GetMeasurementVector() ;</div><div> for ( i = 0 ; i < measurementVectorSize ; ++i )</div><div> {</div><div> diff[i] = measurements[i] - (*m_InternalMean)[i] ;</div><div> }</div><div><br></div><div> // updates the mean vector</div><div> double tempWeight = frequency / totalFrequency ;</div><div> for ( i = 0 ; i < measurementVectorSize ; ++i )</div><div> {</div><div> (*m_InternalMean)[i] += tempWeight * diff[i] ;</div><div> }</div><div><br></div><div> // updates the covariance matrix</div><div> tempWeight = tempWeight * ( totalFrequency - frequency ) ;</div><div> for ( row = 0; row < measurementVectorSize ; row++ )</div><div> {</div><div> for ( col = 0; col < row + 1 ; col++)</div><div> {</div><div> m_Output(row,col) += </div><div> tempWeight * diff[row] * diff[col] ;</div><div> }</div><div> }</div><div> ++iter ;</div><div> }</div></div><div><br></div><div>The itkWeightedCovarianceCalculator class looks like it has this bug as well but in two places in similar loops.</div><div><br></div><div><br></div><div><br></div><div>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.</div><div><br></div><div>if (m_Variance[i] != v)</div><div><br></div><div>should be:</div><div><br></div><div>if (m_MaximumError[i] != v)<br><br>Thank,<br>Brad</div><div><br></div></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin </span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div></span> </div><br></body></html>