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  

|
January 22, 2007 10:33AM
Hi,

I'm sorry, I don't quite understand. I have removed the nums 5 and 6, but I thought since I have four stimuli, I would need all 6 contrasts.

Also, I have made a new contrast folder to put the contrasts in. Right now I have contrasts (for my four stim types ABCD):

contrast_AB 0 0 1 -1 0 0
contrast_BC 0 0 0 1 -1 0
contrast_AC 0 0 1 0 -1 0
contrast_ABCD 0 0 1 1 1 -1

But it is still coming up: iteration: 000csh: nums: Subscript out of range.

I'm still not sure what I am doing wrong. My new script is below:

#!/bin/tcsh

# experiment parameters
set ts = 119 # length of timeseries
set stim = 4 # number of input stimuli
set num_on = 17 # time points per stimulus (between 0 and $ts/3)

# execution parameters
set iterations = 100 # number of iterations
set seed = 1234567 # initial random seed
set outdir = stim_results
set LCfile = $outdir/LC_sums

# ------------------------------------------------------------
# make sure $outdir exists

if ( ! -d $outdir ) then
mkdir $outdir
if ( $status ) then
echo "failure, cannot create output directory, $outdir"
exit
endif
endif

# create empty LC file
echo -n "" > $LCfile

echo -n "iteration: 000"

# ------------------------------------------------------------
# run the test many times

foreach iter (`count -digits 3 1 $iterations`)

# make some other random seed

@ seed = $seed + 1

# create random order stim files

RSFgen -nt ${ts} \
-num_stimts ${stim} \
-nreps 1 ${num_on} \
-nreps 2 ${num_on} \
-nreps 3 ${num_on} \
-nreps 4 34 \
-seed ${seed} \
-prefix RSF.stim.${iter}. >& /dev/null

# from the random order stim files, make ideal reference functions

waver -GAM -dt 2.0 -input RSF.stim.${iter}.1.1D > wav.hrf.${iter}.1.1D
waver -GAM -dt 2.0 -input RSF.stim.${iter}.2.1D > wav.hrf.${iter}.2.1D
waver -GAM -dt 2.0 -input RSF.stim.${iter}.3.1D > wav.hrf.${iter}.3.1D
waver -GAM -dt 2.0 -input RSF.stim.${iter}.4.1D > wav.hrf.${iter}.4.1D

# now evaluate the stimulus timings

3dDeconvolve \
-nodata \
-nfirst 4 \
-nlast 118 \
-polort 1 \
-num_stimts ${stim} \
-stim_file 1 "wav.hrf.${iter}.1.1D" \
-stim_label 1 "stim_A" \
-stim_file 2 "wav.hrf.${iter}.2.1D" \
-stim_label 2 "stim_B" \
-stim_file 3 "wav.hrf.${iter}.3.1D" \
-stim_label 3 "stim_C" \
-stim_file 1 "wav.hrf.${iter}.4.1D" \
-stim_label 1 "stim_D" \
-glt 1 contrasts/contrast_AB \
-glt 1 contrasts/contrast_AC \
-glt 1 contrasts/contrast_BC \
-glt 1 contrasts/contrast_ABCD \
>& 3dD.nodata.${iter}

# save the sum of the 3 LC values
set nums = ( `awk -F= '/LC/ {print $2 * 10000}' 3dD.nodata.${iter}` )
@ num_sum = $nums[1] + $nums[2] + $nums[3] + $nums[4]

echo -n "$num_sum = $nums[1] + $nums[2] + $nums[3] + $nums[4] : " >> $LCfile
echo "iteration $iter, seed $seed" >> $LCfile

mv RSF.stim.*.1D wav.hrf.*.1D 3dD.nodata* $outdir

echo -n "\b\b\b$iter"
end

echo ""
echo "done, results are in '$outdir', LC sums are in '$LCfile'"
echo consider the command: "sort $LCfile | head -1"


Thanks,

Erin
Subject Author Posted

RSFgen - issue with script

Erin Skinner January 19, 2007 01:51PM

Re: RSFgen - issue with script

Erin Skinner January 19, 2007 01:55PM

Re: RSFgen - issue with script

Erin Skinner January 19, 2007 03:40PM

Re: RSFgen - issue with script

rick reynolds January 19, 2007 03:59PM

Re: RSFgen - issue with script

Erin Skinner January 22, 2007 10:33AM

Re: RSFgen - issue with script

Tracy Jill April 12, 2007 01:42PM

Re: RSFgen - issue with script

Tracy Jill April 12, 2007 02:10PM

Re: RSFgen - issue with script

rick reynolds April 12, 2007 02:22PM

Re: RSFgen - issue with script

Zhaohui June 04, 2007 01:57PM

Re: RSFgen - issue with script

rick reynolds June 04, 2007 02:02PM

Re: RSFgen - issue with script

Zhaohui June 04, 2007 02:06PM

Re: RSFgen - issue with script

rick reynolds June 04, 2007 02:12PM

Re: RSFgen - issue with script

Zhaohui June 04, 2007 02:23PM

Re: RSFgen - issue with script

DA August 05, 2008 05:06PM

Re: RSFgen - issue with script

rick reynolds August 05, 2008 10:57PM