regress_opts_3dD results with MACAQUE_DEMO

AFNI version info (afni -ver): AFNI_23.1.10

Hello,

I have been testing the code from MACAQUE_DEMO from this paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9272767/#S18

The scripts run fine and as expected, but when looking at the QC (quality control) folders for afni_proc.py on all EPI runs and comparing it with Figure 10 of the paper or the ''QC_sub-000-ALLEPI'', the results do not match. It doesn't show any thresholding/colour spot and it fails to include the final gltsym, ''+.5FO''.

My output vs. expected output:

Any help is greatly appreciated.

The following are part my own generated out.review_html and @ss_review_html respectively (the demo does not provide these files related to the processing, only the QC folders:

++ My command:
   @chauffeur_afni -ulay ./NMT_v2.1_sym_05mm_SS.nii.gz -box_focus_slices ./NMT_v2.1_sym_05mm_SS.nii.gz -olay stats.sub-000+tlrc.HEAD -cbar Reds_and_Blues_Inv -pass -ulay_range 0% 120% -func_range 0.000000 -thr_olay 99.99 -olay_alpha Yes -olay_boxed Yes -set_subbricks 0 13 14 -opacity 9 -pbar_saveim QC_sub-000/media/qc_07_vstat_+F-SF_GLT_0_Coef.pbar.jpg -pbar_comm_range 99%ile in suprathresh mask voxels -pbar_comm_thr two-sided p=0.001, alpha+boxed on -prefix QC_sub-000/media/qc_07_vstat_+F-SF_GLT_0_Coef -save_ftype JPEG -montx 7 -monty 1 -montgap 1 -montcolor black -set_xhairs OFF -label_mode 1 -label_size 4 -no_cor -do_clean

++ Using AFNI ver : AFNI_23.1.10
++ chauffeur ver  : 6.52

------------------ start of optionizing ------------------

++ Found input file:   ./NMT_v2.1_sym_05mm_SS.nii.gz
++ Found input file:   stats.sub-000+tlrc.HEAD
++ Found focus refbox file:   ./NMT_v2.1_sym_05mm_SS.nii.gz
++ Using blowup factor: 2
++ Using opacity:  9
++ Making temporary work directory to copy vis files: QC_sub-000/media/__tmp_chauf_iJ5aBhpffSt
++ Converted 0 to labels
++ Final subbrick indices: 0 13 14
bc: Command not found.
++ Copy ulay to visualize (volumetric) within user's range:
bc: Command not found.
bc: Command not found.
bc: Command not found.
++ Ulay to be visualized within user range:
  [0%, 120%] -> [0.000000, ]
++ 3dcalc: AFNI version=AFNI_23.1.10 (Jun 30 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./QC_sub-000/media/__tmp_chauf_iJ5aBhpffSt/tmp_ulay.nii
++ 3dcalc: AFNI version=AFNI_23.1.10 (Jun 30 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./QC_sub-000/media/__tmp_chauf_iJ5aBhpffSt/tmp_olay.nii
++ User-entered function range value value (0.000000)
++ Dimensions (xyzt): 128 156 100 1
++ (initial) Slice spacing ordered (x,y,z) is:  18 22 14
++ 3dAutobox: AFNI version=AFNI_23.1.10 (Jun 30 2023) [64-bit]
++ Auto bbox: x=5..122  y=3..148  z=0..95
++ 3dAutobox: output dataset = QC_sub-000/media/__tmp_chauf_iJ5aBhpffSt/ulay_box_0.nii
bc: Command not found.
bc: Command not found.
bc: Command not found.
bc: Command not found.
@: Expression Syntax.
++ How many coors? 0
++ Will have the ref box central coors : SET_DICOM_XYZ 
++ Will have the ref box central gapord: 16 20 13

------------------- end of optionizing -------------------
# ================= view stats (+ eff est): +F-SF_GLT_0_Coef =================

# peruse statistical results:
#     thr vol [14]
#     olay vol [13] for pbar

set opref     = qc_07_vstat_+F-SF_GLT_0_Coef
set ulay_dset = ${main_dset}
set focus_box = ${main_dset}
set ulay_name = `3dinfo -prefix ${ulay_dset}`
set olay_name = `3dinfo -prefix ${stats_dset}`
set avsp      = `3dinfo -av_space ${stats_dset}`
set olaybrick = 13
set olaylabel = `3dinfo -label ${stats_dset}"[${olaybrick}]"`
set thrbrick  = 14
set thrlabel  = `3dinfo -label ${stats_dset}"[${thrbrick}]"`
set thr_staux = `3dAttribute BRICK_STATAUX ${stats_dset}"[${thrbrick}]"`
set thr_dof   = `echo ${thr_staux[4-]}`
set tjson     = _tmp.txt
set ojson     = ${odir_img}/${opref}.axi.json
set tjson2    = _tmp2.txt
set ojson2    = ${odir_img}/${opref}.sag.json
set opbarrt   = ${odir_img}/${opref}.pbar
set tcoef     = __tmp_coef_vol.nii

set thr_thresh = `p2dsetstat                                                 \
    -quiet                                                                   \
    -inset ${stats_dset}"[${thrlabel}]"                                      \
    -2sided                                                                  \
    -pval 0.001`                                                            

3dcalc                                                                       \
    -a    "${stats_dset}[${olaylabel}]"                                      \
    -b    "${stats_dset}[${thrlabel}]"                                       \
    -c    ${mask_dset}                                                       \
    -expr "abs(a)*step(b-${thr_thresh})*step(c)"                             \
    -prefix ${tcoef}                                                        

set ppcoef = `3dBrickStat                                                    \
    -slow                                                                    \
    -non-zero                                                                \
    -percentile 99 1 99                                                      \
    ${tcoef}`                                                               

set olay_topval = ${ppcoef[2]}
set olay_botval = -${olay_topval}

@chauffeur_afni                                                              \
    -ulay  ${ulay_dset}                                                      \
    -box_focus_slices ${focus_box}                                           \
    -olay  ${stats_dset}                                                     \
    -cbar Reds_and_Blues_Inv                                                 \
    -pass                                                                    \
    -ulay_range 0% 120%                                                      \
    -func_range ${olay_topval}                                               \
    -thr_olay ${thr_thresh}                                                  \
    -olay_alpha Yes                                                          \
    -olay_boxed Yes                                                          \
    -set_subbricks 0 ${olaybrick} ${thrbrick}                                \
    -opacity 9                                                               \
    -pbar_saveim   "${opbarrt}.jpg"                                          \
    -pbar_comm_range "99%ile in suprathresh mask voxels"                     \
    -pbar_comm_thr   "two-sided p=0.001, alpha+boxed on"                     \
    -prefix        "${odir_img}/${opref}"                                    \
    -save_ftype JPEG                                                         \
    -montx 7 -monty 1                                                        \
    -montgap 1                                                               \
    -montcolor 'black'                                                       \
    -set_xhairs OFF                                                          \
    -label_mode 1 -label_size 4                                              \
    -no_cor                                                                  \
    -do_clean                                                               

\rm ${tcoef}*

The code is from the ''do_21_ap_all.tcsh'' script, unchanged from when MACAQUE_DEMO is installed.

 -regress_stim_labels     ${stim_labs}                                 \
    -regress_opts_3dD                                                     \                                                      \
        -gltsym 'SYM: +FACE -SFACE'            -glt_label 1 +F-SF         \
        -gltsym 'SYM: +OBJ  -SOBJ'             -glt_label 2 +O-SO         \
        -gltsym 'SYM: +FACE -SFACE +OBJ -SOBJ' -glt_label 3 +INTACT-SCRAM \
        -gltsym 'SYM: +FACE -OBJ'              -glt_label 4 +F-O          \
        -gltsym 'SYM: +.5*FACE +.5*OBJ'        -glt_label 5 +.5FO         \
    -regress_basis            'MIONN(36)'                

Hello,

If you look at those same stats using afni in the results directory, does it show something?

It might just be that you do not have the 'bc' program (which is a surprise, it seemed to be ubiquitous). What OS and version are you using?

  • rick

Hello rickr,

I'm running the afni command through WSL 2 (Ubuntu 22.04.2) on windows 10 as well as using the docker container version. AFNI version is AFNI_23.1.10.

These are the windows I get when I load the ''stats.sub-000.tlrc'' file on AFNI:

Thanks for OS info. It looks like one set of Ubuntu 22 instructions includes 'bc' (OS_notes.linux_ubuntu_22_64_a_admin.txt), while the other does not (OS_notes.linux_ubuntu_22_64). I have added it to the missing one.

So please install 'bc':

sudo apt-get install bc

Thanks,

  • rick

Hi rickr,

The ''bc command'' indeed seemed to be the issue. I reran the afni_proc.py script and it generated the expected results in the QC folder.

Thank you for the help.

That's good news, thanks!

  • rick