Hi Rick,
Thanks for the help. The changed scripts work well actually.
I just found that 3dToutcount can not open the dataset perhaps because of the shared disk I use in my computer. That disk is a shared one for double systems.
When I changed my work directory to the other places, it doesn't throw that error.
BTW, I changed the script a little bit because we found that using the original script the functional images are not centered to the anatomical image. Therefore, we add one more line to the script.
Thank you anyway Rick!
Best,
Tracy