Spaces:
Sleeping
Sleeping
Anirudh Balaraman commited on
Commit ·
ac3ffae
1
Parent(s): efc95db
update app.py
Browse files
app.py
CHANGED
|
@@ -257,6 +257,7 @@ t2_file = None
|
|
| 257 |
adc_file = None
|
| 258 |
dwi_file = None
|
| 259 |
is_demo_mode = data_source != "Upload My Own Files"
|
|
|
|
| 260 |
if is_demo_mode:
|
| 261 |
# --- DEMO MODE LOGIC ---
|
| 262 |
selected_sample = SAMPLE_CASES[data_source]
|
|
@@ -280,6 +281,7 @@ if is_demo_mode:
|
|
| 280 |
c1.success(f"T2: {f_names['t2']}")
|
| 281 |
c2.success(f"ADC: {f_names['adc']}")
|
| 282 |
c3.success(f"DWI: {f_names['dwi']}")
|
|
|
|
| 283 |
|
| 284 |
else:
|
| 285 |
# --- UPLOAD MODE LOGIC ---
|
|
@@ -295,6 +297,22 @@ else:
|
|
| 295 |
adc_file = st.file_uploader("Upload ADC (NRRD)", type=["nrrd"])
|
| 296 |
with col3:
|
| 297 |
dwi_file = st.file_uploader("Upload DWI (NRRD)", type=["nrrd"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
|
| 299 |
# --- 2. EXECUTION LOGIC ---
|
| 300 |
if "inference_done" not in st.session_state:
|
|
@@ -572,7 +590,7 @@ if st.session_state.inference_done:
|
|
| 572 |
if "coords" in st.session_state:
|
| 573 |
detected_boxes = []
|
| 574 |
for i in st.session_state.coords:
|
| 575 |
-
indi_box = [i[1], i[0], i[2],
|
| 576 |
detected_boxes.append(indi_box)
|
| 577 |
|
| 578 |
scan_dict = {}
|
|
|
|
| 257 |
adc_file = None
|
| 258 |
dwi_file = None
|
| 259 |
is_demo_mode = data_source != "Upload My Own Files"
|
| 260 |
+
psa_value = None
|
| 261 |
if is_demo_mode:
|
| 262 |
# --- DEMO MODE LOGIC ---
|
| 263 |
selected_sample = SAMPLE_CASES[data_source]
|
|
|
|
| 281 |
c1.success(f"T2: {f_names['t2']}")
|
| 282 |
c2.success(f"ADC: {f_names['adc']}")
|
| 283 |
c3.success(f"DWI: {f_names['dwi']}")
|
| 284 |
+
psa_value = 5.0
|
| 285 |
|
| 286 |
else:
|
| 287 |
# --- UPLOAD MODE LOGIC ---
|
|
|
|
| 297 |
adc_file = st.file_uploader("Upload ADC (NRRD)", type=["nrrd"])
|
| 298 |
with col3:
|
| 299 |
dwi_file = st.file_uploader("Upload DWI (NRRD)", type=["nrrd"])
|
| 300 |
+
|
| 301 |
+
st.divider()
|
| 302 |
+
|
| 303 |
+
st.markdown("### Patient Clinical Data")
|
| 304 |
+
|
| 305 |
+
# We use a smaller column so the input box doesn't stretch across the whole screen
|
| 306 |
+
col_psa, _ = st.columns([1, 2])
|
| 307 |
+
with col_psa:
|
| 308 |
+
psa_value = st.number_input(
|
| 309 |
+
"PSA Value (ng/mL)",
|
| 310 |
+
min_value=0.0,
|
| 311 |
+
max_value=500.0,
|
| 312 |
+
value=5.0,
|
| 313 |
+
step=0.1,
|
| 314 |
+
help="Enter the patient's Prostate-Specific Antigen level."
|
| 315 |
+
)
|
| 316 |
|
| 317 |
# --- 2. EXECUTION LOGIC ---
|
| 318 |
if "inference_done" not in st.session_state:
|
|
|
|
| 590 |
if "coords" in st.session_state:
|
| 591 |
detected_boxes = []
|
| 592 |
for i in st.session_state.coords:
|
| 593 |
+
indi_box = [i[1], i[0], i[2], 48, 48, 3]
|
| 594 |
detected_boxes.append(indi_box)
|
| 595 |
|
| 596 |
scan_dict = {}
|