Synav commited on
Commit
f8b83f4
·
verified ·
1 Parent(s): d0ee628

Update src/GVHD_Predictions_App.py

Browse files
Files changed (1) hide show
  1. src/GVHD_Predictions_App.py +124 -117
src/GVHD_Predictions_App.py CHANGED
@@ -1,118 +1,125 @@
1
- import streamlit as st
2
- import os
3
- import base64
4
-
5
- def load_image_as_base64(image_path):
6
- repo_root = os.path.dirname(os.path.abspath(__file__))
7
- image_path = os.path.join(repo_root, image_path)
8
- with open(image_path, "rb") as f:
9
- data = f.read()
10
- return base64.b64encode(data).decode()
11
-
12
- # Read image and encode in base64
13
- img_as_base64 = load_image_as_base64(os.path.join("img", "GVHD-Intel-logo.png"))
14
- logo_as_base64 = load_image_as_base64(os.path.join("img", "GVHD-Orgs-logo.png"))
15
-
16
- st.set_page_config(page_title="GVHD Predictions", layout="wide")
17
-
18
- # --- Flexible Footer CSS ---
19
- st.markdown(
20
- """
21
- <style>
22
- /* Make the main Streamlit container use flex layout */
23
- .stApp {
24
- display: flex;
25
- flex-direction: column;
26
- min-height: 100vh; /* full viewport height */
27
- }
28
-
29
- /* Content grows naturally */
30
- .main-content {
31
- flex: 1;
32
- }
33
-
34
- /* Footer styling */
35
- .footer {
36
- margin-top: auto; /* pushes footer to bottom */
37
- text-align: center;
38
- font-size: 14px;
39
- color: grey;
40
- opacity: 0.8;
41
- padding: 10px 5px;
42
- line-height: 1.4;
43
- }
44
-
45
- /* Responsive adjustments for mobile */
46
- @media (max-width: 600px) {
47
- .footer {
48
- font-size: 12px;
49
- padding: 8px 5px;
50
- }
51
- }
52
- </style>
53
- """,
54
- unsafe_allow_html=True
55
- )
56
-
57
- # --- MAIN CONTENT ---
58
- st.markdown('<div class="main-content">', unsafe_allow_html=True)
59
-
60
- # add GVHD logo
61
- st.markdown(
62
- f"""
63
- <div style="text-align:center">
64
- <img src="data:image/png;base64,{img_as_base64}" style="width:50%; max-width:800px;">
65
- </div>
66
- """,
67
- unsafe_allow_html=True
68
- )
69
-
70
- # add GVHD tagline
71
- st.markdown("""
72
- <div style="text-align:center">
73
- <h3>
74
- A modular prediction framework for Acute & Chronic GVHD risk assessment.<br>
75
- <i>Predict. Learn. Adapt.</i>
76
- </h3>
77
- </div>
78
- """, unsafe_allow_html=True)
79
-
80
-
81
- # --- Partners Section ---
82
- st.divider()
83
- st.subheader("Partners:")
84
- st.markdown(
85
- f"""
86
- <div style="text-align:center">
87
- <img src="data:image/png;base64,{logo_as_base64}" style="width:100%; max-width:1000px;">
88
- </div>
89
- """,
90
- unsafe_allow_html=True
91
- )
92
-
93
-
94
- # --- Disclaimer Section ---
95
- st.divider()
96
- st.write(
97
- """
98
- **Disclaimer: Experimental research platform — not approved for clinical use.**\\
99
- Modular AI-driven framework that centers can retrain with their own multi-center datasets to build and validate population-specific GVHD prediction models.\\
100
- Model performance varies by training data and updates.
101
- """)
102
-
103
- st.markdown('</div>', unsafe_allow_html=True)
104
- # --- End of MAIN CONTENT ---
105
-
106
- # --- Footer ---
107
- st.markdown(
108
- """
109
- <div class="footer">
110
- <br>
111
- <br>
112
- ©2025 Department of Health – Abu Dhabi<br>
113
- Partnership: SSMC (PureHealth) & MBZUAI<br>
114
- Data Collaborators: SKMC, Tawam Hospital, KHCC (Jordan)
115
- </div>
116
- """,
117
- unsafe_allow_html=True
 
 
 
 
 
 
 
118
  )
 
