concatenating runs in 3dDeconvolve for PPI analysis

Hi, I’m running a traditional (not gPPI) PPI analysis using 3dDeconvolve. I want to do this across four runs per subject, so I am trying to concatenate all runs in time by inputting them all into 3dDeconvolve at once, but the design matrix i get out is not what i expected. Could someone tell me what I’m doing wrong?

my 3dDeconvolve script is as follows for one subject and their four runs:


3ddeconvolve -polort A -jobs 1 
-mask preproc/sub-002/func/sub-002_task-sexemo_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz 
-input preproc/sub-002/func/sub-002_task-sexemo_run-01_smoothed.nii.gz preproc/sub-002/func/sub-002_task-sexemo_run-02_smoothed.nii.gz preproc/sub-002/func/sub-002_task-sexemo_run-03_smoothed.nii.gz preproc/sub-002/func/sub-002_task-sexemo_run-04_smoothed.nii.gz 
-bucket analysis/func_conn/average/nSynth_face_rFG/sub-002_bucket.nii.gz 
-fout -tout -rout 
-xjpegpreproc/sub-002/func/sub-002_designmatrix.jpg 
-nfirst 0 -num_stimts 13 
-stim_times 1 preproc/events_subliminal.1D 'GAM' -stim_label 1 subliminal 
-stim_times 2 preproc/events_supraliminal.1D 'GAM' -stim_label 2 supraliminal
-stim_file 3 analysis/GLM_1Ds/sub-002_confounds_csf.1D -stim_base 3 -stim_label 3 csf 
-stim_file 4 analysis/GLM_1Ds/sub-002_confounds_global_signal.1D -stim_base 4 -stim_label 4 global_signal 
-stim_file 5 analysis/GLM_1Ds/sub-002_confounds_rot_x.1D -stim_base 5 -stim_label 5 rot_x 
-stim_file 6 analysis/GLM_1Ds/sub-002_confounds_rot_y.1D -stim_base 6 -stim_label 6 rot_y 
-stim_file 7 analysis/GLM_1Ds/sub-002_confounds_rot_z.1D -stim_base 7 -stim_label 7 rot_z 
-stim_file 8 analysis/GLM_1Ds/sub-002_confounds_trans_x.1D -stim_base 8 -stim_label 8 trans_x 
-stim_file 9 analysis/GLM_1Ds/sub-002_confounds_trans_y.1D -stim_base 9 -stim_label 9 trans_y 
-stim_file 10 analysis/GLM_1Ds/sub-002_confounds_trans_z.1D -stim_base 10 -stim_label 10 trans_z 
-stim_file 11 analysis/GLM_1Ds/sub-002_confounds_white_matter.1D -stim_base 11 -stim_label 11 white_matter 
-stim_file 12 preproc/sub-002/func/sub-002_seed_ts_all_nSynth_face_rFG.1D -stim_label 12 Seed_ts 
-stim_file 13 preproc/sub-002/func/sub-002_inter_ts_nSynth_face_rFG.1D -stim_label 13 Inter_ts 

Which to my mind should output a Design matrix of 13868 (868 = n TRs, since 217 per run and 2174 =868) and 13 columns, since we have 13 stim files (4 regressors of interest including the PPI regressors and 9 confound variables). However, the design matrix i get out (attached) has 29 columns, some of which I have no idea about. Moreover, the pattern for what I think are the regressors of interest seem to be repeating across runs, rather than being different for each run. I am inputting event timing 1D files that are 868 length, i.e. the length of all 4 runs combined. Perhaps its reading only the first 217 for each run? How do I specify different event files for each run in this case, whilst still concatenating runs in time within 3dDeconvolve (i.e. not having to do separate 3dDeconvolve scripts for each run).

I’ve attached the design matrix for this subject for your reference, the last 9 columns appear to be the confound regressors, but what are the preceding 20? Hace I done this correctly?

Thank you!

Ok, so I realised my stim event files needed to have as many rows as runs with a * to indicate if there were none of that stim class in that run.

With that changed, my DM has slightly (attached). But it still eems as if something is going wrong with interpreting the timings in the runs, for example i get these warnings when running 3dDeconvolve:


++ Auto-catenated input datasets treated as multiple imaging runs
++ Auto-catenated datasets start at:  0 217 434 651
++ Skipping check for initial transients
++ Imaging duration=434.0 s; Automatic polort=3
++ -stim_times using TR=2 s for stimulus timing conversion
++ -stim_times using TR=2 s for any -iresp output datasets
++  [you can alter the -iresp TR via the -TR_times option]
++ ** -stim_times NOTE ** guessing GLOBAL times if 1 time per line; LOCAL otherwise
++ ** GUESSED ** -stim_times 1 using LOCAL times
++ ** GUESSED ** -stim_times 2 using LOCAL times
*+ WARNING: '-stim_times 2' (LOCAL) run#3 has 109 times outside range 0 .. 432 [PSFB syndrome]
 + dataset TR being used is 2 s -- unusable times follow
 434 436 438 440 442 444 446 448 450 452 454 456 458 460 462 464 466 468 470 472 474 476 478 480 482 484 486 488 490 492 494 496 498 500 502 504 506 508 510 512 514 516 518 520 522 524 526 528 530 532 534 536 538 540 542 544 546 548 550 552 554 556 558 560 562 564 566 568 570 572 574 576 578 580 582 584 586 588 590 592 594 596 598 600 602 604 606 608 610 612 614 616 618 620 622 624 626 628 630 632 634 636 638 640 642 644 646 648 650
*+ WARNING: '-stim_times 2' (LOCAL) run#4 has 108 times outside range 0 .. 432 [PSFB syndrome]
 + dataset TR being used is 2 s -- unusable times follow
 652 654 656 658 660 662 664 666 668 670 672 674 676 678 680 682 684 686 688 690 692 694 696 698 700 702 704 706 708 710 712 714 716 718 720 722 724 726 728 730 732 734 736 738 740 742 744 746 748 750 752 754 756 758 760 762 764 766 768 770 772 774 776 778 780 782 784 786 788 790 792 794 796 798 800 802 804 806 808 810 812 814 816 818 820 822 824 826 828 830 832 834 836 838 840 842 844 846 848 850 852 854 856 858 860 862 864 866
*+ WARNING: !! '-stim_times 2' file 'preproc/events_supraliminal.1D' has no good stimulus time values
++ Number of time points: 868 (no censoring)
 + Number of parameters:  29 [25 baseline ; 4 signal]

My TRs are 2 seconds long, and there are 868 in total, which AFNI seems to be reading ok, since it says ‘Auto-concatenated datasets start at 0 217 434 651’ , but then it says the imaging duration is only 434.0s, which Im assuming is what’s causing the issues with the unusable times. Also note the first two runs are entirely one stim type, and the third and fourth are the other.

I changed the stim file times to local_times and changed the parameter in the 3ddeconvolve script and everything is fine!

That’s great! I gather you are satisfied for the 4 polort terms per run, then, too (first 16 regressors).

  • rick