Hello,
This is my first attempt at fMRI analysis.
Some background -
I have 2 phases, 1 where images are presented singular, and 2 where they are paired. I want to describe phase 2's data using phase 1, via the following equation.
ss = b1 * s1 + b2 * s2 + b3 * s1 * s2
S1 and S2 are the response of the 2 images from phase 1, SS is the response of the pair in phase 2.
I have 3 1D files, S1 and S2 which have been ordered based on their presentation in phase 2.
I want to obtain b1, b2 and b3.
All my inputs are 1D files, as I am extracting values from a specific ROI.
please let me know if the given approach and the code is appropriate.
#!/bin/csh
# AAR_ROI_Analysis_MR: Performs multiple regression analysis on ROI time series
set subj = $1
echo $subj
set proj_path = /media/sanjana/home2/AARv4_MRI
set temp_path = /media/sanjana/home2/templates
set reg_path=$proj_path/data/regressors/activation
#set cond_names = (PP PN PU)
#@ no_Of_cond = $#cond_names
# Looping through subjects
cd $proj_path/data/individual/AAR"$subj"/activation/trialWise/
# Converting row vectors into coloumn vectors
1dtranspose -overwrite p2_trialWise_AAR"$subj".1D p2_trialWise_Transpose_AAR"$subj".1D
1dtranspose -overwrite S1_trialWise_AAR"$subj".1D S1_trialWise_Transpose_AAR"$subj".1D
1dtranspose -overwrite S2_trialWise_AAR"$subj".1D S2_trialWise_Transpose_AAR"$subj".1D
# Providing 1D timeseries and its resolution (TR)
setenv AFNI_1D_TIME YES
setenv AFNI_1D_TIME_TR 2.5
3dDeconvolve \
-overwrite \
-input $proj_path/data/individual/AAR"$subj"/activation/trialWise/p2_trialWise_Transpose_AAR"$subj".1D \
-polort A \
-nobout \
-jobs 4 \
-noFDR \
-num_stimts 3 \
-local_times \
-stim_file 1 $proj_path/data/individual/AAR"$subj"/activation/trialWise/S1_trialWise_Transpose_AAR"$subj".1D -stim_label 1 S1 \
-stim_file 2 $proj_path/data/individual/AAR"$subj"/activation/trialWise/S2_trialWise_Transpose_AAR"$subj".1D -stim_label 2 S2 \
-stim_file 3 $proj_path/data/individual/AAR"$subj"/activation/trialWise/S1xS2_trialWise_Transpose_AAR"$subj".1D -stim_label 2 S1xS2 \
-cbucket ./" AAR"$subj"_trialWise_TS_MR_SS" \
-x1D ./"AAR"$subj"_TR_MNI_2mm_SI_censor_MR_trialWise_p1.x1D" \
-xsave \
-xjpeg ./"AAR"$subj"_TR_MNI_2mm_SI_censor_MR_trialWise_p1.png" \
-num_glt 1 \
-gltsym "SYM: S1 +S2 +S1xS2" -glt_label 1 AAR_interaction \
-tout \
-rout \
-bucket ./"AAR"$subj"_TR_MNI_2mm_SI_censor_MR_SS_p2.txt"
If anything needs clarification, please let me know.
Thanks in advance
Edited 2 time(s). Last edit at 02/01/2023 12:51AM by SanjanaH.