Skip to content

01. History and Development: MATLAB (standalone and SPM plugin)

Sofie Van Den Bossche edited this page Feb 9, 2020 · 65 revisions

IMPORTANT: Please use Google Chrome to browse the History and Development Page! If you don't, you won't be able to expand the collapsibles. [WIP]

Introduction

SPM_plugin_history

Here below, you can find a chronological overview [newest --> oldest] of the rsHRF toolbox's main modifications through the last years [2019 --> 2016], resulting in the latest version of the SPM plugin (v2.2). The three main releases of the rsHRF SPM plugin (i.e. v1.0, v2.0, and v2.2) can be downloaded by clicking on the corresponding 🏷 next to the commit date; these collapsibles are opened by default. For more information, head over to the INSTALLATION PAGE!

Modifications are either related to code or documentation/demo files which will be indicated by respectively a πŸ’» or πŸ“– emoji next to the commit date. Please note that a few smaller commits (e.g. minor debugging, lay-out tweaks...) are omitted. To consult the complete overview of a file's commit history, right-click on the corresponding superscript number and choose to open the link in a new tab. For example, to consult the GitHub commit history of wgr_get_parameters.m2, right-click on the 2 superscript and open the link in a new tab. You will now see a list of two commits associated with the wgr_get_parameters.m2 script, i.e. respectively on Oct 28, 2016 and Jul 20, 2016. After clicking on a commit (e.g. canon2dd on Jul 20, 2016), you will be able to see the number of changed files, along with the number of additions and deletions. In this particular example, there are 2 changed files with 58 additions and 4 deletions.

commit_history_01

Legend

Emoji Meaning
πŸ’» CODE
πŸ“– DOCUMENTATION/DEMO
πŸ”‘ LICENSE
🏷 RELEASE VERSION

Overview

Files with:

+  Additions (A)
!  Modifications (M)
-  Deletions (D)

2019

πŸ” Nov 15, 2019 πŸ’» πŸ“– – 🏷 v2.2
+  πŸ’» CODE + πŸ“– DOCUMENTATION/DEMO: SPM plugin (v2.2)

Version 2.2 of the SPM plugin is released on GitHub, adding a surface-based analysis module (Aug, 2018: v2.1), changing the GUI (with the addition of a surface analysis panel and Display), adding a rsHRF_viewer.m36 for the visualization of HRF shapes, adding a m-file (rsHRF_mvgc.m35) for multivariate Granger causality connectivity analysis, updating the HRF basis functions with the addition of Gamma/Fourier basis functions32 (which are more flexible and support a finer temporal grid), updating the (s)FIR model using AR(k) for auto-correlated noise modeling33, and adding a m-file (rsHRF_estimation_impulseest.m34, see code for help) for non-parametric impulse response estimation (which is not included in the rsHRF GUI). These updates are also available in: update_log.txt37. Corresponding modifications are inserted into rsHRF.m20, tbx_cfg_rsHRF.m21, and rsHRF_install_SPM.m31. A few global parameters are added to wgr_rsHRF_global_para.m25. The pipeline for voxel-wise rsHRF estimation and deconvolution as well as parameter retrieval using the updated HRF basis functions is illustrated by means of three separate hands-on demos in MATLAB: demo_rsHRF_temporal_basis.m38, demo_rsHRF_FIR_sFIR.m39, and demo_rsHRF_impulseest.m40.

Apr 13, 2019 πŸ“–
+  πŸ“– DOCUMENTATION/DEMO 

The pipeline for voxel-wise rsHRF deconvolution using wgr_deconv_canonhrf_par.m4, along with a brief theoretical framework, is available on https://guorongwu.github.io/HRF/rsHRF_deconv.html.

πŸ” Jan 9, 2019 πŸ’» πŸ“– – 🏷 v2.0
!  πŸ’» CODE: SPM plugin (v2.0)

