AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
September 20, 2022 10:33AM
Hi there!
I've been trying to figure out how to use the -stim_times_FSL flags with afni_proc.py but am running into some trouble.

Here's an example afni_proc.py call — I'm including the whole thing, but the key elements correspond to the regress block. I'm passing the -stim_times_FSL flag through the -regress_opts_3dD option. After some initial testing, I discovered that I had to manually specify the number of stimulus times with the -num_stimts flag, which I also include in the -regress_opts_3dD option.
afni_proc.py -subj_id ${subj} \
    -script afni_proc_${subj}_alice.tcsh \
    -out_dir ${subj}_alice.proc_py \
    -dsets ${subj}_alice_MB_AP_run0*.nii \
    -blip_reverse_dset ${subj}_alice_SB_PA+orig. -blip_forward_dset ${subj}_alice_SB_AP_run04.nii \
    -blocks volreg mask scale regress \
    -volreg_align_to third \
    -regress_apply_mot_types basic \
    -regress_est_blur_epits \
    -regress_est_blur_errts \
    -regress_opts_3dD \
        -num_stimts 4 \
        -stim_times_FSL 1 ${directory}/timing/alice/cb${cb}/attend_hi.1D 'dmUBLOCK(1)'\
        -stim_label 1 attend_hi \
        -stim_times_FSL 2 ${directory}/timing/alice/cb${cb}/attend_lo.1D 'dmUBLOCK(1)'\
        -stim_label 2 attend_lo \
        -stim_times_FSL 3 ${directory}/timing/alice/cb${cb}/attend_left.1D 'dmUBLOCK(1)'\
        -stim_label 3 attend_left \
        -stim_times_FSL 4 ${directory}/timing/alice/cb${cb}/attend_right.1D 'dmUBLOCK(1)'\
        -stim_label 4 attend_right \
        -gltsym 'SYM: +attend_hi -attend_lo' \
        -glt_label 1 attend_hiVsLo \
        -gltsym 'SYM: +attend_left -attend_right' \
        -glt_label 2 attend_leftVsRight \
        -gltsym 'SYM: +attend_hi +attend_lo -attend_left -attend_right' \
        -glt_label 3 spectralVsSpatial \
    -execute


The 3dDeconvolve command that is generated by this command isn't quite what I want — specifically, there's an extraneous -num_stimts 0 line that gets added in, as well as an -x1D_stop option.

3dDeconvolve -input pb03.$subj.r*.scale+orig.HEAD                            \
    -ortvec dfile_rall.1D mot_basic                                          \
    -polort 3                                                                \
    -num_stimts 0                                                            \
    -num_stimts 4                                                            \
    -stim_times_FSL 1                                                        \
    /Volumes/BlackPanther/alice-in-fmriland/timing/alice/cb1/attend_hi.1D    \
    'dmUBLOCK(1)'                                                            \
    -stim_label 1 attend_hi                                                  \
    -stim_times_FSL 2                                                        \
    /Volumes/BlackPanther/alice-in-fmriland/timing/alice/cb1/attend_lo.1D    \
    'dmUBLOCK(1)'                                                            \
    -stim_label 2 attend_lo                                                  \
    -stim_times_FSL 3                                                        \
    /Volumes/BlackPanther/alice-in-fmriland/timing/alice/cb1/attend_left.1D  \
    'dmUBLOCK(1)'                                                            \
    -stim_label 3 attend_left                                                \
    -stim_times_FSL 4                                                        \
    /Volumes/BlackPanther/alice-in-fmriland/timing/alice/cb1/attend_right.1D \
    'dmUBLOCK(1)'                                                            \
    -stim_label 4 attend_right                                               \
    -gltsym 'SYM: +attend_hi -attend_lo'                                     \
    -glt_label 1 attend_hiVsLo                                               \
    -gltsym 'SYM: +attend_left -attend_right'                                \
    -glt_label 2 attend_leftVsRight                                          \
    -gltsym 'SYM: +attend_hi +attend_lo -attend_left -attend_right'          \
    -glt_label 3 spectralVsSpatial                                           \
    -fout -tout -x1D X.xmat.1D -xjpeg X.jpg                                  \
    -fitts fitts.$subj                                                       \
    -errts errts.${subj}                                                     \
    -x1D_stop                                                                \
    -bucket stats.$subj


I think that because there aren't any stimulus timing files specified outside of the -regress_opts_3dD flag, afni_proc.py is assuming that I don't have any stimulus timing files and automatically adding the -num_stimts 0 flag. Based on the (correct) design matrix that gets generated, it seems that the -num_stimts 4 flag is overwriting this.

The bigger problem is that because the -x1D_stop option is invoked, 3dDeconvolve exits out.

I could manually edit the AFNI commands that are generated by afni_proc.py to remove the two problematic lines (-num_stimts 0 and -x1D_stop) — and indeed, if I do, the 3dDeconvolve command runs perfectly. But I'm wondering if there is something I can add to my afni_proc.py command so that the 3dDeconvolve command gets generated properly.

Thanks!

--
Sahil Luthra, Ph.D. (he/him/his)
Postdoctoral Researcher, Carnegie Mellon University
email: sahil.bamba.luthra@gmail.com
website: sahilluthra.net
Subject Author Posted

Using stim_times_FSL with afni_proc.py

Sahil Luthra September 20, 2022 10:33AM

Re: Using stim_times_FSL with afni_proc.py

rick reynolds September 22, 2022 05:02PM

Re: Using stim_times_FSL with afni_proc.py

Sahil Luthra October 20, 2022 11:54AM