add some more dicom viewing capablities
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user