phys2cvr.regressors.create_fine_shift_regressors¶
- phys2cvr.regressors.create_fine_shift_regressors(petco2hrf, optshift, lag_max, lag_min, freq, func_size, func_upsamp_size, outprefix, ext='.1D', legacy=False)[source]¶
Compute fine shifts to further optimize shifts.
- Parameters:
- petco2hrf
np.ndarray Regressor of interest
- optshift
int The index shift computed by the Xcorr/bulk shift
- 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
- freq
str,int, orfloat Sample frequency of petco2hrf
- func_size
int Total timepoints of functional timeseries
- func_upsamp_size
int Total timepoints of functional timeseries, resampled at freq frequency
- outprefix
listorpath Path to output directory for regressors.
- ext
str, optional Extension to be used for the exported regressors.
- legacy
bool, optional If True, exclude the upper lag limit from the regression estimation. If True, the maximum number of regressors will be (freq*lag_max*2)
- petco2hrf
- Returns:
- petco2hrf_lagged
np.ndarray The shifted versions of the regressor of interest.
- petco2hrf_lagged