#! /bin/csh -f # # synthfmri # # Original Author: Doug Greve # CVS Revision Info: # $Author: nicks $ # $Date: 2007/01/09 22:41:19 $ # $Revision: 1.2 $ # # Copyright (C) 2002-2007, # The General Hospital Corporation (Boston, MA). # All rights reserved. # # Distribution, usage and copying of this software is covered under the # terms found in the License Agreement file named 'COPYING' found in the # FreeSurfer source code root directory, and duplicated here: # https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense # # General inquiries: freesurfer@nmr.mgh.harvard.edu # Bug reports: analysis-bugs@nmr.mgh.harvard.edu # set SYNTHFMRI_VER = '$Id: synthfmri,v 1.2 2007/01/09 22:41:19 nicks Exp $'; if($#argv < 2) then echo "USAGE: synthfmri " echo " options:" echo " -dir : directory in which to place the data" echo " -nruns " echo " -npercond n1 : non-null conditions" echo " -ntp : number of acquisitions per run" echo " -nskip : number of acquisitions to corrupt" echo " -nslices " echo " -nrows " echo " -ncols " echo " -SNR " echo " -TR " echo " -TER " echo " -timewindow " echo " -delta " echo " -tau " echo " -offset " echo " -trend " echo " -psigchange " echo " -rnnmaxdelay " echo " -alpha " echo " -rho " echo " -signalroi row1 col1 row2 col2" echo " -monly mfile" echo "" echo "$SYNTHFMRI_VER" exit 1; endif echo "$SYNTHFMRI_VER" set outdir = (); set Nruns = 1; set Npercond = 64; set Nslices = 1; set Nrows = 64; set Ncols = 64; set Ntp = 128; set Nskip = 0; set TR = 2; set TER = (); set TimeWindow = 20; set Offset = 1000; set Trend = 0; set PercentSigChange = 5; set SNR = -1; set Delta = 2.25; set Tau = 1.25; set RnnMaxDelay = 0; set Alpha = .88; set Rho = .9; set sigroi = (); set monly = 0; set mfile = (); set parfiles = (); set LoadPar = 0; goto parse_args; parse_args_return: if($#TER == 0) set TER = $TR; if( $#outdir == 0 ) then echo "ERROR: must specify an output directory" exit 1; endif if( $#Npercond == 0 ) then echo "ERROR: must specify at least one condition with npercond flag" exit 1; endif mkdir -p $outdir; @ run = 1; while($run <= $Nruns) set RunDir = `printf %03d $run`; mkdir -p $outdir/$RunDir @ run = $run + 1; end if(! $LoadPar ) mkdir -p $outdir/par set MATLAB = `getmatlab`; if($status) exit 1; if ($monly) then set QuitOnError = 0; set TARGET = "tee $mfile" rm -f $mfile; else set QuitOnError = 1; set TARGET = "$MATLAB -display iconic" endif #---------------------------------------------------------------# $TARGET <