Hi Matt, I found this very useful script you wrote in 2007 :). I have seperated my 2 sets of dt with the fslroi commands you wrote. I tried the last line using fslmaths_32R .... but it says command not found. May I ask what 32R stands for? Would it be right if I use fslmaths av1_corr -add av2_corr -div 2 data for the last step to average 2 repeat of dti 30 dir 5 b0? I checked my output results and the values in the output image voxels is the average of the 2 repeat dti. avwmerge -t big4d data1 data2 #merge the averages into a single 4D file bash eddy_correct big4d big4d_corr 0 #motion correct all data to first volume bash -c "avwroi big4d_corr av1_corr 0 40" bash -c "avwroi big4d_corr av2_corr 40 40" avwmaths_32R av1_corr -add av2_corr -div 2 data #average motion corrected data Many Thanks in advance Siewmin