Hi Rick,
thanks much ! I am attaching the stim_analyze_modern script at the bottom, with my edits for clarity. from the 3dDeconvolve cmd –
3dDeconvolve
-nodata 1680 2.000
-polort 2
-concat ‘1D: 0 168 336 504 672 840 1008 1176 1344 1512’
-num_stimts 1
-stim_times 1 movemouth.0004_01_mouth.1D GAM
-stim_label 1 mouth
-x1D X.movemouth.0004.xmat.1D
from the 3dDecon help, I see that MION(d) could be used instead of GAM (although you mentioned the default was BLOCK?) – In our experiment, these events are motor outputs of the participant, that last for <1 second. My questions are, 1) is it still appropriate to use the MION(d) if d is so short, or would it be more appropriate to convolve the MION response with the event-times only? 2) our lab’s “preferred” mion fxn is piped through fsfast, which takes additional input parameters (ie., mion response is a modified gamma fxn with delta=0, tau=8, exponent=0.3) – I’m wondering if these are specified as default values somewhere in AFNI, or how it is handled.
thanks much.
best,
Geena
#!/bin/tcsh
try to find reasonable random event related timing given the experimental
parameters
---------------------------------------------------------------------------
some experiment parameters (most can be inserted directly into the
make_random_timing.py command)
---------------------------------------------------------------------------
execution parameters
set iterations = 10000 # number of iterations to compare
set seed = 1234567 # initial random seed
set outdir = stim_results # directory that all results are under
set LCfile = NSD_sums # file to store norm. std. dev. sums in
set pattern = LC # search pattern for LC[0], say
set pattern = ‘norm. std.’ # search pattern for normalized stdev vals
===========================================================================
start the work
===========================================================================
------------------------------------------------------------
recreate $outdir each time
if ( -d $outdir ) then
echo “** removing output directory, $outdir …”
\rm -fr $outdir
endif
echo “++ creating output directory, $outdir …”
mkdir $outdir
if ( $status ) then
echo “failure, cannot create output directory, $outdir”
exit
endif
move into the output directory and begin work
cd $outdir
create empty LC file
echo -n “” > $LCfile
echo -n “iteration (of $iterations): 0000”
------------------------------------------------------------
run the test many times
foreach iter (count -digits 4 1 $iterations
)
# make some other random seed
@ seed = $seed + 1
# create randomly ordered stimulus timing files
# (consider: -tr_locked -save_3dd_cmd tempfile)
make_random_timing.py -num_runs 10 -run_time 336
-tr 2
-pre_stim_rest 10 -post_stim_rest 40
-rand_post_stim_rest no
-add_timing_class stim 1
-add_timing_class rest 2 -1 45 dist=decay_fixed
-add_stim_class mouth 20 stim rest
-prefix threat_app.$iter
-write_event_list events.$iter.txt
-show_timing_stats
-seed $seed
-save_3dd_cmd cmd.3dd.$iter.txt >& out.mrt.$iter
# consider: sed 's/GAM/"TENT(0,15,7)"/' tempfile > cmd.3dd.$iter
# rm -f tempfile
# now evaluate the stimulus timings
tcsh cmd.3dd.$iter.txt >& out.3dD.$iter
# save the sum of the 3 LC values
set nums = ( `awk -F= '/'"$pattern"'/ {print $2}' out.3dD.${iter}` )
# make a quick ccalc command
set sstr = $nums[1]
foreach num ( $nums[2-] )
set sstr = "$sstr + $num"
end
set num_sum = `ccalc -expr "$sstr"`
echo -n "$num_sum = $sstr : " >> $LCfile
echo "iteration $iter, seed $seed" >> $LCfile
echo -n "\b\b\b\b$iter"
end
echo “”
echo “done, results are in ‘$outdir’, LC sums are in ‘$LCfile’”
echo consider the command: “sort -n $outdir/$LCfile | head -1”