Program suggestion for analysis

Hi AFNI
I was wondering if you can suggest me which of your programs could help me to identify clinical correlations between fMRI data and clinical scores but having as covariates age, gender and voxel wise map of gray matter concentration for each subject.

In other words I want to know if one of my clinical scores (grief_score) can be predicted by the fMRI activations of my task. Considering that I am working with older adults, I have to add as a covariate the age, gender and the gray matter concentration per voxel per subject (this is a .nii file).

Thank you for your help

Is your model like the following?

grief_score ~ brain_ activation + age + gender + gray_matter_ concentration

Hello Gang yes!

grief_score ~ brain_ activation (per voxel) + age + gender + gray_matter_ concentration (per voxel)

You can try this. First, create a 3D volume data for each subject:

3dcalc -a brainMask -expr ‘Subject1_grief_score*step(a)’ -prefix …

Then use 3dttest++ and treat “brain_ activation” and “gray_matter_ concentration” as two voxel-wise covariates.

Probably I didn’t explain correctly. My grief_score is the score of one of my clinical test, just a number. I want to know if this score can be predicted or have any correlation with the activation maps of my fMRI task, including the gray matter concentration (per voxel), age and gender as covariates.

If I include my faces_gr_shapes_avg.nii as a covariate in the 3dttest++, what can I use as the input in the script?

3dttest++ -mask GM2mm_WFU_Mask.nii.gz
-prefix 2Faces_HighvsLow_WholeBrainMask
-covariates /rcc/stor1/projects/GerDep/Luisa/scripts/Preprocess/task/group_stats/covariates_3dttest.txt"[0,1,2,3,5]"
-center SAME
-setA HighGrief 230 ${EMOTIONDIR}/230_011116/results_skullstrip/faces_gr_shapes_avg.nii
243 ${EMOTIONDIR}/243_100716/results_skullstrip/faces_gr_shapes_avg.nii
244 ${EMOTIONDIR}/244_091616/results_skullstrip/faces_gr_shapes_avg.nii \

My grief_score is the score of one of my clinical test, just a number.

That’s what I thought and why I suggested to convert your grief_score to a 3D volume for each subject:

3dcalc -a brainMask -expr ‘Subject1_grief_score*step(a)’ -prefix grief_score

In doing so, you have the same grief_score at the every voxel in the brain, and then you can use the 3D grief_score as input for 3dttest++.

Hi Gang!!! I did what you suggest but I am having the following error: ERROR: -permute failure for unexplainable reasons /:frowning:

Also, would you mind to suggest me how to interpret these results assuming the 3dtest++ is running without errors?

