Hi all,

I have been using 3dfim+ for a long time because I need the “Best Index” option.
3dfim+ -input CVR_raw_scaled+orig -ideal_file pco2_multi.1D -polort 1 -out ‘Fit Coef’ -out ‘Correlation’ -out ‘% Change’ -out ‘Best Index’ -bucket CVR_slope
I know it is very old but I could not find the equivalent option using 3dDeconvolve.
3dDeconvolve -input CVR_raw_scaled+orig -polort 1 -num_stimts 1 -stim_file 1 pco2.1D -stim_label 1 pco2effect -bucket CVR_slope

My questions are:

  • Is there an equivalent option in 3dDeconvolve? (without having to run the command multiple times)
  • If not, could you help me modify 3dfim+ in order to have the “-float” option … as I think I get into trouble because of the “short” output format. I am not sure the reason but once in a while I get some zeros almost everywhere …

Thank you in advance,


Hi Julien,

Would it be reasonable to use 3dcalc -expr ‘argmax(a,b,c,…)’ to get the index of a maximum R^2 result from 3dDeconvolve? That should be the same thing, but with the benefit of having all of 3dDeconvolve available. It would just take that one extra command, assuming 3dDeconvolve is run with -rout.

  • rick

Hi Rick,

Thank you for your help. Using 3dcalc was a bit cumbersome as the number of reference waveforms can vary and is often a large number
I also needed to extract the associated beta value.
I found another way that I think works using 3dTstat. Also, would you use the full R^2 or Stim#1 R^2 ?
Here is what i wrote:

foreach n (seq -f %02g 0 $n_max)
3dDeconvolve -mask ${mask}+orig -input ${data}+orig -polort 1 -num_stimts 1
-stim_file 1 ${ref}_multi.1D[$n] -rout -bout
-bucket tmp
-jobs 16
3dbucket -aglueto R+orig tmp+orig[0]
3dbucket -aglueto B+orig tmp+orig[4]

3dTstat -prefix R_best -max R+orig
3dTstat -prefix I_best -argmax R+orig

3dcalc -a B+orig -b I_best+orig -expr “a*equals(l,b)” -prefix tmp_B_best
3dTstat -prefix B_best -max tmp_B_best+orig