ON 17 Oct 2008, Carlton Chu posted a nice script to SPM mailing list.
Though it doesn’t have any response from the list, I find it very useful, so I introduce the script on my blog.
The purpose of the script is simple: Set AC-PC automatically for you!
Though it takes time (around 5 minutes per subject in my circumstance), It’s so much time-saving for me who have more than 1000 subjects which I need to realign.
If you are interested, try the following script. It works for SPM5 and later (SPM8 or 12).
In the original post, function which calls select files window was commented out. I uncommented it and it runs without any problems.
spm_smooth(f,'temp.nii',[12 12 12]);
[M,scal] = spm_affreg(vg,vf,flags);
[u s v]=svd(M3);
Usage: Download the file below, put the file into the SPM5, 8, or 12 directory, and run “auto_reorient” from Matlab window.