Generating fibre-to-field angle from DTI

Dear all,

I think I may have found a simple solution based on the advice given in this thread

Would the following code work to generate an image where each voxel value is the fibre orientation relative to B0?

mrconvert data.nii.gz dwi.mif -fslgrad bvecs bvals
dwi2response tournier dwi.mif response.txt
dwi2fod csd dwi.mif response.txt fod.mif
sh2peaks -num 1 fod.mif first_peak.mif
mrconvert first_peak.mif -coord 3 2 z-component.mif
mrcalc z-component.mif -acos angle.mif
mrconvert angle.mif angle.nii.gz