3dDeconvolve Level wise regressors

Hello, I am trying to analyze fMRI data from an experiment where I collected event related task activity for 8 levels of the same task, and then also collected a resting condition. The thing I am having trouble figuring out is how to set up my regression matrix for this experiment. This is what I have at the moment for the 3dDeconvolve commandline


-polort 19 \
-num_stimts 15 \
-stim_file 1 "${subject}.MP.all.1D[0]"    -stim_label 1 "Roll" -stim_base 1 \
-stim_file 2 "${subject}.MP.all.1D[1]"    -stim_label 2 "Pitch" -stim_base 2 \
-stim_file 3 "${subject}.MP.all.1D[2]"    -stim_label 3 "Yaw" -stim_base 3 \
-stim_file 4 "${subject}.MP.all.1D[3]"    -stim_label 4 "dS" -stim_base 4 \
-stim_file 5 "${subject}.MP.all.1D[4]"    -stim_label 5 "dL" -stim_base 5 \
-stim_file 6 "${subject}.MP.all.1D[5]"    -stim_label 6 "dP" -stim_base 6 \
-stim_file 7 "Level_regress.txt[8]"   -stim_label 7 "rest" -stim_base 7 \
-stim_file 8 "Level_regress.txt[0]"   -stim_label 8 "Level_1" \
-stim_file 09 "Level_regress.txt[1]"   -stim_label 9 "Level_2" \
-stim_file 10 "Level_regress.txt[2]"   -stim_label 10 "Level_3" \
-stim_file 11 "Level_regress.txt[3]"   -stim_label 11 "Level_4" \
-stim_file 12 "Level_regress.txt[4]"   -stim_label 12 "Level_5" \
-stim_file 13 "Level_regress.txt[5]"   -stim_label 13 "Level_6" \
-stim_file 14 "Level_regress.txt[6]"   -stim_label 14 "Level_7" \
-stim_file 15 "Level_regress.txt[7]"   -stim_label 15 "Level_8" \

So I have the motion parameters and the rest condition being modeled as part of the baseline, and then 1 simtulus file for each of the 8 levels. The matrix being read is 9 columns (representing the 8 conditions +rest condition) populated by 0’s, and for any given level, a 1 at the corresponding volume indices for that task level.

Example: the matrix would look like what is shown below, indicating the first volume is the level 4, second volume is level 2, and 3rd volume is level 1, and the 4th volume is level 3.

0 0 0 1 0 0 0 0 0
0 1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0

Will this type of setup perform a levelwise regression of the datasets? or do I need to adjust/modify how I define my stimuli, and their input matrices to extract that information better?

The option -stim_file in 3dDeconvolve is meant to obtain the regressor directly from the user (e.g. head motion effects). First of all, what does each level of the task correspond to? Some degree of gradation? It is not clear to me how you’re modeling each level with those 0s and 1s from the matrix. Could you elaborate it a little more?