Hi Qiuhai,
These nested designs are a little difficult to do well, since
make_random_timing.py was not designed with such examples in
mind. In your case though, it is a touch messy, but seems to
work out easily enough.
Since you want everything TR-locked, you might picture the
probe and ITI phases differently, e.g. where the probe phase
is 2s or 4s, and the min ITI is 4s or 2s, respectively. That
should end up giving the same result, but might be easier to
code.
Not only are the stages fixed, but the number of each type is
fixed, which is to say the "randomization" of the delay stage
is not random the way ITIs are (random ITIs do not have the
same number of each ITI).
This suggests that you should randomize the design (using
make_random_timing.py) with 6 classes of trials, not just 2,
and not 10. Moving 1s of the probe stage to the ITI gives 6
classes as:
A1: class A, 6s delay - duration 10s
A2: class A, 8s delay - duration 12s
A3: class A, 10s delay - duration 14s
B1: class B, 6s delay - duration 10s
B2: class B, 8s delay - duration 12s
B3: class B, 10s delay - duration 14s
Then use a min ITI of 4s and a max 10s.
Afterwards, use some more commands to create the needed stim
timing files. For class A they might be:
CA.1.sample.txt : class A sample start times
CA.2.delay.6.txt : class A 6s delay start times
CA.3.delay.8.txt : class A 8s delay start times
CA.4.delay.10.txt : class A 10s delay start times
CA.5.probe.txt : class A probe start times
Then...
1. Use timing_tool.py to put A1,A2,A3 together into a single
timing file (of class A sample stages), e.g.
timing_tool.py -timing A1.txt -extend A2.txt -extend A3.txt \
-sort -write_timing CA.1.sample.txt
2. Add 2s to each of the above timing files to get the start
of the delay stages. This is a little like adding 2s to the
times in CA.1.sample.txt, except that it keeps the 3 class A
delay types partitioned into different files.
timing_tool.py -timing A1.txt -add_offset 2 -write_timing CA.2.delay.6.txt
timing_tool.py -timing A2.txt -add_offset 2 -write_timing CA.3.delay.8.txt
timing_tool.py -timing A3.txt -add_offset 2 -write_timing CA.4.delay.10.txt
3. The probe stages are slightly more work, too, since their
offsets vary based on the delay durations. For this, make 3
probe files, based on the delays, then put them together.
timing_tool.py -timing CA.2.delay.6.txt -add_offset 6 -write_timing pa.6.txt
timing_tool.py -timing CA.3.delay.8.txt -add_offset 8 -write_timing pa.8.txt
timing_tool.py -timing CA.4.delay.10.txt -add_offset 10 -write_timing pa.10.txt
timing_tool.py -timing pa.6.txt -extend pa.8.txt -extend pa.10.txt \
-sort -write_timing CA.5.probe.txt
Then do steps 1, 2 and 3 again for class B.
You can evaluate the results using timing_tool.py to make a
single "event list" file of all 10 stimulus types, 5 from
each class. Consider example 8 from the help, e.g.
timing_tool.py -multi_timing CA.*.txt CB.*.txt \
-multi_timing_to_events all.events.txt \
-tr 2.0 -multi_stim_dur 2 6 8 10 2 2 6 8 10 2 \
-per_run -run_length WHATEVER_IT_IS
How does this seem?
- rick
Edited 1 time(s). Last edit at 08/28/2013 11:02AM by rick reynolds.