Hi Varina,
It looks like there might be some non-readable characters in the overlay call just after the standard.nii input [¡VA]. Was this supposed to be '-A'? Or is this an artifact from posting to the FSL-usergroup?
To debug, first try simplifying the overlay command by replacing each of arguments with variables. Then put the entire overlay call into a variable where you can print it before executing it, such as this:
...
standard="${output_dir}/reg_standard/standard.nii"
stat1="${output_dir}/grot/dr_stage3_ic${s}_tfce_p_tstat1.nii"
stat2="${output_dir}/grot/dr_stage3_ic${s}_tfce_p_tstat2.nii"
output="${output_dir}/Renderstat/IC${s}p1-2"
cmd="overlay 0 1 $standard -A $stat1 0.95 1 $stat2 0.95 1 $output"
echo "debug-overlay-cmd=[$cmd]"
$cmd #execute overlay command
...
If that fails, also try simplifying the script to only overlay command; have it process a single dataset and hard-code all the arguments (copy and paste from terminal). If it works, then add variables one at a time to replace <s1_min>, and then <s1_max>, etc. You should be able to either replicate the problem, or make it work as you expect.
Cheers,
Carl
On 2012-05-17, at 8:37 AM, Varina Wolf wrote:
> 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
> }
>
----------------------------------------------------------------------------
Carl Helmick, B.C.S.
Manager, System Administrator, & Computer Programmer
Brain Imaging Laboratory
Department of Psychiatry
Dalhousie University
Rm 3134, Abbie J. Lane Bldg,
5909 Veterans Memorial Lane
Halifax, N.S. B3H 2E2
Office#: (902) 473-4571
E-mail: [log in to unmask]
Mobile#: (902) 233-2868
----------------------------------------------------------------------------
|