% locate filenames... cd /Projects/MAN1/Imaging/Subjects vtcs = findfiles([pwd '/M*/func'], '*.vtc', 'depth=1'); prts = findfiles([pwd '/M*/model'], '*.prt', 'depth=1'); if numel(vtcs) ~= numel(prts) error('Number of VTCs and PRTs must match!'); end % locate realignment parameter files rps = findfiles([pwd '/M*/func/r*'], 'rp*.txt', 'depth=1'); % create MDM mdm = xff('new:mdm'); mdm.RFX_GLM = 1; mdm.PSCTransformation = 1; mdm.NrOfStudies = numel(vtcs); mdm.XTC_RTC = [vtcs(:), prts(:)]; % optionally save MDM, .SaveAs without argument opens a dialog! % mdm.SaveAs; % ComputeGLM options opts = struct( ... 'motpars', {rps(:)}, ... 'restcond', 'rest', ... 'robust', true, ... 'tfilter', 160, ... 'tfilttype', 'fourier'); % compute GLM (robust takes a **LONG TIME** ! e.g. for each 200-Volume % run with 15 regressors between 30 and 60 minutes, depending on the % hardware used) glm = mdm.ComputeGLM(opts); % save GLM glm.SaveAs;