Dear Pedro,
Many thanks for reporting this. I think you are right and your
understanding of the error is accurate. I agree with your fix; an
alternative would be to make use of cumsum(SPM.nscan).
The change will be available in the next set of updates for SPM12, which
should be very soon (or so I said for the last two months).
Best wishes,
Guillaume.
On 09/11/17 14:56, Pedro A. Valdes Hernandez wrote:
> Dear SPM developers,
> Recently, I tried to specify the GLM of the simplest case of DCM
> analyses: Resting State fMRI without any condition or regressors. The
> only difference with the example provided in the SPM manual is I added 4
> sessions, instead of 1.
>
> However, I realized this yielded identical SPM.Sess(s).row for the four
> values of s (i.e. the four sessions). In detail, I had 300 volumes per
> session, summing up to 1200. But
> SPM.Sess(1).row, SPM.Sess(2).row, SPM.Sess(3).row and SPM.Sess(4).row
> were identical and equal to 1:300. Thus, any posterior step (like the
> calculation of the prewhitening matrix W or the filtering with the K
> structure) was actually only done to the first session. Even more, since
> there was an unbalance in the correction of the data, W resulted in all
> zero values for the first block, corresponding to the first session.
> This lead to an error when extracting the VOI signal from the first
> session since SVD cannot deal with Inf or NaN values. Moreover, the
> other sessions are never retrieved since there is no reference to
> indices from 301 to 1200.
>
> I think the reason for this is there might be an error in line 270
> of spm_fMRI_design.m:
> SPM.Sess(s).row = size(Xx,1) + (1:k);
>
> Since there are no conditions or regressors the design matrix Xx is
> always empty within that loop and X is only built in line 294 when the
> constant regressors Xb are added. I think that, in order to avoid this,
> line 270 should be:
> SPM.Sess(s).row = size(Xb,1) + (1:k);
>
> I did this and I succeeded in obtaining a more plausible W matrix and
> extracting VOI signals for all sessions.
>
> I just wonder what I'm saying is correct or I am missing something.
> Also, I fret this correction might only be a palliative that could
> introduce errors while running other procedures.
> Thank you for the upcoming help
> Bye.
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|