Print

Print


Hi Wang,
Yes, in the first piece of code ‘Y’ is the first component (eigenvariate). The second piece of code filters out nuisance regressors, including the high pass filter and temporal auto-correlation. See documentation of the SPM.** structures in the help text of spm_spm.m  .

You could use a DCM to generate simulated data – check out spm_dcm_create.m (the GUI option doesn’t work in the current version, but will do in a soon-to-be-released version). I have also heard that NeuRosim is good for simulating fMRI data (http://www.jstatsoft.org/v44/i10/paper), but have not tried it myself.

Best,
Peter.

From: 晓翌 [mailto:[log in to unmask]]
Sent: 03 June 2014 03:36
To: SPM
Cc: Zeidman, Peter
Subject: 回复: [SPM] Which is the function(code) of calculating eigenvariate of a chosen VOI (used in DCM analysis)?

Dear Peter and dear experts:

Thanks a lot for telling me which is the code. It would be nearly impossible for me to find it. Thanks very much.

And an additional question:
If I simulate an experiment with block design, and the data of each voxels in each VOI region have also been simulated by the block design and brain network functions, it seems that eigenvariate of each VOI can be calculated with the code below, and the variable "Y" would be the eigenvariate I need:

----------------------------------------------------------------------------------------------------------------------------------------------------
%-Compute regional response in terms of first eigenvariate
%--------------------------------------------------------------------------
[m n]   = size(y);
if m > n
    [v s v] = svd(y'*y);
    s       = diag(s);
    v       = v(:,1);
    u       = y*v/sqrt(s(1));
else
    [u s u] = svd(y*y');
    s       = diag(s);
    u       = u(:,1);
    v       = y'*u/sqrt(s(1));
end
d       = sign(sum(v));
u       = u*d;
v       = v*d;
Y       = u*sqrt(s(1)/n);
---------------------------------------------------------------------------------------------------------------------------------------------------

While in the spm_region.m, before this section some other section seem to be relative to the calculation of eigenvariate, with the usage of SPM.mat:

---------------------------------------------------------------------------------------------------------------------------------------------------
%-Get raw data, whiten and filter
%--------------------------------------------------------------------------
y        = spm_get_data(SPM.xY.VY,xSPM.XYZ(:,Q));
y        = spm_filter(SPM.xX.K,SPM.xX.W*y);


%-Computation
%==========================================================================

%-Remove null space of contrast
%--------------------------------------------------------------------------
if xY.Ic ~= 0

    %-Parameter estimates: beta = xX.pKX*xX.K*y
    %----------------------------------------------------------------------
    beta  = spm_get_data(SPM.Vbeta,xSPM.XYZ(:,Q));

    %-subtract Y0 = XO*beta,  Y = Yc + Y0 + e
    %----------------------------------------------------------------------
    if ~isnan(xY.Ic)
        y = y - spm_FcUtil('Y0',SPM.xCon(xY.Ic),SPM.xX.xKXs,beta);
    else
        y = y - SPM.xX.xKXs.X * beta;
    end

end
------------------------------------------------------------------------------------------------------------------------------------------------------

So my question would be, whether the second section of code is necessary for a effective simulation? If it is necessary while I don't try to construct a SPM.mat, how could I follow the calculation in the second section? Or the best choice for me is to construct a SPM.mat by making a GLM analysis as in most analysis of real data?

thanks and best wishes

Wang Yi
2014.6.3


------------------ 原始邮件 ------------------
发件人: "Zeidman, Peter";<[log in to unmask]<mailto:[log in to unmask]>>;
发送时间: 2014年6月2日(星期一) 下午2:42
收件人: "SPM"<[log in to unmask]<mailto:[log in to unmask]>>;
主题: Re: [SPM] Which is the function(code) of calculating eigenvariate of a chosen VOI (used in DCM analysis)?

Dear Wang,
The code for the eivenvariate button is spm_regions.m .

Best,
Peter.

From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On Behalf Of ??
Sent: 02 June 2014 04:27
To: [log in to unmask]<mailto:[log in to unmask]>
Subject: [SPM] Which is the function(code) of calculating eigenvariate of a chosen VOI (used in DCM analysis)?

Dear experts:

In DCM analysis, time series of each VOI was extracted by calculating the "eigenvariate" of the time series of all active voxels in the VOI region. Now I want to make some simulation about DCM, I hope to use the function(code) in SPM software of calculating the "eigenvariate", but I have no idea that how to find it. Could any experts tell me which is the function(code) I need?

thanks and best wishes

Wang Yi
2014.6.2