AdritRao commited on
Commit
3528cd0
·
verified ·
1 Parent(s): 50f84d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
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
- 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)}")
 
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)}")