Version 2.0 of the SPM plugin is released on GitHub, adding both functional (Pearson/Spearman correlation) and effective (Pairwise/Conditional/Partially Conditioned Granger causality) connectivity analyses to the processing pipeline. Corresponding modifications are inserted into rsHRF.m20, rsHRF.man22, and tbx_cfg_rsHRF.m21 with all connectivity subfunctions being incorporated into rsHRF.m20. A few global parameters are added to/omitted from wgr_rsHRF_global_para.m25.

+  πŸ’» CODE: rsHRF_install_SPM.m

Running rsHRF_install_SPM.m31 in the Command Window within the downloaded rsHRF GitHub repository will install SPM (if not yet available) and copy all files included in the rsHRF_file cell array to ./SPM/toolbox/rsHRF.

!  πŸ“– DOCUMENTATION/DEMO

The folder demo_jobs26 is expanded and compressed (.zip) by adding several new MATLAB batch jobs containing connectivity analyses to illustrate the pipeline for voxel-wise rsHRF estimation and deconvolution as well as parameter retrieval using the SPM plugin (v2.0). Corresponding information concerning the new batch job examples can be found in an updated version of rsHRF_toolbox.pptx27.

2018

Aug 29 + Nov 4 + Dec 9, 2018 πŸ’» πŸ“–
!  πŸ’» CODE + πŸ“– DOCUMENTATION/DEMO: <DEBUGGING>
  • knee_pt.m12:
    • Nov 4, 2018: If (length(lag) < 3), min() is used instead of the knee_pt.m12 function for the rsHRF lag estimation; the knee_pt.m12 function is modified accordingly.
    • Dec 9, 2018: To uniform wgr_rshrf_estimation_canonhrf2dd_par2.m1 and wgr_rsHRF_FIR.m11, the wgr_rshrf_estimation_canonhrf2dd_par2.m1 function is revised. Concretely, beta(:, id+1) and lag(id+1) are selected instead of beta(:, id) and lag(id) respectively.
  • datatype:
    • Nov 4, 2018: v1(i).dt = [16,0] is included as the NIfTI file’s (.nii) datatype in demo_4d_data.m7 and rsHRF.m20.
Aug 14, 2018 πŸ”‘
+  πŸ”‘ LICENSE

A BSD 3-Clause License30 is added to the rsHRF GitHub repository.

Aug 4 – 5, 2018 πŸ’» πŸ“–
!  πŸ’» CODE + πŸ“– DOCUMENTATION/DEMO: Tikhonov regularization

The knee_pt.m12 function is inserted into wgr_rshrf_estimation_canonhrf2dd_par2.m1 as an alternative to min() for the rsHRF lag estimation. To avoid division by zero when deconvolving the BOLD signal using the Inverse fast Fourier transform (ifft.m), the Tikhonov regularization was implemented and adapted accordingly in demo_4d_rsHRF.m7, demo_voxel.m15, demo_voxel_calcium.m17, and rsHRF.m20.

πŸ” Jul 21 – Jul 31, 2018 πŸ’» πŸ“– – 🏷 v1.0
+  πŸ’» CODE: SPM plugin (v1.0)

Version 1.0 of the SPM plugin is committed to GitHub with the main spm_rsHRF.m19 script calling rsHRF.m20 along with its configuration file (tbx_cfg_rsHRF.m21). The rsHRF toolbox’s version and description can be found in rsHRF.man22. Henceforth, outliers based on the rsHRF RH can be deleted and interpolated accordingly by respectively using deleteoutliers.m23 and inpaint_nans3.m24. The parameter used for local peak detection (localK) is modified with its value depending on the TR. Some global parameters such as the interpolation method, can be adapted in wgr_rsHRF_global_para.m25, while the rsHRF estimation method can be set to either canon2dd1 or (s)FIR11.

+  πŸ“– DOCUMENTATION/DEMO: batch jobs

The folder demo_jobs26 is created containing a few different MATLAB batch jobs to illustrate the pipeline for voxel-wise resting-state rsHRF estimation and deconvolution as well as parameter retrieval using the SPM plugin (v1.0). More detailed information concerning the installation and the batch job examples can be found in rsHRF_toolbox.pptx27. In addition, two more data examples are available: eve.mat28, and voxelsample_bilgin.mat29.

