#! /bin/csh -f # # sxacfg-get # # Extracts variable values from a selxavg configuration file. # # 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 # if($#argv != 2) then echo "USAGE: sxacfg-get cfgfile varname" exit 1; endif set cfg = $1; set varname = $2; if(! -e $cfg) then echo "ERROR: configuration file $cfg does not exist" exit 1; endif set varline = `cat $cfg | grep $varname`; if($#varline == 0) exit 0; switch ( $varname ) case "baseline": case "detrend": case "basegment": case "mail": echo 1; exit 0; breaksw case "gammafit": if($#varline != 3) then echo "ERROR: $varname variable missing value in cfg file" exit 1; endif echo $varline[2] $varline[3]; exit 0; breaksw default: if($#varline != 2) then echo "ERROR: $varname variable missing value in cfg file" exit 1; endif echo $varline[2]; exit 0; breaksw endsw exit 0 ############################################