1
+ import streamlit as st
2
+ import os
3
+ import base64
4
+
5
+ def load_image_as_base64(image_path):
6
+ repo_root = os.path.dirname(os.path.abspath(__file__))
7
+ image_path = os.path.join(repo_root, image_path)
8
+ with open(image_path, "rb") as f:
9
+ data = f.read()
10
+ return base64.b64encode(data).decode()
11
+
12
+ # Read image and encode in base64
13
+
14
+ logo_as_base64 = load_image_as_base64(os.path.join("img", "GVHD-Orgs-logo.png"))
15
+
16
+ st.set_page_config(page_title="GVHD Predictions", layout="wide")
17
+
18
+ # --- Flexible Footer CSS ---
19
+ st.markdown(
20
+ """
21
+ <style>
22
+ /* Make the main Streamlit container use flex layout */
23
+ .stApp {
24
+ display: flex;
25
+ flex-direction: column;
26
+ min-height: 100vh; /* full viewport height */
27
+ }
28
+
29
+ /* Content grows naturally */
30
+ .main-content {
31
+ flex: 1;
32
+ }
33
+
34
+ /* Footer styling */
35
+ .footer {
36
+ margin-top: auto; /* pushes footer to bottom */
37
+ text-align: center;
38
+ font-size: 14px;
39
+ color: grey;
40
+ opacity: 0.8;
41
+ padding: 10px 5px;
42
+ line-height: 1.4;
43
+ }
44
+
45
+ /* Responsive adjustments for mobile */
46
+ @media (max-width: 600px) {
47
+ .footer {
48
+ font-size: 12px;
49
+ padding: 8px 5px;
50
+ }
51
+ }
52
+ </style>
53
+ """,
54
+ unsafe_allow_html=True
55
+ )
56
+
57
+ st.markdown("""
58
+ <div style="text-align:center">
59
+
60
+ ## GVHD-Intel Pro
61
+
62
+ ### Clinical Decision-Support & Outcome Simulation Platform
63
+
64
+ Interactive framework enabling transplant physicians to explore how different
65
+ patient, donor, and conditioning variables influence:
66
+
67
+ • Acute GVHD incidence
68
+ • Chronic GVHD risk
69
+ • Overall survival probability
70
+
71
+ Compare scenarios and identify combinations associated with lower predicted risk
72
+ to support evidence-informed transplant planning.
73
+
74
+ </div>
75
+ """, unsafe_allow_html=True)
76
+
77
+ # add GVHD tagline
78
+ st.markdown("""
79
+ <div style="text-align:center">
80
+ <h3>
81
+ A modular prediction framework for Acute & Chronic GVHD risk assessment.<br>
82
+ <i>Predict. Learn. Adapt.</i>
83
+ </h3>
84
+ </div>
85
+ """, unsafe_allow_html=True)
86
+
87
+
88
+ # --- Partners Section ---
89
+ st.divider()
90
+ st.subheader("Partners:")
91
+ st.markdown(
92
+ f"""
93
+ <div style="text-align:center">
94
+ <img src="data:image/png;base64,{logo_as_base64}" style="width:100%; max-width:1000px;">
95
+ </div>
96
+ """,
97
+ unsafe_allow_html=True
98
+ )
99
+
100
+
101
+ # --- Disclaimer Section ---
102
+ st.divider()
103
+ st.write(
104
+ """
105
+ **Disclaimer: Experimental research platform — not approved for clinical use.**\\
106
+ Modular AI-driven framework that centers can retrain with their own multi-center datasets to build and validate population-specific GVHD prediction models.\\
107
+ Model performance varies by training data and updates.
108
+ """)
109
+
110
+ st.markdown('</div>', unsafe_allow_html=True)
111
+ # --- End of MAIN CONTENT ---
112
+
113
+ # --- Footer ---
114
+ st.markdown(
115
+ """
116
+ <div class="footer">
117
+ <br>
118
+ <br>
119
+ ©2025 Department of Health – Abu Dhabi<br>
120
+ Partnership: SSMC (PureHealth) & MBZUAI<br>
121
+ Data Collaborators: SKMC, Tawam Hospital, KHCC (Jordan)
122
+ </div>
123
+ """,
124
+ unsafe_allow_html=True
125
  )