(base) lbohorquez@PSYC-CRI-10822:~/Desktop/RCC_no$ ./3dttest_ANGER_regression.sh
++ 3dttest++: AFNI version=AFNI_20.1.06 (May 4 2020) [64-bit]
++ Authored by: Zhark++
++ 74434 voxels in -mask dataset
++ Covariates file: 6 columns, each with 53 rows

  • Covariate column labels: subj;gender;age;daysSinceLoss;gm;anger
  • Found 3 numeric columns: gender age daysSinceLoss
  • Found 2 dataset name columns: gm anger
    ++ Number of -Clustsim threads set to 24
    ++ option -setA :: processing as LONG form (label label dset label dset …)
    ++ have 30 volumes corresponding to option ‘-setA’
    ++ option -setB :: processing as LONG form (label label dset label dset …)
    ++ have 23 volumes corresponding to option ‘-setB’
    ++ 2-sample test: ‘-AminusB’ option is assumed
    ++ 2-sample test: results will be HighGrief - LowGrief
    ++ loading covariates
    *+ WARNING: 3dttest++ -setB covariate #4 :: 125 vectors are constant
    *+ WARNING: 3dttest++ -setA covariate #4 :: 80 vectors are constant
    ** ERROR: -permute failure for unexplainable reasons /:frowning:
    ++ Two samples: t-testing fixed covariates for similarity between groups
  • gender: mean of setA-setB=0.402899 ; 2-sided p-value=0.1241
  • age: mean of setA-setB=-1.788406 ; 2-sided p-value=0.4839
  • daysSinceLoss: mean of setA-setB=49.36377 ; 2-sided p-value=0.0504
  • gm: values come from datasets ==> skipping test
  • anger: values come from datasets ==> skipping test
    ++ loading -setA datasets
    *+ WARNING: 3dttest++ -setA :: 30 volumes are constant
    ++ loading -setB datasets
    *+ WARNING: 3dttest++ -setB :: 30 volumes are constant
    ++ t-testing:0123456789.0123456789.0123456789.0123456789.0123456789.!
    ++ ---------- End of analyses – freeing workspaces ----------
    ++ Creating FDR curves in output dataset
    ++ Smallest FDR q [1 HighGrief-LowGrief_Zscr] = 8.75693e-13
    *+ WARNING: Smallest FDR q [3 HighGrief-LowGrief_gender_Zscr] = 0.845485 ==> few true single voxel detections
    *+ WARNING: Smallest FDR q [5 HighGrief-LowGrief_age_Zscr] = 0.737125 ==> few true single voxel detections
    *+ WARNING: Smallest FDR q [7 HighGrief-LowGrief_daysSinceLos_Zscr] = 0.820422 ==> few true single voxel detections
    ++ Smallest FDR q [9 HighGrief-LowGrief_gm_Zscr] = 2.01046e-12
    *+ WARNING: Smallest FDR q [11 HighGrief-LowGrief_anger_Zscr] = 0.998594 ==> few true single voxel detections
    ++ Smallest FDR q [13 HighGrief_Zscr] = 1.04776e-15
    *+ WARNING: Smallest FDR q [15 HighGrief_gender_Zscr] = 0.609763 ==> few true single voxel detections
    *+ WARNING: Smallest FDR q [17 HighGrief_age_Zscr] = 0.999329 ==> few true single voxel detections
    *+ WARNING: Smallest FDR q [19 HighGrief_daysSinceLos_Zscr] = 0.996382 ==> few true single voxel detections
    ++ Smallest FDR q [21 HighGrief_gm_Zscr] = 1.97659e-12
    *+ WARNING: Smallest FDR q [23 HighGrief_anger_Zscr] = 0.999863 ==> few true single voxel detections
    ++ Smallest FDR q [25 LowGrief_Zscr] = 3.13504e-07
    ++ Smallest FDR q [27 LowGrief_gender_Zscr] = 0.00888113
    *+ WARNING: Smallest FDR q [29 LowGrief_age_Zscr] = 0.638056 ==> few true single voxel detections
    *+ WARNING: Smallest FDR q [31 LowGrief_daysSinceLos_Zscr] = 0.849133 ==> few true single voxel detections
    ++ Smallest FDR q [33 LowGrief_gm_Zscr] = 0.000260319
    *+ WARNING: Smallest FDR q [35 LowGrief_anger_Zscr] = 0.999875 ==> few true single voxel detections
  • Added 18 FDR curves to dataset
    ++ Output dataset ./Griefpredicted_anger_highvslow.resid.nii
  • 2-sample test: results are HighGrief - LowGrief
    ++ ================ Starting -Clustsim calculations ================
  • === temporary files will have prefix Griefpredicted_anger_highvslow ===
  • === running 24 -randomsign jobs (417 iterations per job) ===
  • === creating 1,488,680,000 (1.5 billion) bytes of pseudo-data in .sdat files ===
  • — 3dClustSim reads .sdat files to compute cluster-threshold statistics —
  • — there is 34,359,738,368 (34 billion) bytes of memory on your system —
    ++ 3dttest++: AFNI version=AFNI_20.1.06 (May 4 2020) [64-bit]
    ++ Authored by: Zhark++
    ++ 74434 voxels in -mask dataset
    ++ Covariates file: 6 columns, each with 53 rows
  • Covariate column labels: subj;gender;age;daysSinceLoss;gm;anger
  • Found 3 numeric columns: gender age daysSinceLoss
  • Found 2 dataset name columns: gm anger
    ++ option -setA :: processing as LONG form (label label dset label dset …)
    ++ have 30 volumes corresponding to option ‘-setA’
    ++ option -setB :: processing as LONG form (label label dset label dset …)
    ++ have 23 volumes corresponding to option ‘-setB’
    ++ random seeds are 1403444933 1717604198
    ++ 2-sample test: ‘-AminusB’ option is assumed
    ++ 2-sample test: results will be rAAA - rBBB
    ++ loading covariates
    *+ WARNING: 3dttest++ -setB covariate #4 :: 125 vectors are constant
    *+ WARNING: 3dttest++ -setA covariate #4 :: 80 vectors are constant
    ** ERROR: -permute failure for unexplainable reasons /:frowning:
    ++ Two samples: t-testing fixed covariates for similarity between groups
  • gender: mean of setA-setB=0.402899 ; 2-sided p-value=0.1241
  • age: mean of setA-setB=-1.788406 ; 2-sided p-value=0.4839
  • daysSinceLoss: mean of setA-setB=49.36377 ; 2-sided p-value=0.0504
  • gm: values come from datasets ==> skipping test
  • anger: values come from datasets ==> skipping test
    ++ opened file ./Griefpredicted_anger_highvslow.0000.sdat for output
    ++ loading -setA datasets
    ++ loading -setB datasets
    ++ t-test randomsign/permute:0123456789.0123456789.0123456789.0123456789.0123456789.01!
    ++ saving main effect t-stat MIN/MAX values in ./Griefpredicted_anger_highvslow.0000.minmax.1D
    ++ output short-ized file ./Griefpredicted_anger_highvslow.0000.sdat
  • 3dttest++ ===== simulation jobs have finished (4405.5 s elapsed)
  • 3dttest++ ===== starting 3dClustSim A: elapsed = 4416.0 s
    ++ 3dClustSim: AFNI version=AFNI_20.1.06 (May 4 2020) [64-bit]
    ++ Authored by: RW Cox and BD Ward
    ++ Loading -insdat datasets
    ++ -insdat had 10008 volumes = new ‘-niter’ value
    ++ Startup clock time = 0.0 s
    ++ Using 15 OpenMP threads
    Simulating:0123456789.0123456789.0123456789.0123456789.01234567!
    ++ Clock time now = 583.8 s
    ++ Command fragment to put cluster results into a dataset header;
  • (also echoed to file Griefpredicted_anger_highvslow.CSimA.cmd for your scripting pleasure)
  • Append the name of the datasets to be patched to this command:
    3drefit -atrstring AFNI_CLUSTSIM_NN1_1sided file:Griefpredicted_anger_highvslow.CSimA.NN1_1sided.niml -atrstring AFNI_CLUSTSIM_NN2_1sided file:Griefpredicted_anger_highvslow.CSimA.NN2_1sided.niml -atrstring AFNI_CLUSTSIM_NN3_1sided file:Griefpredicted_anger_highvslow.CSimA.NN3_1sided.niml -atrstring AFNI_CLUSTSIM_NN1_2sided file:Griefpredicted_anger_highvslow.CSimA.NN1_2sided.niml -atrstring AFNI_CLUSTSIM_NN2_2sided file:Griefpredicted_anger_highvslow.CSimA.NN2_2sided.niml -atrstring AFNI_CLUSTSIM_NN3_2sided file:Griefpredicted_anger_highvslow.CSimA.NN3_2sided.niml -atrstring AFNI_CLUSTSIM_NN1_bisided file:Griefpredicted_anger_highvslow.CSimA.NN1_bisided.niml -atrstring AFNI_CLUSTSIM_NN2_bisided file:Griefpredicted_anger_highvslow.CSimA.NN2_bisided.niml -atrstring AFNI_CLUSTSIM_NN3_bisided file:Griefpredicted_anger_highvslow.CSimA.NN3_bisided.niml
    ++ Environment variable AFNI_DONT_LOGFILE already set to ‘NO’. Value of ‘YES’ from /Users/lbohorquez/.afnirc is ignored.
    To kill such warnings Set AFNI_ENVIRON_WARNINGS to NO
    ++ 3drefit: AFNI version=AFNI_20.1.06 (May 4 2020) [64-bit]
    ++ Authored by: RW Cox
    ++ Processing AFNI dataset ./Griefpredicted_anger_highvslow+tlrc.HEAD
  • atrcopy
    ++ applying attributes
    ++ 3drefit processed 1 datasets
    ++ 3dttest++ ----- Cleaning up intermediate files:
    Griefpredicted_anger_highvslow.resid.nii
    ./Griefpredicted_anger_highvslow.0000.sdat
    ./Griefpredicted_anger_highvslow.0001.sdat
    ./Griefpredicted_anger_highvslow.0002.sdat
    ./Griefpredicted_anger_highvslow.0003.sdat
    ./Griefpredicted_anger_highvslow.0004.sdat
    ./Griefpredicted_anger_highvslow.0005.sdat
    ./Griefpredicted_anger_highvslow.0006.sdat
    ./Griefpredicted_anger_highvslow.0007.sdat
    ./Griefpredicted_anger_highvslow.0008.sdat
    ./Griefpredicted_anger_highvslow.0009.sdat
    ./Griefpredicted_anger_highvslow.0010.sdat
    ./Griefpredicted_anger_highvslow.0011.sdat
    ./Griefpredicted_anger_highvslow.0012.sdat
    ./Griefpredicted_anger_highvslow.0013.sdat
    ./Griefpredicted_anger_highvslow.0014.sdat
    ./Griefpredicted_anger_highvslow.0015.sdat
    ./Griefpredicted_anger_highvslow.0016.sdat
    ./Griefpredicted_anger_highvslow.0017.sdat
    ./Griefpredicted_anger_highvslow.0018.sdat
    ./Griefpredicted_anger_highvslow.0019.sdat
    ./Griefpredicted_anger_highvslow.0020.sdat
    ./Griefpredicted_anger_highvslow.0021.sdat
    ./Griefpredicted_anger_highvslow.0022.sdat
    ./Griefpredicted_anger_highvslow.0023.sdat
    Griefpredicted_anger_highvslow.CSimA.NN1_1sided.niml
    Griefpredicted_anger_highvslow.CSimA.NN1_2sided.niml
    Griefpredicted_anger_highvslow.CSimA.NN1_bisided.niml
    Griefpredicted_anger_highvslow.CSimA.NN2_1sided.niml
    Griefpredicted_anger_highvslow.CSimA.NN2_2sided.niml
    Griefpredicted_anger_highvslow.CSimA.NN2_bisided.niml
    Griefpredicted_anger_highvslow.CSimA.NN3_1sided.niml
    Griefpredicted_anger_highvslow.CSimA.NN3_2sided.niml
    Griefpredicted_anger_highvslow.CSimA.NN3_bisided.niml
  • 3dttest++ =============== -Clustsim work is finished :slight_smile: ===============
    ++ ----- 3dttest++ says so long, farewell, and happy trails to you :slight_smile: -----

would you mind to suggest me how to interpret these results assuming the 3dtest++ is running without errors?

Did you get an output from 3dttest++ aside from the whining part? I suspect that 3dttest++ could not perform permutations because of the two voxelwise covariates, but only Bob could address the issue. You could still interpret the results independent of the permutation component.