nipy/nipy — pull request #233 by alexis-roche (2012-11-16 18:36:32+00:00)
Title: Fix realign4d test failures

That should fix the test failures reported by Matthew. The problem was that motion estimation could give random results on the nipy buildbots (even if realign4d was called twice with exactly the same arguments). My understanding is that this was happening because optimization was numerically unstable (very likely because the tested image is too small with only 3 slices). This numerical instability seemed to cause the default optimizer (scipy .fmin.fmin_ncg optimizer) to behave randomly (not sure why, maybe some random number is generated when the gradient descent iteration gets stuck - just a guess).

The problem was fixed using a custom optimizer known to have purely deterministic behavior.

On top of this fix, the PR includes some cosmetic changes in the groupwise registration code without effects on the behavior.