MingGatsby
commited on
Commit
•
a7241b7
1
Parent(s):
dcb3d5e
Update app.py
Browse files
app.py
CHANGED
@@ -172,10 +172,10 @@ MRI_WINDOW_CENTER = st.sidebar.number_input("MRI Window Center", min_value=WINDO
|
|
172 |
MRI_WINDOW_WIDTH = st.sidebar.number_input("MRI Window Width", min_value=WINDOW_WIDTH_MIN, max_value=WINDOW_WIDTH_MAX, value=DEFAULT_MRI_WINDOW_WIDTH, step=1)
|
173 |
|
174 |
uploaded_ct_file = st.file_uploader("Upload a candidate CT DICOM", type=["dcm"])
|
175 |
-
|
176 |
-
#
|
177 |
-
|
178 |
-
|
179 |
|
180 |
# # Apply evaluation transforms to the DICOM image for model prediction
|
181 |
# image_tensor = eval_transforms(temp_file.name).unsqueeze(0).to(device)
|
|
|
172 |
MRI_WINDOW_WIDTH = st.sidebar.number_input("MRI Window Width", min_value=WINDOW_WIDTH_MIN, max_value=WINDOW_WIDTH_MAX, value=DEFAULT_MRI_WINDOW_WIDTH, step=1)
|
173 |
|
174 |
uploaded_ct_file = st.file_uploader("Upload a candidate CT DICOM", type=["dcm"])
|
175 |
+
if uploaded_ct_file is not None:
|
176 |
+
# Save the uploaded file to a temporary location
|
177 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=".dcm") as temp_file:
|
178 |
+
temp_file.write(uploaded_ct_file.getvalue())
|
179 |
|
180 |
# # Apply evaluation transforms to the DICOM image for model prediction
|
181 |
# image_tensor = eval_transforms(temp_file.name).unsqueeze(0).to(device)
|