Dear Experts,
I have some EPI brain data where I would like to correct for distortions and motion for both the magnitude and phase images.
For the phase encode blips in opposite directions I have 2 3D files:
1) AP_mag (20 slices nii format)
2) PA_mag (20 slices nii format)
* I should mention here that the EPI data I want to correct is a 4D time series (20 slices, 24 time steps)
fslmerge -t APPA AP_mag.nii PA_mag.nii
Using topup, I have the following code:
topup --imain=APPA --datain=topup_param.txt --config=b02b0.cnf
--out=my_topup_results --fout=my_field --iout=uAPPA
My topup_param.txt file contains 0 -1 0 0.072 on the first line, and 0 1 0 0.072 on the second line. I think it should be fine (my EPI factor is 100 and my echo spacing 0.72ms).
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:
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. It has been running for around 30 minutes so as yet I have been unable to check...
Next, my plan is to split the real and imaginary parts of the complex image to perform the distortion correction using applytopup.
In the meantime, any advice on the niggling problems I have would be very much appreciated!
Many thanks
Lucy
|