Code:
sub flirtReg {
# Perform registration in Flirt
# Check the wd for the files we need
# keys: (identifiers); values: filenames
my %F_PARS = ("brain","", "structural","", "lvent","", "rvent","");
my $N_EX='.nii';
my $NGZ_EX="${N_EX}.gz";
my $FLIRT="/Applications/fsl/bin/flirt";
my $PASS1_FLAGS='-bins 256 -cost corratio -searchrx -180 180 -searchry -180 180
-searchrz -180 180 -dof 12 -interp sinc -sincwidth 7 -sincwindow hanning';
# Build file array
foreach (keys %F_PARS) { die "error: file \`${_}$NGZ_EX\' not found" if !($F_PARS{$_}=`ls|grep ${_}$NGZ_EX`); }
# Run command $FLIRT with the options that follow
# (i.e., `/Applications/fsl/bin/flirt -in <structural-filename>\
# -ref <brain-filename> ...
my $F_PASS1=qq/$FLIRT -in $F_PARS{"structural"} -ref $F_PARS{"brain"} -out $F_PARS{"structural"}_CSF_prior$NGZ_EX -omat ${SUBJ}_CSF_prior\
.mat $PASS1_FLAGS/;
# doesn't work
system ($F_PASS1);
}
output:
Code:
sh: line 1: -ref: command not found
sh: line 2: -out: command not found
sh: line 3: _CSF_prior.nii.gz: command not found
sh: line 4: -searchrz: command not found
I want to pass the `flirt' command to the shell. How do you do that without the shell interpreting the arguments as separate commands? Sorry about the word-wrapping; hopefully the context is clear.