How to pad a slice to data for topup

In dwifslpreproc I use an mrconvert call to grab the first slice, and then mrcat that with the original image. That code was written before mrgrid was, hence the hack.

Couple of other notes:

  • FMRIB’s solution to this in 6.0.0 seems to have been to provide alternative topup config files, one of which does not perform downsampling and hence does not require even axis sizes. I have a change coming hopefully in 3.1.0 that enables providing dwifslpreproc with a configuration file that it should then provide to topup.

  • If the issue is along the slice encoding axis, and you’re intending to perform slice-to-volume correction, and you’re intending to execute EddyQC, the padding approach is no good. In dwifslpreproc, I explicitly add the padded slice to the same slice group as that of the duplicated slice, so that eddy_cuda is happy. However, EddyQC demands that each slice group have the same number of slices. So either I’d need to instruct dwifslpreproc to modify all of eddy's outputs (not just the DWI output) to remove all trace of the padded slice, or a topup config file that doesn’t invoke downsampling needs to be used (see point above).

    I’ll take this opportunity to deter people from using acquisitions with an odd slice count… :pleading_face: