Thank you for taking care of this part of the code. That's really useful.

I don't see why you require frametimes[0] == 0. It is very frequent --and probably more optimal-- to offset the slice acquisition times by some value, chosen during the slice timing correction.