Hi everyone,
I am trying to run a simple script within AFNI to smooth and then scale the images that was based off Andy’s brain book.
https://andysbrainbook.readthedocs.io/en/latest/OpenScience/OS/fMRIPrep_Demo_6_GroupAnalysis.html
I have run this very simple command so many times, but I keep getting errors. It seems to be unhappy with my 3dcalc command.
This appears to be the offending script…
3dcalc -a sub-${id}_run-${run}blur.nii \
-b rm.mean_run-${run}.nii \
-c ${m} -expr 'c * min(200, a/b*100)*step(a)*step(b)' \
-prefix sub_${id}run_${run}_scale.nii;
When I run this I get the following error…
** FATAL ERROR: Extra command line arguments puzzle me! argv[9]=CPT_01 …
When I run this…
> 3dcalc -a sub-${id}_run-${run}blur.nii \
> -b rm.mean_run-${run}.nii \
> -c ${m}
> -expr 'c * min(200, a/b*100)*step(a)*step(b)' \
> -prefix sub_${id}run_${run}_scale.nii;
** FATAL ERROR: No expression given!
Then this…
3dcalc -a sub-${id}_run-${run}blur.nii \
-b rm.mean_run-${run}.nii \
-c ${m} \
-expr 'c * min(200, a/b*100)*step(a)*step(b)' \
-prefix sub_${id}run_${run}_scale.nii;
Back to ** FATAL ERROR: Extra command line arguments puzzle me! argv[9]=CPT_01
I have tried to copy what’s in the AFNI help file but keep getting error no matter what I change. Could someone please help?
for file in "${dicomfilename[@]}";do
session=$(echo "$file" | cut -d \. -f 2| grep -o '..')
id=$(echo "$file" | cut -d \. -f 1 | grep -o '......$')
id=${id^^}
if [ $afni_smooth == "yes" ]; then
#dir=$fmriprep_output"sub-"$id"/ses-"$session"/func"
dir=/work/06953/jes6785/ls6/ALMEIDA_LASER/derivatives/afni-v6.0first_level/LSB_103/ses-01/func/
cd $dir
outputdir=sub-${id}_${ses}-smooth_scale
mkdir $outputdir
cd $outputdir
mkdir CPT_${session}
# blur each volume of each run
for run in 01 02; do
f=${dir}sub-LSB103_ses-01_task-rest_dir-AP_run-${run}_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
m=${dir}sub-LSB103_ses-01_task-rest_dir-AP_run-${run}_space-MNI152NLin2009cAsym_desc-brain_mask.nii
3dmerge -1blur_fwhm 6.0 -doall -prefix sub-${id}_run-${run}blur.nii ${f};
3dTstat -prefix rm.mean_run-${run}.nii sub-${id}_run-${run}blur.nii;
3dcalc -a sub-${id}_run-${run}blur.nii \
-b rm.mean_run-${run}.nii \
-c ${m} -expr 'c * min(200, a/b*100)*step(a)*step(b)' \
-prefix sub_${id}run_${run}_scale.nii;
done
fi
done