Hi,
I'm not really sure where the bug in your script might be, but does the variable TotalVolumes get set to the correct value? And what happens if you change the number of volumes in the GUI, save this template again, and then run your script? It is possible that something else, besides the number of volumes, might need to also be changed.
All the best,
Mark
On 8 Apr 2014, at 12:56, Irem Uendeger <[log in to unmask]> wrote:
> Dear all,
>
> I have been having a rather peculiar error while trying to extract the number of total volumes my scans have into a design file in order to run my first level analysis on FEAT with a bash script.
> When I load the design files created into the gui, I see that the number of volumes are correct. In addition, when I click Go and run the analysis by hand, everything works perfectly fine.
>
> However, when I try to use the same design file through the command line (feat design.fsf) or through a script I get this error:
> 'Image Exception : #22 :: ERROR: Could not open image example_func
> terminate called after throwing an instance of 'RBD_COMMON::BaseException'
>
> I'm using FSL 5.0.6.
>
> I'm pasting my script below in case it might be needed to answer the question.
>
>
> Thank you very much in advance!
>
>
> Kind regards,
>
> Irem Undeger
>
>
>
> The script to create design files and run feat using them:
>
> #! /bin/sh
>
>
> PWD="/gpfs01/volz/agvolz/iundeger/WADD/"
>
> create (){
> echo "starting subject ${1}"
>
> TotalVolumes=$(fslsize /gpfs01/volz/agvolz/iundeger/WADD/Raw/Localizer/VP_${1}_localizer.nii| grep dim4 | grep -v pix | awk '{print$2}' )
>
> echo "found $TotalVolumes time steps ..."
>
> date
> echo "subject #${1} Creating Output Directory"
> sed -e 's|input1_ep2d|/gpfs01/volz/agvolz/iundeger/WADD/Raw/Localizer/VP_'${1}'_localizer.nii|g' \
> -e 's|input2_outputdirectory|/gpfs01/volz/agvolz/iundeger/WADD/FEATruns/NoThreshold/VP_'${1}'_noThreshold.feat|g' \
> -e 's|input3_designfile1|/gpfs01/volz/agvolz/iundeger/WADD/Des/VP_'${1}'_building_all.txt|g' \
> -e 's|input4_designfile2|/gpfs01/volz/agvolz/iundeger/WADD/Des/VP_'${1}'_face_all.txt|g' \
> -e 's|input5_designfile3|/gpfs01/volz/agvolz/iundeger/WADD/Des/VP_'${1}'_obj_all.txt|g' \
> -e 's|input6_designfile4|/gpfs01/volz/agvolz/iundeger/WADD/Des/VP_'${1}'_loc_all.txt|g' \
> -e 's|input7_anatomy|/gpfs01/volz/agvolz/iundeger/WADD/Raw/Anat/VP_'${1}'_ADNI_brain.nii.gz|g' \
> -e 's|input9_TotalVolumes|'${TotalVolumes}'|g' \
> </gpfs01/volz/agvolz/iundeger/WADD/FEATruns/NoThreshold/NoThreshold.fsf>/gpfs01/volz/agvolz/iundeger/WADD/FEATruns/Design/${1}_noThresh.fsf
>
> echo "subject #${1} Analyzing ........."
> feat /gpfs01/volz/agvolz/iundeger/WADD/FEATruns/Design/${1}_volume_design.fsf
> echo "subject #${1} Completed Successfully!!!!"
>
> }
>
> for sub in 09 15 19 21 28 29 30 31 32
>
> do
>
> create $sub 2>&1 | tee -a /gpfs01/volz/agvolz/iundeger/WADD/FEATruns/''${1}'_all_feat.txt' &
>
> done
|