Hi experts,
When typing the command overlay at the promt and filling in the same information as my script, I get the expected results. But when I put the command into a script, the s1min after my stat image gives the error "file not found". Weird, since this is just a number, and not sure why the script command should be ordered differently to put a file there. I tried assigning a variable for the number, but still the same error. Has anyone else experienced this before?
Many thanks,
Varina
the filelist116 is just a series of numbers 0000 to 0116, iterating on the component numbers in place of s.
#!/bin/bash
export DEFAULT_FSL_INPUT_FILE=filelist116.txt
export DEFAULT_FSL_OUTPUT_DIR=/mnt/hgfs/melodicdesk/FSL-Output/5-6-MO-1/groupICA.gica
function fsl_overlay
{
# Local variables that have defaults
local input_file=$DEFAULT_FSL_INPUT_FILE
local output_dir=$DEFAULT_FSL_OUTPUT_DIR
# Process options overriding defaults
while [ -n "$(echo $1 | grep '-')" ]; do
case $1 in
-i ) input_file=$2
shift 2;;
-o ) output_dir=$2
shift 2;;
* ) echo 'usage: fsl_overlay [-h] [-i input_file] [-o output_dir]'
if [ "$1" = '-h' ]; then return 0
else return 1
fi
esac
done
# Execute overlay command on inputs
for s in $(cat $input_file); do
overlay 0 1 ${output_dir}/reg_standard/standard.nii ¡VA ${output_dir}/grot/dr_stage3_ic${s}_tfce_p_tstat1.nii 0.95 1 ${output_dir}/grot/dr_stage3_ic${s}_tfce_p_tstat2.nii 0.95 1 ${output_dir}/Renderstat/IC${s}p1-2
overlay 0 1 ${output_dir}/reg_standard/standard.nii ¡VA ${output_dir}/grot/dr_stage3_ic${s}_tfce_p_tstat3.nii 0.95 1 ${output_dir}/grot/dr_stage3_ic${s}_tfce_p_tstat4.nii 0.95 1 ${output_dir}/Renderstat/IC${s}p3-4
done
}
|