Jun 18, 2018 πŸ“–
!  πŸ“– DOCUMENTATION/DEMO: zscoring and filtering

The hands-on demo in MATLAB7 is expanded by explicitly including zscoring and filtering13 into the preprocessing pipeline. You should not forget to include these steps. The README.md5 file is adapted accordingly; but these and further updates are not transferred to https://guorongwu.github.io/HRF/.

+  πŸ“– DOCUMENTATION/DEMO: examples

The expanded demo applied to two specific examples, i.e., a sample voxel from the Human Connectome Project (HCP; voxelsample_hcp.mat16; XXX) and calcium.mat18, is committed to GitHub.

Jun 7 – 8, 2018 πŸ’» πŸ“–
!  πŸ’» CODE + πŸ“– DOCUMENTATION/DEMO: number of pseudo point process events

The event_bold parameter is added/updated in(to) the wgr_rshrf_estimation_canonhrf2dd_par2.m1 and wgr_rsHRF_FIR.m11 functions. As a result, each voxel’s number of pseudo point process events can be written back into a NIfTI (.nii) file (demo_4d_rsHRF.m7). The knee_pt.m12 function has not yet been inserted into wgr_rshrf_estimation_canonhrf2dd_par2.m1 as an alternative to min() for the rsHRF lag estimation. M: Aug 4 – 5, 2018

May 31 – Jun 3, 2018 πŸ’» πŸ“–
+  πŸ’» CODE: <MERGE + REMOVE REDUNDANT CODE> + filtering functions

The hrf_retrieval_and_deconvolution_para.m9 script is removed, along with the rbeta rsHRF estimation method. The function is replaced by a standalone MATLAB function to estimate the rsHRF using the (s)FIR basis functions11 without the option to upsample the time resolution. The temporal mask used to exclude pseudo point process events induced by motion artifacts is included as a parameter. In addition, the knee_pt.m12 function is committed to GitHub and inserted into wgr_rsHRF_FIR.m11 as an alternative to min() for the rsHRF lag estimation. Two filtering functions13,14 from the REST toolbox (Song et al., 2011) are committed to GitHub as well.

!  πŸ“– DOCUMENTATION/DEMO: <MERGE + REMOVE REDUNDANT CODE>

The demo_main_deconvolution_FIR.m10 script is removed. Instead, the FIR and (s)FIR rsHRF estimation methods (wgr_rsHRF_FIR.m11) are included into demo_4d_rsHRF.m7.

2017

Dec 18, 2017 πŸ’» πŸ“–
+  πŸ’» CODE: sFIR and rbeta

An updated and expanded version9 of wgr_deconv_canonhrf_par.m4 with the rsHRF estimation method set by the flag parameter, being either canon2dd, the smoothed Finite Impulse Response basis functions (denoted as sFIR), or the rbeta function (Tagliazucchi et al., 2012). The option to upsample the time resolution and the temporal_mask argument used to exclude pseudo point process events induced by motion artifacts have not yet been included. Again, some subfunctions of the MATLAB code are modified from the HRF Estimation Toolbox3 (Lindquist, Waugh, & Wager, 2007).

+  πŸ“– DOCUMENTATION/DEMO

A separate hands-on demo in MATLAB10 to illustrate the pipeline for voxel-wise rsHRF deconvolution using hrf_retrieval_and_deconvolution_para.m9.

Apr 28, 2017 πŸ“–
+  πŸ“– DOCUMENTATION/DEMO: 4D NIfTI

An updated and expanded version7 of the more detailed hands-on demo in MATLAB including the option to read and write 4D NIfTI (.nii) files and implementing wgr_rshrf_estimation_canonhrf2dd_par2.m1 and wgr_get_parameters.m2 instead of wgr_deconv_canonhrf_par.m4, is committed to GitHub. A data structure example8 is committed as well.

Dec 16, 2016 πŸ“– (reference in README.md5 on Jan 13, 2017)
!  πŸ“– DOCUMENTATION/DEMO  

