phys2cvr.regressors.create_physio_regressor¶
- phys2cvr.regressors.create_physio_regressor(func_avg, petco2hrf, tr, freq, outprefix, lag_max=None, lag_min=None, trial_len=None, n_trials=None, ext='.1D', lagged_regression=True, legacy=False, abs_xcorr=False, skip_xcorr=False)[source]¶
Create regressor(s) of interest for nifti GLM.
- Parameters:
- func_avg
np.ndarray Average functional timeseries (1D)
- petco2hrf
np.ndarray Regressor of interest (e.g., CO2 regressor)
- tr
str,int, orfloat Repetition time (TR) of timeseries
- freq
str,int, orfloat Sample frequency of petco2hrf
- outprefix
listorpath Path to output directory for computed regressors.
- lag_max
int,float, orNone, optional Upper limit of the temporal area to explore, expressed in seconds. Caution: this is not a pythonic range, but a real range, i.e. the upper limit is included. Default: None
- lag_min
int,float, orNone, optional Lower limit of the temporal area to explore, expressed in seconds. If set to None, and lag_max is not None and is positive, lag_min defaults to -lag_max (symmetric range). Default: None
- trial_len
strorint, optional Length of each individual trial for timeseries which include more than one trial (e.g., multiple BreathHold trials, trials within CO2 challenges, …) Used to improve cross correlation estimation. Default: None
- n_trials
strorint, optional Number of trials within the timeseries. Default: None
- ext
str, optional Extension to be used for the exported regressors (e.g., .txt, .csv)
- lagged_regression
bool, optional Estimate regressors for each possible lag of petco2hrf.
- legacy
bool, optional If True, exclude the upper (positive) lag limit from the regression estimation, i.e., the maximum number of regressors will be (freq*lag_max*2) If False, the maximum number of regressors will be (freq*lag_max*2)+1
- abs_xcorr
bool, optional If True, the cross correlation will consider the maximum absolute correlation, i.e., if a negative correlation is stronger than the strongest positive, the negative correlation will be used.
- skip_xcorr
bool, optional If True, skip the cross correlation step.
- func_avg
- Returns:
- petco2hrf_demean
np.ndarray The demeaned petco2hrf regressor, central in time (not shifted).
- petco2hrf_lagged
np.ndarray The other shifted versions of the regressor.
- petco2hrf_demean