Hi again,
>
> 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 assume this refers to the --iout output? The --iout output is there mainly to check that things went ok, and it is recommended that one instead uses applytopup or eddy to perform the actual correction. The wraparound occurs because topup uses spline interpolation with periodic boundary conditions internally.
>
> 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.
Slice 20 is missing because that subject has moved so that the part of the brain that is in slice 20 in the first volume has moved outside of the FOV in one or more volumes.
>
> 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
This looks a little strange. The value of -refvol should be an integer that specifies which of the volumes in -in should be used as reference. You could use AP.nii.gz together with the --reffile, but it would not make sense since AP will be in distorted space.
>
> 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 assume you refer to the 4x4 matrices? Yes, they correspond to time steps. Each of them is completely determined by 6 unique values.
>
> 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
You need to use the flirt command together with the --applyxfm and --init options, where each of the volumes in your complex data is transformed with the corresponding transform from MAT_0000 to MAT_0023. You should also perform this operation on the real and imag images since the phase has discontinuities.
Jesper
>
> 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
|