add some more dicom viewing capablities

This commit is contained in:
Ross
2023-10-30 11:59:44 +00:00
parent fe536e25a7
commit d87874d0b1
7 changed files with 29 additions and 3 deletions
+7
View File
@@ -195,6 +195,13 @@ class SeriesImageBase(models.Model):
ordering = ["position"]
abstract = True
def get_dicom_json(self):
try:
json = pydicom.read_file(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))