These exercises are intended to introduce the user to optseq. See the
Optseq Home Page at http://surfer.nmr.mgh.harvard.edu/optseq for
more info.

--------------------------------------------------------------------------

Exercise 0. View the optseq help page:

optseq2 --help | less

--------------------------------------------------------------------------

Exercise 1. Create a schedule with a single non-null event type for a
run with 100 time points with TR = 2 sec. The trial type will have the
label 'evt1', will last 2 sec, and will be repeated 30 times. The 3
best schedules will be kept. Set the PSD window to 20 sec (which
should be enough to capture the response to a 2 sec event). Note that
the dPSD is implicitly set to the TR because there are only two
parameters that follow --psdwin.

optseq2 --ntp 100 --tr 2 \
        --psdwin 0 20 \
        --ev evt1 2 30 \
        --nkeep 3 \
        --o ex1 \
        --nsearch 10000 

There will be five files created by this process. The three schedules
will be stored in ex1-001.par, ex1-002.par, and ex1-003.par. Each file
will have 4 columns corresponding to: (1) stimulus onset time, (2)
event type numeric id, (3) event duration, and (4) event type label.
ext1.log is a file that contains information about the progress of
the optimization. It is created when the process starts, and the process
adds to it after it has completed each 10% of the search or when one
of the best schedules changes. ex1.sum is a summary file with information
about how optseq2 was run, statistics about the search, and statistics
about each of the kept schedules. 

Look at one of the event schedule files (eg, ex1-001.par). Notice
that while the duration of event type 1 is constant at 2 seconds,
the duration of the Null event can change (but will always be a
multiple of the dPSD).

Look in the summary file (ex1.sum). What was the efficiency
for the best schedule? Re-run with 60 and 90 repetitions. How
does the efficiency change? How high can the number of repetitions
go before you encounter a time violation?

--------------------------------------------------------------------------

Exercise 2. Create a schedule with three non-null event types for a run with
120 time points and TR = 2.5 sec. Event type 1 will have a duration of
2.5 sec with 20 repetitions. Event type 2 will have a duration of
5.0 sec with 10 repetitions, and event type 3 will have a duration of
7.5 sec with 15 repetitions. Set the PSD window to 25 sec to assure
that the response to event type 3 can be captured; explicitly set the
temporal resolution (ie, the dPSD) to one TR.

optseq2 --ntp 120 --tr 2.5 \
        --psdwin 0 25 2.5\
        --ev evt1 2.5 20 \
        --ev evt2 5.0 10 \
        --ev evt3 7.5 15 \
        --nkeep 3 \
        --o ex2 \
        --nsearch 1000 

Look at one of the event schedule files (eg, ex2-001.par) to verify
that event onsets always occur at integer multiples of the dPSD (2.5).
What was the efficiency of the best schedule?

Change the dPSD to half a TR (ie, --psd 0 25 1.25). How did this
change the efficiency? Verify that event onsets always occur at
integer multiples of the new dPSD, and that the Null durations are
always an integer multiples of the new dPSD.

Create a DOF violation by changing the dPSD to .0625.