Skip to content

Instantly share code, notes, and snippets.

@eykanal
Created February 14, 2012 02:31
Show Gist options
  • Save eykanal/1822673 to your computer and use it in GitHub Desktop.
Save eykanal/1822673 to your computer and use it in GitHub Desktop.
Analyze MEG data and email when complete
#!/bin/sh
#
# The script should be run with the directory containing files to be analyzed.
# For each file in that directory, the script will run maxfilter with the
# parameters defined below, and save it to the output directory defined in
# SAVE_DIR. It will then email the address specified at the bottom
# ([email protected]) with the analysis log, containing the results of the
# analysis.
#
# Takes input argument of
FILES=$1/*_[1-9].fif
# Set directory where output files will be saved
SAVE_DIR=/mnt/data/sinuhe/neuro-data/elli/tsssData
for f in $FILES
do
fname=`basename $f | sed s/.fif//g`
maxfilter \
-f "$f" \
-o $SAVE_DIR/$fname-tsss.fif \
-origin fit \
-frame head \
-st 1 \
-corr 0.980 \
-waves $SAVE_DIR/$fname-tsssWaves.fif \
| tee $SAVE_DIR/$fname-tsssLog.txt
| mailx -s "$fname processing log" [email protected]
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment