Home > marsbar > @mardo_99 > private > pr_spm_hrf.m

pr_spm_hrf

PURPOSE ^

returns a hemodynamic response function

SYNOPSIS ^

function [hrf,p] = pr_spm_hrf(RT,P);

DESCRIPTION ^

 returns a hemodynamic response function
 FORMAT [hrf,p] = pr_spm_hrf(RT,[p]);
 RT   - scan repeat time
 p    - parameters of the response function (two gamma functions)

                            defaults
                            (seconds)
    p(1) - delay of response (relative to onset)       6
    p(2) - delay of undershoot (relative to onset)    16
    p(3) - dispersion of response               1
    p(4) - dispersion of undershoot               1
    p(5) - ratio of response to undershoot           6
    p(6) - onset (seconds)                   0
    p(7) - length of kernel (seconds)          32

 hrf  - hemodynamic response function
 p    - parameters of the response function
_______________________________________________________________________
 @(#)spm_hrf.m    2.7 Karl Friston 99/05/17

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [hrf,p] = pr_spm_hrf(RT,P);
0002 % returns a hemodynamic response function
0003 % FORMAT [hrf,p] = pr_spm_hrf(RT,[p]);
0004 % RT   - scan repeat time
0005 % p    - parameters of the response function (two gamma functions)
0006 %
0007 %                            defaults
0008 %                            (seconds)
0009 %    p(1) - delay of response (relative to onset)       6
0010 %    p(2) - delay of undershoot (relative to onset)    16
0011 %    p(3) - dispersion of response               1
0012 %    p(4) - dispersion of undershoot               1
0013 %    p(5) - ratio of response to undershoot           6
0014 %    p(6) - onset (seconds)                   0
0015 %    p(7) - length of kernel (seconds)          32
0016 %
0017 % hrf  - hemodynamic response function
0018 % p    - parameters of the response function
0019 %_______________________________________________________________________
0020 % @(#)spm_hrf.m    2.7 Karl Friston 99/05/17
0021 
0022 % global parameter
0023 %-----------------------------------------------------------------------
0024 global fMRI_T; 
0025 if isempty(fMRI_T), fMRI_T = 16; end;
0026 
0027 % default parameters
0028 %-----------------------------------------------------------------------
0029 p     = [6 16 1 1 6 0 32];
0030 if nargin > 1
0031       p(1:length(P)) = P;
0032 end
0033 
0034 % modelled hemodynamic response function - {mixture of Gammas}
0035 %-----------------------------------------------------------------------
0036 dt    = RT/fMRI_T;
0037 u     = [0:(p(7)/dt)] - p(6)/dt;
0038 hrf   = spm_Gpdf(u,p(1)/p(3),dt/p(3)) - spm_Gpdf(u,p(2)/p(4),dt/p(4))/p(5);
0039 hrf   = hrf([0:(p(7)/RT)]*fMRI_T + 1);
0040 hrf   = hrf'/sum(hrf);

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019