Example #1
0
 def generate_prediction(self, model: sciunit.Model, verbose: bool = False) -> float:
     efel.reset()
     stim_start = 10.0   # ms
     stim_dur   = 50.0   # ms
     stim_amp   = -1.0   # nA
     efel.setDoubleSetting('stimulus_current', stim_amp)
     model.inject_soma_square_current(current={'delay':stim_start,
                                               'duration':stim_dur,
                                               'amplitude':stim_amp})
     trace = model.get_soma_membrane_potential_eFEL_format(tstop=stim_start+stim_dur+stim_start,
                                                          start=stim_start,
                                                          stop =stim_start+stim_dur)
     prediction = efel.getFeatureValues([trace], ['ohmic_input_resistance_vb_ssse'])[0]["ohmic_input_resistance_vb_ssse"][0]
     return prediction
Example #2
0
 def generate_prediction(self, model: sciunit.Model, verbose: bool = False) -> Optional[float]:
     efel.reset()
     stim_start = 10.0   # ms
     stim_dur   = 5.0    # ms
     stim_amp   = 15.0   # nA
     efel.setDoubleSetting('stimulus_current', stim_amp)
     model.inject_soma_square_current(current={'delay':stim_start,
                                               'duration':stim_dur,
                                               'amplitude':stim_amp})
     trace = model.get_soma_membrane_potential_eFEL_format(tstop=stim_start+stim_dur+stim_start,
                                                          start=stim_start,
                                                          stop =stim_start+stim_dur)
     output = efel.getFeatureValues([trace], ['AP_duration_half_width'])[0]["AP_duration_half_width"]
     prediction = output[0] if output else None
     return prediction