pyhrf.sandbox.physio.
buildOrder1FiniteDiffMatrix_central
(size, dt)¶returns a toeplitz matrix for central differences to correct for errors on the first and last points (due to the fact that there is no rf[-1] or rf[size] to average with):
pyhrf.sandbox.physio.
calc_linear_rfs
(simu_brf, simu_prf, phy_params, dt, normalized_rfs=True)¶Calculate ‘prf given brf’ and ‘brf given prf’ based on the a linearization around steady state of the physiological model as described in Friston 2000.
- Input:
- simu_brf, simu_prf: brf and prf from the physiological simulation
- from which you wish to calculate the respective prf and brf. Assumed to be of size (1,hrf.size)
- phy_params
- normalized_rfs: set to True if simu_hrfs are normalized
- Output:
- calc_brf, calc_prf: np.arrays of shape (hrf.size, 1)
- q_linear, v_linear: q and v calculated according to the linearized model
Note: These calculations do not account for any rescaling between brf and prf. This means the input simu_brf, simu_prf should NOT be rescaled.
pyhrf.sandbox.physio.
create_asl_from_stim_induced
(bold_stim_induced_rescaled, perf_stim_induced, ctrl_tag_mat, dsf, perf_baseline, noise, drift=None, outliers=None)¶Downsample stim_induced signal according to downsampling factor ‘dsf’ and add noise and drift (nuisance signals) which has to be at downsampled temporal resolution.
pyhrf.sandbox.physio.
create_bold_from_hbr_and_cbv
(physiological_params, hbr, cbv)¶Compute BOLD signal from HbR and blood volume variations obtained by a physiological model
pyhrf.sandbox.physio.
create_evoked_physio_signals
(physiological_params, paradigm, neural_efficacies, dt, integration_step=0.05)¶Generate evoked hemodynamics signals by integrating a physiological model.
Parameters: |
|
---|---|
Returns: | All generated signals, indexes of the first axis correspond to:
|
Return type: | np.array((nb_signals, nb_scans, nb_voxels), float) |
pyhrf.sandbox.physio.
create_omega_prf
(primary_brf, dt, physiological_params)¶pyhrf.sandbox.physio.
create_physio_brf
(physiological_params, response_dt=0.5, response_duration=25.0, return_brf_q_v=False)¶Generate a BOLD response function by integrating a physiological model and setting its driving input signal to a single impulse.
Parameters: |
|
---|---|
Returns: |
|
pyhrf.sandbox.physio.
create_physio_prf
(physiological_params, response_dt=0.5, response_duration=25.0, return_prf_q_v=False)¶Generate a perfusion response function by setting the input driving signal of the given physiological model with a single impulse.
Parameters: |
|
---|---|
Returns: |
|
pyhrf.sandbox.physio.
create_tbg_neural_efficacies
(physiological_params, condition_defs, labels)¶Create neural efficacies from a truncated bi-Gaussian mixture.
TODO: settle how to relate brls and prls to neural efficacies
Parameters: |
|
---|---|
Returns: | the generated neural efficacies |
Return type: | np.array(np.array((nb_cond, nb_vox), float)) |
pyhrf.sandbox.physio.
linear_rf_operator
(rf_size, phy_params, dt, calculating_brf=False)¶pyhrf.sandbox.physio.
phy_integrate_euler
(phy_params, tstep, stim, epsilon, Y0=None)¶Integrate the ODFs of the physiological model with the Euler method.
TODO: should the output signals be rescaled wrt their value at rest?
Parameters: |
|
---|---|
Returns: | the integrated physiological signals, where indexes of the first axis correspond to:
|
Return type: | np.array((4, nb_steps), float) |
pyhrf.sandbox.physio.
plot_calc_hrf
(hrf1_simu, hrf1_simu_name, hrf1_calc, hrf1_calc_name, hrf2_simu, hrf2_simu_name, dt)¶pyhrf.sandbox.physio.
rescale_bold_over_perf
(bold_stim_induced, perf_stim_induced, bold_perf_ratio=5.0)¶pyhrf.sandbox.physio.
run_calc_linear_rfs
()¶Choose physio parameters. Choose to generate simu_rfs from multiple or single stimulus.
TODO:
pyhrf.sandbox.physio.
simulate_asl_full_physio
(output_dir=None, noise_scenario='high_snr', spatial_size='tiny')¶Generate ASL data by integrating a physiological dynamical system.
dict (<item_label (str)> : <simulated_item (np.ndarray)>) -> a dictionary mapping names of simulated items to their values
TODO: use magnetization model to properly simulate final ASL signal
pyhrf.sandbox.physio.
simulate_asl_phylin_prf
(output_dir=None, noise_scenario='high_snr', spatial_size='tiny')¶Generate ASL data according to a LTI system, with canonical BRF and PRF = Omega.BRF.
Parameters: |
|
---|
dict (<item_label (str)> : <simulated_item (np.ndarray)>) -> a dictionary mapping names of simulated items to their values
pyhrf.sandbox.physio.
simulate_asl_physio_rfs
(output_dir=None, noise_scenario='high_snr', spatial_size='tiny', v_noise=None)¶Generate ASL data according to a LTI system, with PRF and BRF generated from a physiological model.
Parameters: |
|
---|
dict (<item_label (str)> : <simulated_item (np.ndarray)>) -> a dictionary mapping names of simulated items to their values