Skip to content

Commit 51063df

Browse files
committed
added required DICOM SR tags; fixed FileMetaInfo; Processing Algorithm typo fix
Signed-off-by: bluna301 <luna.bryanr@gmail.com>
1 parent 5f8f31c commit 51063df

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

monai/deploy/operators/dicom_seg_writer_operator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2025 MONAI Consortium
1+
# Copyright 2021-2026 MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -382,7 +382,7 @@ def create_dicom_seg(self, image: np.ndarray, dicom_series: DICOMSeries, output_
382382
seg_purpose_of_reference_code = Dataset()
383383
seg_purpose_of_reference_code.CodeValue = "Newcode1"
384384
seg_purpose_of_reference_code.CodingSchemeDesignator = "99IHE"
385-
seg_purpose_of_reference_code.CodeMeaning = '"Processing Algorithm'
385+
seg_purpose_of_reference_code.CodeMeaning = "Processing Algorithm"
386386
seq_purpose_of_reference_code.append(seg_purpose_of_reference_code)
387387

388388
seq_contributing_equipment = PyDicomSequence()

monai/deploy/operators/dicom_text_sr_writer_operator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2022 MONAI Consortium
1+
# Copyright 2021-2026 MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -96,6 +96,7 @@ def __init__(
9696
# "SR" for Structured Report.
9797
# Media Storage SOP Class UID, e.g.,
9898
# "1.2.840.10008.5.1.4.1.1.88.11" for Basic Text SR Storage
99+
# "1.2.840.10008.5.1.4.1.1.88.22" for Enhanced SR
99100
# "1.2.840.10008.5.1.4.1.1.104.1" for Encapsulated PDF Storage,
100101
# "1.2.840.10008.5.1.4.1.1.88.34" for Comprehensive 3D SR IOD
101102
# "1.2.840.10008.5.1.4.1.1.66.4" for Segmentation Storage
@@ -192,8 +193,12 @@ def write(self, content_text, dicom_series: Optional[DICOMSeries], output_dir: P
192193
)
193194

194195
# SR specific
196+
ds.CompletionFlag = "COMPLETE" # Estimated degree of completeness.
195197
ds.VerificationFlag = "UNVERIFIED" # Not attested by a legally accountable person.
196198

199+
ds.ReferencedPerformedProcedureStepSequence = Sequence([]) # Required by SR Document Series
200+
ds.PerformedProcedureCodeSequence = Sequence([]) # Required by SR Document General
201+
197202
# Per recommendation of IHE Radiology Technical Framework Supplement
198203
# AI Results (AIR) Rev1.1 - Trial Implementation
199204
# Specifically for Qualitative Findings,

monai/deploy/operators/dicom_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 MONAI Consortium
1+
# Copyright 2022-2026 MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -198,8 +198,8 @@ def write_common_modules(
198198

199199
# File meta info data set
200200
file_meta = Dataset()
201-
file_meta.FileMetaInformationGroupLength = 198
202-
file_meta.FileMetaInformationVersion = bytes("01", "utf-8") # '\x00\x01'
201+
# file_meta.FileMetaInformationGroupLength = 198
202+
file_meta.FileMetaInformationVersion = b"\x00\x01" # '\x00\x01'
203203

204204
file_meta.MediaStorageSOPClassUID = sop_class_uid
205205
file_meta.MediaStorageSOPInstanceUID = my_sop_instance_uid
@@ -282,7 +282,7 @@ def write_common_modules(
282282
ds_purpose_of_reference_code = Dataset()
283283
ds_purpose_of_reference_code.CodeValue = "Newcode1"
284284
ds_purpose_of_reference_code.CodingSchemeDesignator = "99IHE"
285-
ds_purpose_of_reference_code.CodeMeaning = '"Processing Algorithm'
285+
ds_purpose_of_reference_code.CodeMeaning = "Processing Algorithm"
286286
seq_purpose_of_reference_code.append(ds_purpose_of_reference_code)
287287

288288
seq_contributing_equipment = Sequence()

0 commit comments

Comments
 (0)