jdtournier/mrtrix3 — pull request #144 by jdtournier (2014-11-27 12:09:56+00:00)
Title: Stride sanitise fix

Hey Rob,

Had a look at your changes - there were indeed quite a few glitches in there... First one was that the call to `contiguous_along_axis (axis, info)` was invoking `get_nearest_match (info, desired)` backwards - i.e. passing the original (`ref`) strides as desired, when really it's the contiguous axes (`desired`) that should take priority.

I've added documentation to `get_nearest_match()` to at least clarify what *I* think it should be doing - and also to make sure whatever changes I made were sensible... On that basis, I've had another look through your changes, and basically there were still some cases where it didn't work as expected. So I've modified and I think this time it *should* work as advertised...

I've pushed a small test_strides app if you want to play with it and confirm it does what it says. Once we're happy, we can delete it and merge. I haven't double-checked that 'fixing' `contiguous_along_axis()` doesn't break anything, but I don't expect it to cause any issues.