Fork me on GitHub

pyhrf.boldsynth.hrf module

pyhrf.boldsynth.hrf.bezierCurve(p1, pc1, p2, pc2, xPrecision)
pyhrf.boldsynth.hrf.buildFiniteDiffMatrix(order, size)
pyhrf.boldsynth.hrf.genBezierHRF(timeAxis=array([ 0. , 0.6, 1.2, 1.8, 2.4, 3. , 3.6, 4.2, 4.8, 5.4, 6. , 6.6, 7.2, 7.8, 8.4, 9. , 9.6, 10.2, 10.8, 11.4, 12. , 12.6, 13.2, 13.8, 14.4, 15. , 15.6, 16.2, 16.8, 17.4, 18. , 18.6, 19.2, 19.8, 20.4, 21. , 21.6, 22.2, 22.8, 23.4, 24. , 24.6, 25.2]), pic=[6, 1], picw=2, ushoot=[15, -0.2], ushootw=3, normalize=False)
pyhrf.boldsynth.hrf.genCanoBezierHRF(duration=25.0, dt=0.6, normalize=False)
pyhrf.boldsynth.hrf.genExpHRF(timeAxis=array([ 0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5]), ttp=6, pa=1, pw=0.2, ttu=11, ua=0.2, uw=0.01)
pyhrf.boldsynth.hrf.genGaussianSmoothHRF(zc, length, eventdt, rh, order=2)
pyhrf.boldsynth.hrf.genPriorCov(zc, pprcov, dt)
pyhrf.boldsynth.hrf.getCanoHRF(duration=25, dt=0.6, hrf_from_spm=True, delay_of_response=6.0, delay_of_undershoot=16.0, dispersion_of_response=1.0, dispersion_of_undershoot=1.0, ratio_resp_under=6.0, delay=0.0)

Compute the canonical HRF.

Parameters:
  • duration (int or float, optional) – time lenght of the HRF in seconds
  • dt (float, optional) – time resolution of the HRF in seconds
  • hrf_from_spm (bool, optional) – if True, use the SPM formula to compute the HRF, if False, use the hard coded values and resample if necessary. It is strongly advised to use True.
  • delay_of_response (float, optional) – delay of the first peak response in seconds
  • delay_of_undershoot (float, optional) – delay of the second undershoot peak in seconds
  • dispersion_of_response (float, optional) –
  • dispersion_of_undershoot (float, optional) –
  • ratio_resp_under (float, optional) – ratio between the response peak and the undershoot peak
  • delay (float, optional) – delay of the HRF
Returns:

  • time_axis (ndarray, shape (round(duration/dt)+1,)) – time axis of the HRF in seconds
  • HRF (ndarray, shape (round(duration/dt)+1,))

pyhrf.boldsynth.hrf.getCanoHRF_tderivative(duration=25.0, dt=0.5)