#!/bin/tcsh

### Script for Part 6 of AFNI Time Series Analysis videos
### - Create a regression matrix for a single block
###   of 20 second duration, using various basis
###   functions in 3dDeconvolve
### - Plot results into s6a.png

# create the matrix (s6a.xmat.1D) which will have # 5 columns

3dDeconvolve -nodata 81 1.0   \
             -polort -1       \
             -x1D s6a.xmat.1D \
             -x1D_stop        \
             -num_stimts 5    \
             -stim_times 1 '1D: 10' 'BLOCK(20,1)'              \
             -stim_times 2 '1D: 10' 'GAM(8.6,.547,20)'         \
             -stim_times 3 '1D: 10' 'SPMG1(20)'                \
             -stim_times 4 '1D: 10' 'MION(20)'                 \
             -stim_times 5 '1D: 10' 'EXPR(0,30) sin(PI*t/30)^2'

# plot the matrix columns

1dplot -sepscl -xaxis 0:80:8:10 -xlabel TR            \
       -ynames 'BLOCK' 'GAM' 'SPMG1' 'MION' 'sin^2()' \
       -png s6a.png s6a.xmat.1D
