Howdy-
OK, I just sent you a link for uploading. If possible, having dACC_sigmask.nii and a couple of the other *.nii files would be useful.
I also just noticed something else worth commenting about in this script: within your for-loop, you are using the ">" to redirect to a text file. This will *not* concatenate to what exists in the file, instead overwriting it each time. Since you are in a loop, I assume that you would probably want to use ">>" to redirect with concatenation in each case, instead.
If you want to clear the file first, and then start redirecting each time (e.g., in case you re-run the script, you could use something like the following:
#!/bin/tcsh
# redirect nothing into each file, with the overwriting form of redirection;
# effectively starts an empty file, or empties a preexisting text file
# printf does not even put a newline char at the end by default (as echo would)
printf "" > FILE1.txt
printf "" > FILE2.txt
foreach var ( ${some_list} )
# at each iteration, redirect into a text file, but in "concatenation" mode
SOMETHING >> FILE1.txt
SOMETHING_ELSE >> FILE2.txt
end
--pt