[Insight-developers] some probable bug in itk::SingleValuedVnlCostFunctionAdaptor

Ashish Poddar ahpoddar at gmail.com
Sun Jun 19 18:32:22 EDT 2005


I was trying to use ConjugateGradientOptimizer in place of 
RegularStepGradientDescentOptimizer, and it always crashes when it tries to 
access {DerivativeType &input} whose value (as I traced back) comes from the 
function {vnl_cost_function::f} in the call {this -> compute (x, &f, 0);}
 here the value of "g" which is a pointer is set to null, which causes the 
crash... (if I did something wrong or interpreted something wrong, please 
correct)
 so probably this change needs to be incorporared in the compute function 
 (last 2 lines of the function)
** 
*Current:*
ConvertExternalToInternalGradient( externalGradient, *g );
*f = static_cast<InternalMeasureType>( measure );
 *Modified:*
if (g) ConvertExternalToInternalGradient( externalGradient, *g );
if (f) *f = static_cast<InternalMeasureType>( measure ); 
  with best regards,
Ashish.
 p.s. this took me 5-6 days to figure out the problem !! and if the solution 
is not correct please do tell me..
-- 
Ashish Poddar
Have an acceptable reason for accepting anything.
Y:ashish_poddar | MSN:ashish_poddar at yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20050619/df409fa5/attachment.htm


More information about the Insight-developers mailing list