#!/bin/bash -e

#######################################################################
#
# Proc script for group level stats, for combining DTI data with other
# subject information (FATCAT-MVM processing)
#
#######################################################################


# Step1: load the DTI '*.grid' file. '* MVMtbl.txt' and
# '*_MVMprep.log' files will be generated.
fat_mvm_prep.py                            \
    -p DTI_Fluency                         \
    -c scores_for_all_Fluency.csv          \
    -l PATH_0M.1D

# Step2: create a 3dMVM script.
fat_mvm_scripter.py                        \
    -p 'DTI_Fluency'                       \
    -v 'type dur age score'                \
    --table='DTI_Fluency_MVMtbl.txt'       \
    --log_file='DTI_Fluency _MVMprep.log'

# Step3: setup ANCOVA model in AFNI's '3dMVM' program to compute the
# phenotype effect on DTI measures.
3dMVM                                      \
    -prefix DTI_Fluency_MVM                \
    -bsVars "type*dur*age*score"           \
    -wsVars "ROI"                          \
    -qVars  "dur,age,score"

# Step4: Compute characteristics of white matter alterations related
# to FAS verbal fluency scores in PD-N.
3dMVM                                      \
    -prefix DTI_Fluency _MVM               \
    -bsVars "score+age+dur+type"           \
    -wsVars "ROI"                          \
    -qVars  "score,age,dur" 
