This was taken from the previous message I had sent. Would really appreciate any advice! The output file uAPPA looks good, but my last slice (slice 20) is actually slice 1 repeated. Is this because FSL starts counting from 0, and is there any way to correct this? I then know I need to use applytopup (to test this I will use a magnitude image of 20 slices, 24 time steps). applytopup --imain=M_20 --inindex=1 --datain=topup_param.txt --topup=my_topup_results --method=jac --interp=spline --out=u_M20 This all looks fine but except slice 20 is now missing. At least here I know that the distortion correction is working. I then want to use mcflirt for the motion correction (for both magnitude and phase). I will use the original phase encode blip image (AP) as the reference volume: mcflirt -refvol AP.nii.gz -in mag.nii -out mag_mc.nii.gz -mats However, when I open the .mat files, the transformations contain 16 numbers in each file going from MAT_0000 to MAT_0023. I wonder whether the 16 came from? I thought there should be 20 transformations as there are 20 slices? Does the MAT volumes correspond to the number of time steps? How can I be sure that the motion correction has been applied to all 24 time steps? I would then like to apply the motion correction transform to the associated phase images. Can you apply the previous .mat file to the phase image directly? mcflirt -refvol AP.nii.gz -in phase.nii.gz -out phase_mc.nii.gz -init mag_mc.nii.gz.mat I don't think this is right; I am not sure what to put for the -init command or even if that is needed. Many thanks, Cheers Lucy