Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,22 +70,22 @@ if uploaded_zip_file is not None:
|
|
| 70 |
with zipfile.ZipFile(uploaded_zip_file, "r") as zip_ref:
|
| 71 |
zip_ref.extractall(temp_dir)
|
| 72 |
|
| 73 |
-
dicom_files = [os.path.join(temp_dir, f) for f in os.listdir(temp_dir) if f.endswith(".dcm")]
|
| 74 |
-
dicom_files.sort()
|
| 75 |
|
| 76 |
-
# Anonymize DICOM files
|
| 77 |
-
for file_path in dicom_files:
|
| 78 |
-
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
except Exception as e:
|
| 91 |
st.error(f"Error: {str(e)}")
|
|
|
|
| 70 |
with zipfile.ZipFile(uploaded_zip_file, "r") as zip_ref:
|
| 71 |
zip_ref.extractall(temp_dir)
|
| 72 |
|
| 73 |
+
# dicom_files = [os.path.join(temp_dir, f) for f in os.listdir(temp_dir) if f.endswith(".dcm")]
|
| 74 |
+
# dicom_files.sort()
|
| 75 |
|
| 76 |
+
# # Anonymize DICOM files
|
| 77 |
+
# for file_path in dicom_files:
|
| 78 |
+
# ds = pydicom.dcmread(file_path)
|
| 79 |
|
| 80 |
+
# # Anonymize personal information
|
| 81 |
+
# if 'PatientName' in ds:
|
| 82 |
+
# ds.PatientName = 'Anonymized'
|
| 83 |
+
# if 'PatientID' in ds:
|
| 84 |
+
# ds.PatientID = '00000000'
|
| 85 |
|
| 86 |
+
# print("Anonymized")
|
| 87 |
|
| 88 |
+
# ds.save_as(file_path)
|
| 89 |
|
| 90 |
except Exception as e:
|
| 91 |
st.error(f"Error: {str(e)}")
|