Dear AFNI minds,
I rely on linear contrasts from -glt 1 matrix files to compare conditions in order to detect "activation" from differences in AUC.
When it comes to plotting out actual stimulus-elicited impulse response functions, I have relied on a fairly cumbersome method. However, I noticed that the -iresp operator in 3dDeconvolve will generate a 3d+time dataset for each stimulus class (stimfile), which would be very amenable to dumping out values for graphing.
My traditional 3dDeconvolve script has never specified -minlag or -maxlag, and simply invokes a canonical HRF stim_file as generated by waver. However, I discovered that to generate an iresp dataset, I need to specify the number of acquisitions (lags) considered for each stimulus occurance, and have modified my script thus:
foreach subject ( te )
cd ../${subject}*
if ( ! -e TimeSerAvg+orig.BRIK ) then
3dTstat -prefix TimeSerAvg fradsbpf+orig
3drefit -abuc TimeSerAvg+orig
endif
if ( ! -e normalized+orig.BRIK ) then
3dcalc -datum float -a fradsbpf+orig -b TimeSerAvg+orig -expr "((a-b)/b)*100" -prefix normalized
endif
if ( -e ttestreg_cue+orig.BRIK ) then
rm -rf ttestreg_cue+*
endif
3dDeconvolve \
-input normalized+orig \
-concat ../vectors/runs.1D -nfirst 0 -num_stimts 20 \
-mask 3dCL_mask+orig \
-num_glt 21 \
-polort 1 \
-stim_file 1 ../vectors_maxlag7/'cue_noresp_neu.1D' -stim_maxlag 1 7 -stim_label 1 'antnr_neu' \
-stim_file 2 ../vectors_maxlag7/'cue_noresp_mys.1D' -stim_maxlag 2 7 -stim_label 2 'antnr_mys' \
-stim_file 3 ../vectors_maxlag7/'cue_noresp_gain.1D' -stim_maxlag 3 7 -stim_label 3 'antnr_rew' \
-stim_file 4 ../vectors_maxlag7/'cue_resp_neu.1D' -stim_maxlag 4 7 -stim_label 4 'antres_neu' \
-stim_file 5 ../vectors_maxlag7/'cue_resp_mys.1D' -stim_maxlag 5 7 -stim_label 5 'antres_mys' \
-stim_file 6 ../vectors_maxlag7/'cue_resp_gain.1D' -stim_maxlag 6 7 -stim_label 6 'antres_rew' \
-stim_file 7 ../vectors_maxlag7/'fbk_noresp_neu.1D' -stim_maxlag 7 7 -stim_label 7 'fbknr_neu' \
-stim_file 8 ../vectors_maxlag7/'fbk_noresp_mys_nogain.1D' -stim_maxlag 8 7 -stim_label 8 'fbknr_mnw' \
-stim_file 9 ../vectors_maxlag7/'fbk_noresp_mys_gain.1D' -stim_maxlag 9 7 -stim_label 9 'fbknr_mw' \
-stim_file 10 ../vectors_maxlag7/'fbk_noresp_gain.1D' -stim_maxlag 10 7 -stim_label 10 'fbknr_rew' \
-stim_file 11 ../vectors_maxlag7/'fbk_resp_neu.1D' -stim_maxlag 11 7 -stim_label 11 'fbkres_neu' \
-stim_file 12 ../vectors_maxlag7/'fbk_resp_mys_nogain.1D' -stim_maxlag 12 7 -stim_label 12 'fbkres_mnw' \
-stim_file 13 ../vectors_maxlag7/'fbk_resp_mys_gain.1D' -stim_maxlag 13 7 -stim_label 13 'fbkres_mw' \
-stim_file 14 ../vectors_maxlag7/'fbk_resp_gain.1D' -stim_maxlag 14 7 -stim_label 14 'fbkres_rew' \
-stim_file 15 '3dmotion.1D[1]' -stim_label 15 'roll' \
-stim_file 16 '3dmotion.1D[2]' -stim_label 16 'pitch' \
-stim_file 17 '3dmotion.1D[3]' -stim_label 17 'yaw' \
-stim_file 18 '3dmotion.1D[4]' -stim_label 18 'dS' \
-stim_file 19 '3dmotion.1D[5]' -stim_label 19 'dL' \
-stim_file 20 '3dmotion.1D[6]' -stim_label 20 'dP' \
-tout -bucket ttestreg_cue \
-glt 1 ../vectors_maxlag7/rvn_noresp.mat -glt_label 1 'ant_rvn_nr' \
-glt 1 ../vectors_maxlag7/mvn_noresp.mat -glt_label 2 'ant_mvn_nr' \
-glt 1 ../vectors_maxlag7/rmvn_noresp.mat -glt_label 3 'ant_rmvn_nr' \
-glt 1 ../vectors_maxlag7/mvrn_noresp.mat -glt_label 4 'ant_mvrn_nr' \
-glt 1 ../vectors_maxlag7/rvn_resp.mat -glt_label 5 'ant_rvn_res' \
-glt 1 ../vectors_maxlag7/mvn_resp.mat -glt_label 6 'ant_mvn_res' \
-glt 1 ../vectors_maxlag7/rmvn_resp.mat -glt_label 7 'ant_rmvn_r' \
-glt 1 ../vectors_maxlag7/mvrn_resp.mat -glt_label 8 'ant_mvrn_res' \
-glt 1 ../vectors_maxlag7/mvr_all.mat -glt_label 9 'ant_mvr_all' \
-glt 1 ../vectors_maxlag7/n_rspvnorsp.mat -glt_label 10 'neuant_resvnr' \
-glt 1 ../vectors_maxlag7/m_rspvnorsp.mat -glt_label 11 'mysant_resvnr' \
-glt 1 ../vectors_maxlag7/r_rspvnorsp.mat -glt_label 12 'rewant_resvnr' \
-glt 1 ../vectors_maxlag7/resvnr_rvn.mat -glt_label 13 'HO_resvnr_rvn' \
-glt 1 ../vectors_maxlag7/resvnr_rmvn.mat -glt_label 14 'HO_resvnr_rmvn' \
-glt 1 ../vectors_maxlag7/fbk_mysvneu.mat -glt_label 15 'fbk_mysvneu' \
-glt 1 ../vectors_maxlag7/fbk_rewvneu.mat -glt_label 16 'fbk_rewvneu' \
-glt 1 ../vectors_maxlag7/fbk_mysvrew.mat -glt_label 17 'fbk_mysvrew' \
-glt 1 ../vectors_maxlag7/fbk_winvnowin_resp.mat -glt_label 18 'fbk_winvnw_resp' \
-glt 1 ../vectors_maxlag7/fbk_winvnowin_noresp.mat -glt_label 19 'fbk_winvnw_nr' \
-glt 1 ../vectors_maxlag7/fbk_winvnowin_allmys.mat -glt_label 20 'fbk_winvnw_all' \
-glt 1 ../vectors_maxlag7/fbk_gainvnongain.mat -glt_label 21 'fbk_gainvnongain' \
-iresp 1 antnr_neu \
-iresp 2 antnr_mys \
-iresp 3 antnr_rew \
-iresp 4 antres_neu \
-iresp 5 antres_mys \
-iresp 6 antres_rew \
-iresp 7 fbknr_neu \
-iresp 8 fbknr_mnw \
-iresp 9 fbknr_mw \
-iresp 10 fbknr_rew \
-iresp 11 fbkres_neu \
-iresp 12 fbkres_mnw \
-iresp 13 fbkres_mw \
-iresp 14 fbkres_rew
cd ../scripts
end
So, does this mean I will have to change my matrix file for the first linear contrast from
0 0 0 0 0 0 -1 0 1 0 0 0 0 etc.....
to
0 0 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0.... etc?
It seems this setup is causing warnings of collinearity, but 3dDeconvolve is looking for a 1 X 124 matrix.
Do I have to make a matrix instead that looks like this:
0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0 etc....
0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0 ?
It seems this matrix is specifying separate comparisons at each time point of the lags, when all I need is a single auc comparison for the LC, and a dumpout of the HRF response to each -stim_file class.
Jim Bjork