further improvements

This commit is contained in:
Ross
2023-08-14 14:30:01 +01:00
parent cc2cbde691
commit a4e66696bd
8 changed files with 139 additions and 49 deletions
+2 -1
View File
@@ -392,6 +392,7 @@ def extract_image_dicom_json_from_ds(ds, url, image_index):
else:
d[key] = val
# Is it worth trying on fake dicom tags?.....
if d == {}:
d["SOPInstanceUID"] = f"1.2.840.1111.{image_index}"
d["SeriesInstanceUID"] = f"1.2.840.1112.1"
@@ -402,7 +403,7 @@ def extract_image_dicom_json_from_ds(ds, url, image_index):
class SeriesImage(SeriesImageBase):
image = models.FileField(upload_to=image_directory_path)
series = models.ForeignKey(
"Series", related_name="images", on_delete=models.SET_NULL, null=True
"Series", related_name="images", on_delete=models.CASCADE, null=True
)
def get_dicom_data(self):