hmrR_GLM - BUNPC/Homer3 GitHub Wiki

UI Name :
GLM_HRF_Drift_SS

Syntax :
[yavg, yavgstd, tHRF, nTrials, ynew, yresid, ysum2, beta, R] = hmrR_GLM(data, stim, probe, mlActAuto, Aaux, tIncAuto, trange, glmSolveMethod, idxBasis, paramsBasis, rhoSD_ssThresh, flagSSmethod, driftOrder, flagMotionCorrect )

Description :
This script estimates the HRF with options to specify the temporal basis function type and corresponding parameters, whether or not to perform simultaneous regression of short separation channels, drift order, and whether or not to correct for motion artifacts. You can also choose the method for solving the GLM matrix equation.

Inputs :

  • data - this is the concentration data with dimensions #time points x [HbO/HbR/HbT] x #channels
  • stim - stimulation vector (# time points x #conditions)=1 at stim onset otherwise =0
  • probe - source detector stucture (units should be consistent with rhoSD_ssThresh)
  • mlActAuto -
  • Aaux - A matrix of auxilliary regressors (#time points x #Aux channels)
  • tIncAuto - a vector (#time points x 1) indicating which data time points are motion (=0) or not (=1)
  • trange - defines the range for the block average [tPre Post]
  • glmSolveMethod - this specifies the GLM solution method to use
    1 - use ordinary least squares (Ye et al (2009). NeuroImage, 44(2), 428-447.)
    2 - use iterative weighted least squares (Barker, Aarabi, Huppert (2013). Biomedical optics express, 4(8), 1366-1379.) Note that we suggest driftOrder=0 for this method as otherwise it can produce spurious results.
  • idxBasis - this specifies the type of basis function to use for the HRF
    1 - a consecutive sequence of gaussian functions
    2 - a modified gamma function convolved with a square-wave of duration T. Set T=0 for no convolution.
    3 - a modified gamma function and its derivative involved with a square-wave of duration T. Set T=0 for no convolution.
    4- GAM function from 3dDeconvolve AFNI convolved with a square-wave of duration T. Set T=0 for no convolution.
    Defaults: p=8.6 q=0.547. The peak is at time pq. The FWHM is about 2.3sqrt(p)*q.
  • paramsBasis - Parameters for the basis function depends on idxBasis. idxBasis=1 - [stdev step] where stdev is the width of the gaussian and step is the temporal spacing between consecutive gaussian.
    idxBasis=2 - [tau sigma T] applied to both HbO and HbR or [tau1 sigma1 T1 tau2 sigma2 T2] where the 1 (2) indicates the parameters for HbO (HbR).
    idxBasis=3 - [tau sigma T] applied to both HbO and HbR or [tau1 sigma1 T1 tau2 sigma2 T2] where the 1 (2) indicates the parameters for HbO (HbR).
    idxBasis=4 - [p q T] applied to both HbO and HbR or [p1 q1 T1 p2 q2 T2] where the 1 (2) indicates the parameters for HbO (HbR).
  • rhoSD_ssThresh - max distance for a short separation measurement. Set =0 if you do not want to regress the short separation measurements. Follows the static estimate procedure described in Gagnon et al (2011). NeuroImage, 56(3), 1362-1371.
  • flagSSmethod - 0 if short separation regression is performed with the nearest short separation channel.
    1 if performed with the short separation channel with the greatest correlation.
    2 if performed with an average of all short separation channels.
  • driftOrder - Polynomial drift correction of this order
  • flagMotionCorrect - set to 1 to baseline correct between motion epochs indicated in tIncAuto, otherwise set to 0

Outputs :

  • yavg - the averaged results
  • ystd - the standard deviation across trials
  • tHRF - the time vector
  • nTrials - the number of trials averaged for each condition
  • ynew - the model of the HRF with the residual. That is, it is the data y with the nuasance model parameters removed.
  • yresid - the residual between the data y and the GLM fit
  • ysum2 - an intermediate matrix for calculating stdev across runs
  • beta - the coefficients of the temporal basis function fit for the HRF (#coefficients x HbX x #Channels x #conditions)
  • R - the correlation coefficient of the GLM fit to the data (#Channels x HbX)

Usage Options :

  • GLM_HRF_Drift_SS_Concentration: [dcAvg, dcAvgStd, nTrials, dcNew, dcResid, dcSum2, beta, R] = hmrR_GLM(dc, stim, probe, mlActAuto, Aaux, tIncAuto, trange, glmSolveMethod, idxBasis, paramsBasis, rhoSD_ssThresh, flagSSmethod, driftOrder, flagMotionCorrect)

Default Parameters :

  • trange: [-2.0, 20.0]
  • glmSolveMethod: 1
  • idxBasis: 2
  • paramsBasis: [0.1 3.0 10.0 1.8 3.0 10.0]
  • rhoSD_ssThresh: 15.0
  • flagSSmethod: 1
  • driftOrder: 3
  • flagMotionCorrect: 0

Prerequisites :

  • Delta_OD_to_Conc: dc = hmrR_OD2Conc( dod, probe, ppf )
⚠️ **GitHub.com Fallback** ⚠️