Hi Mark and Jeanette,
Thank you both very much for your kind help.
On Mon, Jun 8, 2009 at 3:46 PM, Mark Jenkinson<[log in to unmask]> wrote:
> Hi,
>
> This is correct.
> As we both said, you cannot implement the FSL highpass
> filter as a set of GLM regressors. However, Jeanette has
> provided you a matrix that can be used to do the filtering
> if you apply it to the data, Y, and design matrix, X, as:
> Yfilt = F*Y ; Xfilt = F*X
> giving you the filtered versions (Yfilt & Xfilt). This would
> be equivalent to running fslmaths to filter, but easier in
> the sense that you do not need to convert your design
> matrix to and from a nifti image format.
> The matrix, F, above must be Nscans x Nscans in size
> given the way it is applied. You cannot use the contents
> as regressors because there is no equivalent way to do
> our highpass filter using GLM regressors.
>
> All the best,
> Mark
>
>
> On 8 Jun 2009, at 05:43, Xue, Feng wrote:
>
>> Hi Jeanette,
>>
>> Thanks for your reply too, I tried your script, however, I got a
>> Nscans * Nscans matrix for F. Did I mistake something?
>>
>> I want to use it to contrust VOI data as SPM does, we had finished all
>> other parameters except xY.X0, which would vary between subjects under
>> the same model. I wander if we could modify your script to meet our
>> requirement? If so, then how?
>>
>> On Mon, Jun 8, 2009 at 3:52 AM, Jeanette Mumford
>> <[log in to unmask]> wrote:
>>>
>>> Hi,
>>>
>>> The following Matlab code illustrates how to create the highpass
>>> filtering
>>> matrix that should be equivalent to the highpass filter of FSL. The
>>> filtering is accomplished by premultiplying the data and design by the
>>> matrix F that is created. So F*Y and F*X would be your filtered data and
>>> design (so F is not modeled in the design like the DCT basis in SPM).
>>>
>>> Cheers,
>>> Jeanette
>>>
>>> %Construct the HP filter. This should exactly match FSL
>>> % cut is the cutoff in seconds that would be specified in FSL
>>> %TR is the TR in seconds
>>> % Nscans is the number of TRs (# of rows in design matrix).
>>>
>>> cut=cut/TR;
>>> sigN2=(cut/sqrt(2))^2;
>>> K = toeplitz(1/sqrt(2*pi*sigN2)*
>>> exp(-[0:(Nscans - 1)].^2/(2*sigN2)));
>>> K = spdiags(1./sum(K')',0,Nscans,Nscans)*K;
>>>
>>> H = zeros(Nscans,Nscans); % Smoothing matrix, s.t. H*y is smooth line
>>> X = [ones(Nscans,1) (1:Nscans)'];
>>> for k = 1:Nscans
>>> W = diag(K(k,:));
>>> Hat = X*pinv(W*X)*W;
>>> H(k,:) = Hat(k,:);
>>> end
>>>
>>> %F is the filtering matrix that you premultiply the data and design by
>>> F=eye(Nscans)-H;
>>>
>>>
>>>
>>>
>>> On Fri, Jun 5, 2009 at 10:11 AM, Mark Jenkinson <[log in to unmask]>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Our highpass filter does not work in this way and it is
>>>> not possible to implement the same thing with a set
>>>> of GLM regressors. Sorry. You can perform the
>>>> same filtering using fslmaths though.
>>>>
>>>> All the best,
>>>> Mark
>>>>
>>>> On 5 Jun 2009, at 17:34, Xue, Feng wrote:
>>>>
>>>>> Dear FSL experts,
>>>>>
>>>>> As far as I know, that SPM uses 8 cosin functions as high pass filter,
>>>>> is there similar matrix in FSL? How can I draw them out?
>>>>>
>>>>> Many thanks!
>>>>>
>>>>> --
>>>>> Best Regards
>>>>>
>>>>>
>>>>> National Key Laboratory of Cognitive Neuroscience and Learning
>>>>> Beijing Normal University
>>>>> Beijing, China. 100875
>>>>> Tel: +86-13810154455
>>>>> web: http://psychbrain.bnu.edu.cn
>>>>> ==============================================
>>>>> Welcome to MuDuo JinSheng BBS @ Beijing Normal University
>>>>> telnet://bbs.mdjs.org
>>>>> http://bbs.mdjs.org
>>>>>
>>>
>>>
>>
>>
>>
>> --
>> Best Regards
>>
>>
>> National Key Laboratory of Cognitive Neuroscience and Learning
>> Beijing Normal University
>> Beijing, China. 100875
>> Tel: +86-13810154455
>> web: http://psychbrain.bnu.edu.cn
>> ==============================================
>> Welcome to MuDuo JinSheng BBS @ Beijing Normal University
>> telnet://bbs.mdjs.org
>> http://bbs.mdjs.org
>>
>
--
Best Regards
National Key Laboratory of Cognitive Neuroscience and Learning
Beijing Normal University
Beijing, China. 100875
Tel: +86-13810154455
web: http://psychbrain.bnu.edu.cn
==============================================
Welcome to MuDuo JinSheng BBS @ Beijing Normal University
telnet://bbs.mdjs.org
http://bbs.mdjs.org
|