def sparse_run_variable_with_missing_values(): data = pd.DataFrame({ 'onset': [2, 5, 11, 17], 'duration': [1.2, 1.6, 0.8, 2], 'amplitude': [1, 1, np.nan, 1] }) run_info = [RunInfo({'subject': '01'}, 20, 2, 'dummy.nii.gz')] var = SparseRunVariable('var', data, run_info, 'events') return BIDSRunVariableCollection([var])
def test_convolve_impulse(): # Smoke test impulse convolution data = pd.DataFrame({ 'onset': [10, 20], 'duration': [0, 0], 'amplitude': [1, 1] }) run_info = [RunInfo({'subject': '01'}, 20, 2, 'dummy.nii.gz', 10)] var = SparseRunVariable( name='var', data=data, run_info=run_info, source='events') coll = BIDSRunVariableCollection([var]) transform.ToDense(coll, 'var', output='var_dense') transform.Convolve(coll, 'var', output='var_hrf') transform.Convolve(coll, 'var_dense', output='var_dense_hrf')