[Insight-users] Strange problems with multiresolution

Geoff Topping g_topping at hotmail.com
Sun Jul 19 21:34:27 EDT 2009


Hi,

I'm not very knowledgable about the registration code in ITK, so this might be misleading or wrong, but looking through the code for RegularStepGradientDescentBaseOptimizer and RegularStepGradientDescentOptimizer, I see in the function RegularStepGradientDescentBaseOptimizer::StartOptimization has the code: 

  const unsigned int spaceDimension = m_CostFunction->GetNumberOfParameters();
  m_Gradient = DerivativeType( spaceDimension );
  m_PreviousGradient = DerivativeType( spaceDimension );


and in RegularStepGradientDescentBaseOptimizer::AdvanceOneStep has the code:

  const unsigned int  spaceDimension = m_CostFunction->GetNumberOfParameters();

  [some code removed]

  // Make sure the scales have been set properly
  if (scales.size() != spaceDimension)
    {
    itkExceptionMacro(<< "The size of Scales is "
                      << scales.size()
                      << ", but the NumberOfParameters for the CostFunction is "
                      << spaceDimension
                      << ".");
    }


which seems to be the code causing your error in Release mode.



More information about the Insight-users mailing list