The pipeline for voxel-wise rsHRF estimation as well as parameter retrieval as illustrated by means of a concise overview in Markdown5, along with a brief theoretical framework, is available on https://guorongwu.github.io/HRF/.

2016

Jul 20, 2016 πŸ’» πŸ“–
+  πŸ’» CODE: canon2dd

MATLAB code for voxel-wise rsHRF estimation and deconvolution1 as well as parameter retrieval2 (RH, TTP, and FWHM) using a canonical HRF with its delay and dispersion derivatives (denoted as canon2dd); also including an option to upsample the time resolution and the temporal mask used to exclude pseudo point process events induced by motion artifacts. Some subfunctions of the MATLAB code are modified from the HRF Estimation Toolbox3 (Lindquist, Waugh, & Wager, 2007).

+  πŸ“– DOCUMENTATION/DEMO

Illustrating the pipeline for voxel-wise rsHRF estimation as well as parameter retrieval by means of a concise overview in Markdown5 using wgr_rshrf_estimation_canonhrf2dd_par2.m1 and wgr_get_parameters.m2 and a reference to a more detailed hands-on demo in MATLAB6 using wgr_deconv_canonhrf_par.m4; the latter also illustrates the voxel-wise rsHRF deconvolution.

Files

Click to see more:

File Name Additional information
1. wgr_rshrf_estimation_canonhrf2dd_par2.m1 modified from an older version (wgr_deconv_canonhrf_par.m4) with the modified Fit_Canonical_HRF()3 and CanonicalBasisSet()3 subfunctions; the older version4 is not committed to the rsHRF GitHub repository

File Name Additional information
2. wgr_get_parameters.m2 modified from get_parameters2.m3
3. Estimation Toolbox3
(Lindquist, Waugh, & Wager, 2007)
4. wgr_deconv_canonhrf_par.m4
5. README.md5
6. wgr_voxelwise_HRF_deconvolution_demo.m6
7. demo_4d_rsHRF.m7 M: Aug 6, 2018 (renamed to demo_4D_data.m)
8. data_structure_example.txt8 M: Jun 19, 2018
9. hrf_retrieval_and_deconvolution_para.m9 D: May 31, 2018 (with the modified Fit_Canonical_HRF2()3, CanonicalBasisSet()3, Fit_sFIR()3, and tor_make_deconv_mtx3()3 subfunctions)
10. demo_main_deconvolution_FIR.m10 D: May 31, 2018
11. wgr_rsHRF_FIR.m11 with the modified Fit_sFIR2()3 and tor_make_deconv_mtx3()3 subfunctions
12. knee_pt.m12
13. rest_IdealFilter.m13
14. rest_nextpow2_one35.m14
15. demo_voxel.m15
16. voxelsample_hcp.mat16
17. demo_voxel_calcium.m17
18. calcium.mat18 A: Jul 22, 2018; M: Dec 25, 2018 (moved to rsHRF_data)
19. spm_rsHRF.m19
20. rsHRF.m20
21. tbx_cfg_rsHRF.m21
22. rsHRF.man22
23. deleteoutliers.m23
24. inpaint_nans3.m24
25. wgr_rsHRF_global_para.m25
26. demo_jobs26 contains ROIsig_job01.mat, ROIwise_normalized_space_job01.mat, voxelwise_native_space_job01.mat, voxelwise_normalized_space_job01.mat
27. rsHRF_toolbox.pptx27
28. eve.mat28
29. voxelsample_bilgin.mat29
30. License30
31. rsHRF_install_SPM.m31
32. rsHRF_estimation_temporal_basis.m32
33. rsHRF_estimation_FIR.m33
34. rsHRF_estimation_impulseest.m34
35. rsHRF_mvgc.m35
36. rsHRF_viewer.m36
37. update_log.txt37
38. demo_rsHRF_temporal_basis.m38
39. demo_rsHRF_FIR_sFIR.m39
40. demo_rsHRF_impulseest.m40

References:

πŸ”