Normalize the residuals obtained from the nuisance model

The directory you will be working out of is the resting.feat/stats in the subject's directory.

  • First, you take the mean of the timeseries:
    • [code]fslmaths res4d.nii.gz -Tmean mn_res4d_tmp[/code]
      • res4d.nii.gz is your input file, -Tmean is the function, and mn_res4d_tmp is the output filename.
  • Next, you take the standard deviation of the timeseries:
    • [code]fslmaths res4d.nii.gz -Tstd std_res4d_tmp[/code]
  • Lastly, you subtract the mean from the original timeseries, divide by the standard deviation, add 100, and then multiply by the mask:
    • [code]fslmaths res4d.nii.gz -sub mn_res4d_tmp.nii.gz -div std_res4d_tmp.nii.gz -add 100 -mul ../mask.nii.gz scaled_res4d_plus100[/code]
      • Your output file is scaled_res4d_plus100
  • Now that you've normalized the residuals, you can delete the temporary files:
    • [code]rm *res4d_tmp*[/code]