AFNI program: waver

Output of -help


Usage: waver [options] > output_filename
Creates an ideal waveform timeseries file.
The output goes to stdout, and normally would be redirected to a file.

Options: (# refers to a number; [xx] is the default value)
  -WAV = Sets waveform to Cox special                    [default]
           (cf. AFNI FAQ list for formulas)
  -GAM = Sets waveform to form t^b * exp(-t/c)
           (cf. Mark Cohen)

  -EXPR "expression" = Sets waveform to the expression given,
                         which should depend on the variable 't'.
     e.g.: -EXPR "step(t-2)*step(12-t)*(t-2)*(12-t)"
     N.B.: The peak value of the expression on the '-dt' grid will
           be scaled to the value given by '-peak'; if this is not
           desired, set '-peak 0', and the 'natural' peak value of
           the expression will be used.

These options set parameters for the -WAV waveform.
  -delaytime #   = Sets delay time to # seconds                [2]
  -risetime #    = Sets rise time to # seconds                 [4]
  -falltime #    = Sets fall time to # seconds                 [6]
  -undershoot #  = Sets undershoot to # times the peak         [0.2]
                     (this should be a nonnegative factor)
  -restoretime # = Sets time to restore from undershoot        [2]

These options set parameters for the -GAM waveform:
  -gamb #        = Sets the parameter 'b' to #                 [8.6]
  -gamc #        = Sets the parameter 'c' to #                 [0.547]
  -gamd #        = Sets the delay time to # seconds            [0.0]

These options apply to all waveform types:
  -peak #        = Sets peak value to #                        [100]
  -dt #          = Sets time step of output AND input          [0.1]
  -TR #          = '-TR' is equivalent to '-dt'

The default is just to output the waveform defined by the parameters
above.  If an input file is specified by one the options below, then
the timeseries defined by that file will be convolved with the ideal
waveform defined above -- that is, each nonzero point in the input
timeseries will generate a copy of the waveform starting at that point
in time, with the amplitude scaled by the input timeseries value.

  -xyout         = Output data in 2 columns:
                     1=time 2=waveform (useful for graphing)
                     [default is 1 column=waveform]

  -input infile  = Read timeseries from *.1D formatted 'infile';
                     convolve with waveform to produce output
              N.B.: you can use a sub-vector selector to choose
                    a particular column of infile, as in
                      -input 'fred.1D[3]'

  -inline DATA   = Read timeseries from command line DATA;
                     convolve with waveform to produce output
                     DATA is in the form of numbers and
                     count@value, as in
                     -inline 20@0.0 5@1.0 30@0.0 1.0 20@0.0 2.0
     which means a timeseries with 20 zeros, then 5 ones, then 30 zeros,
     a single 1, 20 more zeros, and a final 2.
     [The '@' character may actually be any of: '@', '*', 'x', 'X'.
      Note that * must be typed as \* to prevent the shell from
      trying to interpret it as a filename wildcard.]

  -tstim DATA    = Read discrete stimulation times from the command line
                     and convolve the waveform with delta-functions at
                     those times.  In this input format, the times do
                     NOT have to be at intervals of '-dt'.  For example
                       -dt 2.0 -tstim 5.6 9.3 13.7 16.4
                     specifies a TR of 2 s and stimuli at 4 times
                     (5.6 s, etc.) that do not correspond to integer
                     multiples of TR.  DATA values cannot be negative.
                   If the DATA is stored in a file, you can read it
                     onto the command line using something like
                       -tstim `cat filename`
                     where using the backward-single-quote operator
                     of the usual Unix shells.
   ** 12 May 2003: The times after '-tstim' can now also be specified
                     in the format 'a:b', indicating a continuous ON
                     period from time 'a' to time 'b'.  For example,
                       -dt 2.0 -tstim 13.2:15.7 20.3:25.3
                     The amplitude of a response of duration equal to
                     'dt' is equal the the amplitude of a single impulse
                     response (which is the special case a=b).  N.B.: This
                     means that something like '5:5.01' is very different
                     from '5' (='5:5').  The former will have a small amplitude
                     because of the small duration, but the latter will have
                     a large amplitude because the case of an instantaneous
                     input is special.  It is probably best NOT to mix the
                     two types of input to '-tstim' for this reason.
                     Compare the graphs from the 2 commands below:
                       waver -dt 1.0 -tstim 5:5.1 | 1dplot -stdin
                       waver -dt 1.0 -tstim 5     | 1dplot -stdin
                     If you prefer, you can use the form 'a%c' to indicate
                     an ON interval from time=a to time=a+c.

  -when DATA     = Read time blocks when stimulus is 'on' (=1) from the
                     command line and convolve the waveform with with
                     a zero-one input.  For example:
                       -when 20..40 60..80
                     means that the stimulus function is 1.0 for time
                     steps number 20 to 40, and 60 to 80 (inclusive),
                     and zero otherwise.  (The first time step is
                     numbered 0.)

  -numout NN     = Output a timeseries with NN points; if this option
                     is not given, then enough points are output to
                     let the result tail back down to zero.

At least one option is required, or the program will just print this message
to stdout.  Only one of the 3 timeseries input options above can be used.

If you have the 'xmgr' graphing program, then a useful way to preview the
results of this program is through a command pipe like
   waver -dt 0.25 -xyout -inline 16@1 40@0 16@1 40@0 | xmgr -source stdin
Using the cruder AFNI package program 1dplot, you can do something like:
   waver -GAM -tstim 0 7.7 | 1dplot -stdin

If a square wave is desired, see the 'sqwave' program.

This page generated on Tue Aug 3 16:42:50 EDT 2004