Return adjusted data for estimated design and contrast no FORMAT Ya = adjusted_data(D, Ic) D - Estimated marsbar design Ic - Contrast number to adjust for Outputs Ya - Adjusted data, N by M, where N is number of time points and M is number of regions in estimated marsbar design e.g E = estimate(D, Y); [E Ic] = add_contrasts(E, 'task', 'T', [1 0 0]); Ya = adjusted_data(E, Ic); Matthew Brett
0001 function Ya = adjusted_data(D, Ic) 0002 % Return adjusted data for estimated design and contrast no 0003 % FORMAT Ya = adjusted_data(D, Ic) 0004 % 0005 % D - Estimated marsbar design 0006 % Ic - Contrast number to adjust for 0007 % 0008 % Outputs 0009 % Ya - Adjusted data, N by M, where N is number of time points 0010 % and M is number of regions in estimated marsbar design 0011 % 0012 % e.g 0013 % E = estimate(D, Y); 0014 % [E Ic] = add_contrasts(E, 'task', 'T', [1 0 0]); 0015 % Ya = adjusted_data(E, Ic); 0016 % 0017 % Matthew Brett 0018 0019 if nargin < 2 0020 error('Need contrast number'); 0021 end 0022 if nargin < 3 0023 r_no = 1; 0024 end 0025 Ya = []; 0026 if ~is_mars_estimated(D) 0027 error('Need a MarsBaR estimated design'); 0028 end 0029 0030 SPM = des_struct(D); 0031 B = betas(D); 0032 xCon = get_contrasts(D); 0033 Ya = spm_FcUtil('Yc', xCon(Ic),SPM.xX.xKXs, B);