Dear Ying,
It would probably be better to allow for subjects effects, e.g.:
cont = cell(1,4);
for session=1:4
cont{i} = load(['Session' num2str(session) '/rp-0001.txt']);
end
motion = blkdiag(cont{:});
save('rp-allmotion.txt','motion','-ascii');
Best regards,
Guillaume.
On 02/01/2019 00:42, Liuying L. wrote:
> Hi SPM experts,
> I need to concatenate 4 sessions in GLM stage using
> /spm_fmri_concatenate.m/. But a problem comes out when adding head
> motion regressors in the concatenated GLM.
> Four /rp*.text/ files were outputted in the realigning stage. I have to
> combine these four files into a single file as head motion regressors. I
> think I can combine them through the simplest way:
> /motion=[];
> for session=1:4
> cont=load(['Session' num2str(session) '/rp-0001.txt']);
> motion=[motion;cont];
> end/
> / h=fopen('rp-allmotion.txt','a')/
> /for tr=1:size(motion,2)/
> /fprintf(h,'%f',motion(tr,:));/
> /fprintf(h,'\n');/
> /end/
> /fclose(h);/
> Then the rp-allmotion.txt file is added to the concatenated GLM through
> multi-regressors option.
> Do you think I am right?
> Best regards,
> Ying
--
Guillaume Flandin, PhD
Wellcome Centre for Human Neuroimaging
UCL Queen Square Institute of Neurology
London WC1N 3BG
|