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  

|
August 21, 2003 10:47AM
Dear intrepid AFNI minds,

I am trying to generate a general linear model bucket dataset from a 3d+time dataset which will isolate brain regions of selective area-under-curve activations in response to different stimuli, here denoted by color codes. The "ant" series of stimuli are at set times in the paradigm and waveforms were generated easily using by applying waver to a source column of 0's and 1's ateach TR. Conversely, the "press" series of stimuli were actually free-will responses, from which I have custom generated -GAM waveforms using the -tstim option of waver based on the cumulative seconds into the scan at which they occurred.

To avoid 3T-1 meltdown, the task is divided up into three, 230-rep runs (3 X 224 after truncation of starting and ending images). I am using the -concat option of 3dDeconvolve, with a "runs.1D" file specifying the beginning acquisition volume number of each run. The source image slices had been concatenated into one 3d+time EPIRT dataset.

Drawing inspiration from 3dDeconvolve manual example 1.4.4.6 (p.47) together with a suggestion from Gang Chen (c.f. earlier post), I concocted the following script:

foreach subject ( jls )
#foreach subject ( jls jms as ro gp jk sh )
cd ../${subject}*
if ( -e gltreg+orig.BRIK ) then
rm -rf gltreg+*
endif
3dDeconvolve \
-input carpdsbpf+orig \
-concat ../vectors/runs.1D -nfirst 0 -num_stimts 14 \
-polort 1 \
-stim_file 1 ../vectors/'whiteant.1D' -stim_label 1 'whiteant' \
-stim_file 2 ../vectors/'greenant.1D' -stim_label 2 'greenant' \
-stim_file 3 ../vectors/'yellowant.1D' -stim_label 3 'yelant' \
-stim_file 4 ../vectors/'redant.1D' -stim_label 4 'redant' \
-stim_file 5 'whtpress2.1D' -stim_label 5 'whtpress2' \
-stim_file 6 'grnpress2.1D' -stim_label 6 'grnpress2' \
-stim_file 7 'yelpress2.1D' -stim_label 7 'yelpress2' \
-stim_file 8 'redpress2.1D' -stim_label 8 'redpress2' \
-stim_file 9 '3dmotion.1D[1]' -stim_label 9 'roll' \
-stim_file 10 '3dmotion.1D[2]' -stim_label 10 'pitch' \
-stim_file 11 '3dmotion.1D[3]' -stim_label 11 'yaw' \
-stim_file 12 '3dmotion.1D[4]' -stim_label 12 'dS' \
-stim_file 13 '3dmotion.1D[5]' -stim_label 13 'dL' \
-stim_file 14 '3dmotion.1D[6]' -stim_label 14 'dP' \
-tout -bucket gltreg \
-glt 1 ../vectors/gvwant.mat -glt_label 1 'gvwant' \
-glt 1 ../vectors/yvgant.mat -glt_label 2 'yvgant' \
-glt 1 ../vectors/rvyant.mat -glt_label 3 'rvyant' \
-glt 1 ../vectors/gvwpress2.mat -glt_label 4 'gvwpress2' \
-glt 1 ../vectors/yvgpress2.mat -glt_label 5 'yvgpress2' \
-glt 1 ../vectors/rvypress2.mat -glt_label 6 'rvypress2'

cd ../scripts
end

The glt rows pertain to my contrasts of interest ("v" meaning versus). Each matrix source file is a single row of twenty space-separated digits: eighteen 0's, a single 1 for the "active" condition, and a single "-1" for the contrasting condition. An example is this intended matrix for comparing response under green (stim 6) with response under control white (stim 5),(the "gvwpress2" contrast):

0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0

where the first six zeroes pertain to the baseline and trend of each of the three runs, respectively, and the -1 and 1 pertain to the subsequent stimfiles of interest.

So why did 3dDeconvolve give me a:

"Improper X matrix (Cannot invert X'X)" error?

Can someone tell me what I did wrong? How would I write a .mat file to specify a contrast between "grnpress2" and "whtpress2" experimental conditions so as to see where in the brain was "grn" responsive contrasted with "wht"?

Jim B.

Subject Author Posted

Matrix error

Jim Bjork August 21, 2003 10:47AM

Re: Matrix error

Gang Chen August 21, 2003 12:11PM

Et viola

Jim Bjork August 21, 2003 01:02PM