Issue when using -volreg_compute_tsnr with multi-echo data


I am not sure but it might be a potential "bug" when using -volreg_compute_tsnr yes for multi-echo data. Below is the chunk computing it, $eind is the echo ID taking from the latest loop, not the 2nd echo or any user defined one. Therefore, this TSNR is computed using the last echo (3rd in my case) and the TSNR is lower than the 2nd one as expected. If multi-echo data is given, probably -volreg_compute_tsnr yes is better to be computed after combination but before GLM? If -volreg_compute_tsnr yes sounds weird for a computation after the combination, one can do so after the whole process. However, would it be bettter to simply replace $eind by $fave_echo?

# create a TSNR dataset, just from run 1
3dTstat -mean -prefix rm.signal.vreg.r01 pb04.$subj.r01.e$eind.volreg+orig
3dDetrend -polort 5 -prefix rm.noise.det -overwrite                          \
3dTstat -stdev -prefix rm.noise.vreg.r01 rm.noise.det+orig
3dcalc -a rm.signal.vreg.r01+orig                                            \
       -b rm.noise.vreg.r01+orig                                             \
       -c mask_epi_extents+orig                                              \
       -expr 'c*a/b' -prefix TSNR.vreg.r01.$subj
1 Like

Indeed, that should be $fave_echo. If you want to compute it after 'combine', I would have to add a -combine_compute_tsnr (or maybe go more general with -compute_tsnr_blocks volreg combine regress, or something). Anyway, I will look into fixing this to make it $fave_echo. That's a good and subtle catch!

  • rick

Okay, this is fixed. Do you want the update? If so and you use, feel free to build a new version right now. If so and you download binaries, please let me know and I will run a new build.

Thanks again for pointing this out,

  • rick
1 Like

Thanks a lot @rickr for fixing it. I will just do @update.afni.binaries later.

Before I forget again, note that binaries were indeed rebuilt last week.


  • rick
1 Like