What is HRfunc?
The HRfunc is a Python library for estimating neural activity and hemodynamic response functions (HRFs) in functional near infrared spectroscopy (fNIRS) leveraging the MNE framework. Check out the tutorial page for more information and a video guide on how use HRfunc in your own fNIRS data.
How do I install HRfunc?
You can install HRfunc through pip through this command as long as you have python 3.8 or higher and pip installed.
pip install hrfunc
You will also download a number of dependencies like mne
How do I use the HRfunc tool?
To use the HRfunc tool, you'll need to follow four primary steps:
- Prepare your fNIRS data by loading in raw scans through MNE
- (Optional) Estimate subject-level HRFs for each subject
- (Optional) Generate a group-level HRF distribution
- Estimate neural activity in each subject
Note that estimating a subject-level HRF will require you're fNIRS data to have been collected from an event based design. Without an event based design, you'll either have to rely on a canonical HRF, or potentially an HRF you find from the HRtree. Visit the HRfunc guide for more information.
What is the HRtree?
The HRtree is a database of previously estimated HRFs from other fNIRS studies, with
a published paper describing data collection. Each HRF is described by the original estimator's
through the experimental contexts like age range or demographics. The HRFs are stored in in HRFs
in a variety of HRtree's constructed using two hybrid tree-hash table data structures. This
structure allows user to quickly look up HRF estimates that are close to brain regions the
fNIRS optodes are recording.
Alongside this each HRF is attached to experimental contexts described
by the original author and estimator describing the subject pool and experimental paradigm
the HRF was estimated from. Check out the HRtree page
for more information on accessing these previously estimated HRFs.
What are the requirements to submit estimated HRFs to the HRtree?
There are two primary requirements to submitting a HRF to be added to the HRtree. First you must estimate the HRFs using HRfunc, some modifications allowed with caveats. Second you must published a paper, attached to a DOI, detailing how this dataset the HRF was estimated from was collected. You can submit your HRF estimates through the HRF submission page. The HRFs you submitted, once reviewed, will be added to the HRtree. Apart of this process you will need to include details about you and the experimental paradigm and subject pool contexts of the HRF estimates origin.
How can I submit my estimated HRF to the HRtree?
Once you have estimated an HRF from your dataset and published a paper, attached to a DOI, detailing how this dataset was collected you can submit your HRF estimates through the HRF submission page on this website. The HRFs you submitted, once reviewed, will be added to the HRtree through the HRF submission page on this website. Apart of this process will include details about you and the experimental paradigm context the data came from.
What is an experimental context?
Experimental contexts are a wide range of descriptors used to describe as precise as possible the
origin of an HRF estimate. An example of a experimental context is age range, which is the age range
of the subject pool completing the experiment which the HRF was estimated from.
Another important experimental context is demographic, which in a general subject pool won't be applicable but
is relavent when estimating HRFs from subsets of your subject pool (i.e. only Women or Men).
For more see all the currently pre-defined experimental contexts, visit the
experimental context page.
How is an HRF and neural activity estimated?
HRfunc utilized Toeplitz deconvolution with ridge regression to estimate both HRFs and neural activity
in fNIRS data. This method was choosen due to it's relatively high accuracy alongside it's minimal
tuning requirement compared to other deconvolution methods like Bayesian deconvolution.
HRfunc was designed however to be easily extended and modified if you're inspired to try
higher accuracy deconvolution like Bayesian. You'll need to recreate the montage.estimate_hrfs()
and montage.estimate_activity()
in the main HRfunc montage
through the
HRfunc GitHub.
Create a new branch and we can experiment with your idea!
Why does my HRF have high variability on the edges of it's estimate?
A common artifact of Toeplitz deconvolution are edge artifacts that often cause dramatic increases
in variability. To remove these artifacts, HRfunc incorperates an edge expansion process which
temporarily increases the HRF event estimation window and removes the extra edges post estimation.
If your HRF appears to have higher variability on the edges of it's estimation window, try to increase
the edge_expansion
parameter apart of montage.estimate_hrfs()
function.
Can I use HRF's I estimated in one study on another?
Yes you can! A major benefit of using HRfunc is that you can easily use previously
estimated HRF estimates from a different subject pool and apply it too another, like when you
use the same fNIRS montage for multiple studies. You can also check the HRtree
for HRFs estimated in other studies, with the benefit of each HRF being tracable to it's origin through
DOI references paper's and detailed experimental context. The HRtree automatically filters for relavent
HRFs given the right inputs.
Before you estimate neural activity, you should consider whether the differences between
experimental paradigms are significant enough to illicite a unique HRF within unique populations of your
subject pool. In these cases, the HRFs you estimated may not accurate estimate neural activity
in the new subject pool. It's a delecate balance you will need to find, in case not you should
consider using a canonical HRF to better represent the
true HRF (which is automatically used by skipping HRF estimation altogether).
What are the requirements for uploading an HRF estimate?
The core core requirement's are that you used the HRfunc framework to generate
the HRF estimates and a DOI referenced paper describing the datasets it was estimated from,
Regardless of whether you use them for estimating neural activity, submitting subset HRFs
estimated on distinct subjects pool populations is encouraged.
The HRfunc tool stores subject-level HRF estimates for large scale
region-of-interest analysis between multiple studies, the more you
contribute the higher power these analysis will ultimately be.