You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
We are having problems with the feature extraction of the trace below.
It seems to me that AP_begin_indices are not detected before the start of the stimulus, but AP_end_indices are.
This issue results in an unequal number of AP_begin_indices (red) and AP_end_indices (dark blue) and causes several problems with other features.
The most concerning results are the negative feature values for AP_duration and AP_rise_time.
import numpy
import pandas as pd
import matplotlib.pyplot as plt
import efel
# print the efel version
print("\n","Efel version:",efel.__version__, "\n")
# load the time and voltage data
time_csv = pd.read_csv("time.csv", header=None, index_col=False)
time_data = time_csv[0].tolist()
voltage_csv = pd.read_csv("voltage.csv", header=None, index_col=False)
voltage_data = voltage_csv[0].tolist()
# create the trace
trace = {}
trace["T"] = time_data
trace["V"] = voltage_data
trace["stim_start"] = [200]
trace["stim_end"] = [200 + 200]
traces = [trace]
# extract the features from the trace
traces_results = efel.getFeatureValues(traces, ["AP_begin_indices", "AP_end_indices", "AP_duration", "AP_rise_time"])
# print the extracted features
print("AP_begin_indices\n:", traces_results[0]['AP_begin_indices'])
print("number of AP_begin_indices:",len(traces_results[0]['AP_begin_indices']), "\n")
print("AP_end_indices\n", traces_results[0]['AP_end_indices'])
print("number of AP_end_indices:",len(traces_results[0]['AP_end_indices']), "\n")
print("AP_durations:\n", traces_results[0]['AP_duration'])
print("number of AP_durations:",len(traces_results[0]['AP_duration']), "\n")
print("AP_rise_time\n", traces_results[0]['AP_rise_time'])
print("number of AP_rise_time:",len(traces_results[0]['AP_rise_time']), "\n")
# plot the data
plt.figure()
plt.plot(time_data,voltage_data)
# mark the AP begin (red) and end (dark blue) indices on the figure
h_dt = 0.025
x = traces_results[0]['AP_begin_indices']/10
votage_indices = [int(i/h_dt) for i in x] # rescaling with h.dt=0.025
y = [voltage_data[j] for j in votage_indices]
plt.plot(x, y, 'o', color='red', markersize=4)
x = traces_results[0]['AP_end_indices']/10
votage_indices = [int(i/h_dt) for i in x]
y = [voltage_data[j] for j in votage_indices]
plt.plot(x, y, 'o', color='darkblue', markersize=4)
plt.show()
The text was updated successfully, but these errors were encountered:
Hi @SzaBoglarka ! I am currently fixing this Issue. Is that alright if I use your trace data to add a test in eFel in order to avoid this kind of issue in the future?
Thank you very much!
I solved this issue with PR #353 . You can update your efel version. Do not hesitate to contact us if the issue persists or if you encounter another one
Hi,
We are having problems with the feature extraction of the trace below.
It seems to me that AP_begin_indices are not detected before the start of the stimulus, but AP_end_indices are.
This issue results in an unequal number of AP_begin_indices (red) and AP_end_indices (dark blue) and causes several problems with other features.
The most concerning results are the negative feature values for AP_duration and AP_rise_time.
Data:
time.csv
voltage.csv
Script:
The text was updated successfully, but these errors were encountered: