Hello,
I have five runs of task fMRI data. They are processed by afni_proc.py. I would like to compute REML after chopping off N data points from the end of the data. Here is the 3dDeconvolve generated design matrix.
3dDeconvolve -input pb07.$subj.r*.scale+orig.HEAD \
-censor censor_${subj}_combined_2.1D \
-ortvec mot_demean.r01.1D mot_demean_r01 \
-ortvec mot_demean.r02.1D mot_demean_r02 \
-ortvec mot_demean.r03.1D mot_demean_r03 \
-ortvec mot_demean.r04.1D mot_demean_r04 \
-ortvec mot_demean.r05.1D mot_demean_r05 \
-ortvec mot_deriv.r01.1D mot_deriv_r01 \
-ortvec mot_deriv.r02.1D mot_deriv_r02 \
-ortvec mot_deriv.r03.1D mot_deriv_r03 \
-ortvec mot_deriv.r04.1D mot_deriv_r04 \
-ortvec mot_deriv.r05.1D mot_deriv_r05 \
-polort 6 \
-num_stimts 3 \
-stim_times_AM1 1 stimuli/sub-xx_type1_dm.1D 'dmUBLOCK(-2)' \
-stim_label 1 type1 \
-stim_times_AM1 2 stimuli/sub-xx_type2_dm.1D 'dmUBLOCK(-2)' \
-stim_label 2 type2 \
-stim_times_AM1 3 stimuli/sub-xx_type3_dm.1D 'dmUBLOCK(-2)' \
-stim_label 3 type3 \
-jobs 16 \
-fout -tout -x1D X.xmat.1D -xjpeg X.jpg \
-x1D_uncensored X.nocensor.xmat.1D \
-errts errts.${subj} \
-x1D_stop \
-bucket stats.$subj
Here is the 3dREMLfit code
3dREMLfit -matrix X.xmat.1D \
-input "pb07.sub-xx.r01.scale+orig.HEAD pb07.sub-xx.r02.scale+orig.HEAD pb07.sub-xx.r03.scale+orig.HEAD pb07.sub-xx.r04.scale+orig.HEAD pb07.sub-xx.r05.scale+orig.HEAD" \
-fout -tout -Rbuck stats.sub-xx_REML -Rvar stats.sub-xx_REMLvar \
-Rerrts errts.sub-xx_REML -verb $*
To chop off some data, I could replace the above input by concatenating all runs and then taking whatever data point range.
3dTcat -prefix all_runs.$subj pb07.$subj.r*.scale+orig.HEAD
3dTcat -prefix all_runs.sub-epxxx.chunk1 \
all_runs.sub-ep2169+orig.HEAD'[0..589]'
However, it is tricky to manipulate the design matrix 1D file, since 1) when the chopped length is longer than 1 run, there will be all 0 columns in the chopped design matrix 2) all 0 columns can be removed easily if all we need is the correct design matrix, but 3dREMLfit can not pass the 1D file header validation, such as ColumnLabels
, GoodList
, RunStart
etc can not match with the modified design matrix.
Is there a convenient way to implement the above manipulation? Thanks a lot.
Best,
Zhengchen