Where to find detailed definition/description of ITK classes?

Hi,

I’m new to ITK and when I have questions, I usually do search on doxygen and SoftwareGuide. However, I sometimes found the information not detailed enough (at least for my curiosity :yum:). Is there any other resource?

For example, I searched for detailed description for itk::RegularStepGradientDescentOptimizer

  • What does RegularStepGradientDescentOptimizer::SetMaximumStepLength means?
    Naively I think there could be several possible definitions
    (1) The gradient just define the direction, we neglect the gradient magnitude and this function define the initial step length
    (2) We multiply the stepLength to the gradient (with both magnitude and direction).
    (3) Update is decided by gradient and other method, but we have an upper bound for the length of update step.

  • I’m even more curious about it since in itk::RegularStepGradientDescentOptimizerv4 this function is removed (maybe replaced by SetLearningRate)

For another example, when I’m searching for definition of tk::CorrelationImageToImageMetricv4

  • The definition in doxygen and SotfwareGuide mismatched :
    (1) The former one have pixel subtracting mean value while the later one doesn’t.
    (2) The former one does not have square root operation while the later one does.

  • I don’t know which to trust in this case

I would appreciate if either you can give me any other resources or answer the above specific questions

Thanks a lot,
HsuehWen

1 Like

The answer is in the code. I think that stepLength is multiplied with gradient, and it happens around here.

The answer to you second question is, I believe, here.

Whenever you spot such inconsistencies, it is good to point them out on this forum, and even better to create a patch which corrects the mistake in the code or Doxygen docs. itkSofwareGuide has already switched to ordinary GitHub pull requests.

Please take a stab at it!

1 Like

Thanks dzenanz!

I’ve looked into the code. Just as comment, I don’t totally agree with your answer about the stepLength (please correct me if I’m wrong)

As you pointed out, the factor is calculated by dividing m_CurrentStepLength with gradientMagnitude, and the function StepAlongGradient (which I believe is here) use factor times gradient as updating step. So effectively the code will neglect the gradient magnitude and just go by stepSize in the same direction as gradient direction.

1 Like

I just glanced at the code. I saw that gradient was being used, I didn’t pay attention to the difference between just using gradient direction and also using gradient magnitude too. Anyhow, the source code is the source of truth :smiley:

2 Likes