Skip to content

Commit ca544e8

Browse files
authored
Add missed change (#374)
Signed-off-by: M Q <[email protected]> Signed-off-by: M Q <[email protected]>
1 parent 0b0c478 commit ca544e8

File tree

2 files changed

+43
-1134
lines changed

2 files changed

+43
-1134
lines changed

monai/deploy/operators/dicom_seg_writer_operator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,10 @@ def create_dicom_seg(self, image: np.ndarray, dicom_series: DICOMSeries, output_
305305
for k, v in self._custom_tags.items():
306306
if isinstance(k, str) and isinstance(v, str):
307307
try:
308-
seg[k].value = v
308+
if k in seg:
309+
seg.data_element(k).value = v
310+
else:
311+
seg.update({k: v})
309312
except Exception as ex:
310313
# Best effort for now.
311314
logging.warning(f"Tag {k} was not written, due to {ex}")

0 commit comments

Comments
 (0)