It should be very bad to run 3dDetrend before motion correction
and other registration. That program would remove tissue contrast
and make motion correction very difficult.
Consider using afni_proc.py (maybe example 9) to start with for
resting state analysis.