Refactor DICOM file reading to use dcmread for improved compatibility across models and helpers
This commit is contained in:
+2
-2
@@ -316,14 +316,14 @@ class SeriesImageBase(models.Model):
|
||||
|
||||
def get_dicom_json(self):
|
||||
try:
|
||||
json = pydicom.read_file(self.image).to_json()
|
||||
json = pydicom.dcmread(self.image).to_json()
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
return {}
|
||||
return json
|
||||
|
||||
def get_dicom_info(self):
|
||||
try:
|
||||
info = pretty_print_dicom(pydicom.read_file(self.image))
|
||||
info = pretty_print_dicom(pydicom.dcmread(self.image))
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
info = "File is not a dicom."
|
||||
return info
|
||||
|
||||
Reference in New Issue
Block a user