Spaces:
Sleeping
Sleeping
Enhance EMG plot with circle text labels and adjust logo size.
Browse files- app.py +29 -4
- logo/itri_logo.jpg +0 -0
- test-new/0-New_Task-recording-0.csv +0 -0
- test-new/time_marker.csv +8 -12
app.py
CHANGED
|
@@ -58,7 +58,7 @@ def emg_plot(event_index, event_plot_name, left_std_ratio, left_delta_t, right_s
|
|
| 58 |
# Create text box style
|
| 59 |
bbox_props = dict(
|
| 60 |
boxstyle='round,pad=0.5',
|
| 61 |
-
fc='#1f77b4', #
|
| 62 |
ec='#1f77b4', # 邊框顏色(藍色)
|
| 63 |
alpha=0.7, # 背景透明度
|
| 64 |
lw=1.5 # 邊框寬度
|
|
@@ -71,12 +71,37 @@ def emg_plot(event_index, event_plot_name, left_std_ratio, left_delta_t, right_s
|
|
| 71 |
color='white',
|
| 72 |
fontweight='semibold',
|
| 73 |
fontsize=9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
# Add styled quadrant labels
|
| 76 |
-
add_styled_text(
|
|
|
|
|
|
|
| 77 |
add_styled_text(-4, 0.5, "Exertion - / Coordination -", 'bottom')
|
|
|
|
|
|
|
| 78 |
add_styled_text(-4, -0.5, "Exertion - / Coordination +", 'top')
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
# Add title and axis labels
|
| 82 |
plt.title(f'Muscle Coordination Analysis - {event_index}:{event_plot_name}', fontsize=14)
|
|
@@ -102,7 +127,7 @@ def emg_plot(event_index, event_plot_name, left_std_ratio, left_delta_t, right_s
|
|
| 102 |
|
| 103 |
|
| 104 |
def main():
|
| 105 |
-
st.image("logo/itri_logo.jpg", width=
|
| 106 |
st.title('👅Dysphagia Analysis - by ITRI BDL')
|
| 107 |
|
| 108 |
|
|
|
|
| 58 |
# Create text box style
|
| 59 |
bbox_props = dict(
|
| 60 |
boxstyle='round,pad=0.5',
|
| 61 |
+
fc='#1f77b4', # 背景顏色(藍色)
|
| 62 |
ec='#1f77b4', # 邊框顏色(藍色)
|
| 63 |
alpha=0.7, # 背景透明度
|
| 64 |
lw=1.5 # 邊框寬度
|
|
|
|
| 71 |
color='white',
|
| 72 |
fontweight='semibold',
|
| 73 |
fontsize=9)
|
| 74 |
+
|
| 75 |
+
def add_circle_text(x, y, text, va='bottom'):
|
| 76 |
+
# Create text box style
|
| 77 |
+
bbox_props = dict(
|
| 78 |
+
boxstyle='circle,pad=0.5',
|
| 79 |
+
fc='#262626', # 背景顏色(黑色)
|
| 80 |
+
ec='#262626', # 邊框顏色(黑色)
|
| 81 |
+
alpha=0.7, # 背景透明度
|
| 82 |
+
lw=1.5 # 邊框寬度
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
plt.text(x, y, text,
|
| 86 |
+
horizontalalignment='center',
|
| 87 |
+
verticalalignment=va,
|
| 88 |
+
bbox=bbox_props,
|
| 89 |
+
color='white',
|
| 90 |
+
fontweight='semibold',
|
| 91 |
+
fontsize=10)
|
| 92 |
|
| 93 |
# Add styled quadrant labels
|
| 94 |
+
add_styled_text(5, 0.5, "Exertion + / Coordination -", 'bottom')
|
| 95 |
+
add_circle_text(1, 0.5, "4", 'bottom')
|
| 96 |
+
|
| 97 |
add_styled_text(-4, 0.5, "Exertion - / Coordination -", 'bottom')
|
| 98 |
+
add_circle_text(-8, 0.5, "2", 'bottom')
|
| 99 |
+
|
| 100 |
add_styled_text(-4, -0.5, "Exertion - / Coordination +", 'top')
|
| 101 |
+
add_circle_text(-8, -0.5, "1", 'top')
|
| 102 |
+
|
| 103 |
+
add_styled_text(5, -0.5, "Exertion + / Coordination +", 'top')
|
| 104 |
+
add_circle_text(1, -0.5, "3", 'top')
|
| 105 |
|
| 106 |
# Add title and axis labels
|
| 107 |
plt.title(f'Muscle Coordination Analysis - {event_index}:{event_plot_name}', fontsize=14)
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
def main():
|
| 130 |
+
st.image("logo/itri_logo.jpg", width=700)
|
| 131 |
st.title('👅Dysphagia Analysis - by ITRI BDL')
|
| 132 |
|
| 133 |
|
logo/itri_logo.jpg
CHANGED
|
|
test-new/0-New_Task-recording-0.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
test-new/time_marker.csv
CHANGED
|
@@ -1,13 +1,9 @@
|
|
| 1 |
Abs_time(us),0-New_Task-recording_time(us),topic,type,name,uuid,signal,description,color,order,tag
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
1733899771849409.0,89673825.0,keyboard/s,keyboard,Keyboard,8fa85742-77ec-475c-a6dc-0fd4a986c943,s,Swallow,#fab6b6,4,start
|
| 11 |
-
1733899773334247.0,91158663.0,keyboard/s,keyboard,Keyboard,8005446f-862c-446b-bc7e-7c428efc1f7a,s,Swallow,#fab6b6,4,end
|
| 12 |
-
1733899774433363.0,92257779.0,keyboard/c,keyboard,Keyboard,260efabb-3944-448b-88b4-1eef7de020dd,c,Cough,#baeea0,5,start
|
| 13 |
-
1733899775890252.0,93714668.0,keyboard/c,keyboard,Keyboard,60fe4089-f190-4a34-9b49-7b6392f2dcb9,c,Cough,#baeea0,5,end
|
|
|
|
| 1 |
Abs_time(us),0-New_Task-recording_time(us),topic,type,name,uuid,signal,description,color,order,tag
|
| 2 |
+
1734331056858600.0,26904611.0,keyboard/s,keyboard,Keyboard,8fa85742-77ec-475c-a6dc-0fd4a986c943,s,Swallow,#fab6b6,2,start
|
| 3 |
+
1734331060081929.0,30127940.0,keyboard/s,keyboard,Keyboard,8005446f-862c-446b-bc7e-7c428efc1f7a,s,Swallow,#fab6b6,2,end
|
| 4 |
+
1734331070946054.0,40992065.0,keyboard/s,keyboard,Keyboard,8fa85742-77ec-475c-a6dc-0fd4a986c943,s,Swallow,#fab6b6,3,start
|
| 5 |
+
1734331076590793.0,46636804.0,keyboard/s,keyboard,Keyboard,8005446f-862c-446b-bc7e-7c428efc1f7a,s,Swallow,#fab6b6,3,end
|
| 6 |
+
1734331085109235.0,55155246.0,keyboard/s,keyboard,Keyboard,8fa85742-77ec-475c-a6dc-0fd4a986c943,s,Swallow,#fab6b6,4,start
|
| 7 |
+
1734331089506494.0,59552505.0,keyboard/s,keyboard,Keyboard,8005446f-862c-446b-bc7e-7c428efc1f7a,s,Swallow,#fab6b6,4,end
|
| 8 |
+
1734331100063876.0,70109887.0,keyboard/s,keyboard,Keyboard,8fa85742-77ec-475c-a6dc-0fd4a986c943,s,Swallow,#fab6b6,5,start
|
| 9 |
+
1734331104130500.0,74176511.0,keyboard/s,keyboard,Keyboard,8005446f-862c-446b-bc7e-7c428efc1f7a,s,Swallow,#fab6b6,5,end
|
|
|
|
|
|
|
|
|
|
|
|