Skip to content

Commit 4fe505c

Browse files
committed
More doclines
1 parent c249916 commit 4fe505c

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

phys2denoise/metrics/cardiac.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,46 @@ def heart_rate_variability(card, peaks, samplerate, window=6, central_measure="m
106106
"""
107107
Compute average heart rate variability (HRV) in a sliding window.
108108
109+
Parameters
110+
----------
111+
card : list or 1D numpy.ndarray
112+
Timeseries of recorded cardiac signal
113+
peaks : list or 1D numpy.ndarray
114+
array of peak indexes for card.
115+
samplerate : float
116+
Sampling rate for card, in Hertz.
117+
window : float, optional
118+
Size of the sliding window, in seconds.
119+
Default is 6.
120+
central_measure : "mean","average", "avg", "median", "mdn", string, optional
121+
Measure of the center used (mean or median).
122+
Default is "mean".
123+
Returns
124+
-------
125+
card_met : 2D numpy.ndarray
126+
Heart Beats Interval or Heart Rate Variability timeseries.
127+
The first column is the raw metric, in Hertz.
128+
The second column is the metric convolved with the CRF, cut to the length
129+
of the raw metric.
130+
131+
Notes
132+
-----
133+
Heart rate variability (HRV) is taken from [1]_, and computed as the amounts of
134+
beats per minute.
135+
However, operationally, it is the average of the inverse of the time interval
136+
between two heart beats.
137+
This metric should be convolved with the cardiac response function
138+
before being included in a GLM.
139+
140+
IMPORTANT : The unit of measure has a meaning, since they it's based on Hertz.
141+
Hence, zscoring might remove important quantifiable information.
142+
109143
See `_cardiac_metrics` for full implementation.
144+
145+
References
146+
----------
147+
.. [1] C. Chang, J. P. Cunningham, & G. H. Glover, "Influence of heart rate on the
148+
BOLD signal: The cardiac response function", NeuroImage, vol. 44, 2009
110149
"""
111150
return _cardiac_metrics(
112151
card, peaks, samplerate, metric="hrv", window=6, central_measure="mean"
@@ -118,7 +157,44 @@ def heart_beat_interval(card, peaks, samplerate, window=6, central_measure="mean
118157
"""
119158
Compute average heart beat interval (HBI) in a sliding window.
120159
160+
Parameters
161+
----------
162+
card : list or 1D numpy.ndarray
163+
Timeseries of recorded cardiac signal
164+
peaks : list or 1D numpy.ndarray
165+
array of peak indexes for card.
166+
samplerate : float
167+
Sampling rate for card, in Hertz.
168+
window : float, optional
169+
Size of the sliding window, in seconds.
170+
Default is 6.
171+
central_measure : "mean","average", "avg", "median", "mdn", string, optional
172+
Measure of the center used (mean or median).
173+
Default is "mean".
174+
Returns
175+
-------
176+
card_met : 2D numpy.ndarray
177+
Heart Beats Interval or Heart Rate Variability timeseries.
178+
The first column is the raw metric, in seconds.
179+
The second column is the metric convolved with the CRF, cut to the length
180+
of the raw metric.
181+
182+
Notes
183+
-----
184+
Heart beats interval (HBI) definition is taken from [1]_, and consists of the
185+
average of the time interval between two heart beats within a 6-seconds window.
186+
This metric should be convolved with an inverse of the cardiac response function
187+
before being included in a GLM.
188+
189+
IMPORTANT : The unit of measure has meaning, since it is based on seconds.
190+
Hence, zscoring might remove important quantifiable information.
191+
121192
See `_cardiac_metrics` for full implementation.
193+
194+
References
195+
----------
196+
.. [1] J. E. Chen et al., "Resting-state "physiological networks"", Neuroimage,
197+
vol. 213, pp. 116707, 2020.
122198
"""
123199
return _cardiac_metrics(
124200
card, peaks, samplerate, metric="hbi", window=6, central_measure="mean"

0 commit comments

Comments
 (0)