Skip to content

DICOM Seg Writer Op Tag Writing Updates #533

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

bluna301
Copy link
Contributor

@bluna301 bluna301 commented Apr 7, 2025

From Contributing Equipment Sequence for DICOM SEG Writer discussion. DICOMSegmentationWriterOperator updates to align with the other DICOM writer operators and the IHE Radiology AI Results criteria.

This initial commit adds model_info as an optional parameter to the DICOMSegmentationWriterOperator, allowing for the ContributingEquipmentSequence nesting in the DICOM SEG output:

# model info is algorithm information
my_model_info = ModelInfo(
    creator="CCHMC CAIIR", # institution name
    name=_algorithm_name, # algorithm name
    version=_algorithm_version, # algorithm version
    uid="0.0.1", # MAP version
)

image

@MMelQin, a few thoughts for you after this initial commit:

  • Should we provide any checks to ensure that the algorithm name and version information that would be present in both the segment_descriptions and model_info arguments are equivalent? As currently implemented, users can input different values for each field
  • Thoughts on enforcing model_info as a required or optional argument? I believe this is required for other DICOM writers
  • I didn't add an equipment_info argument to Seg Writer as 3/4 of the tag values are currently hard coded into the operator (see below). If you think these tags should always contain the MONAI Deploy App SDK information, we can leave this how it is; if you think these tags should be dynamic based on user input, I can add equipment_info as an optional argument to the Seg Writer and pass these values accordingly
seg = hd.seg.Segmentation(
    source_images=dicom_dataset_list,
    pixel_array=image,
    segmentation_type=hd.seg.SegmentationTypeValues.BINARY,
    segment_descriptions=self._seg_descs,
    series_instance_uid=hd.UID(),
    series_number=random_with_n_digits(4),
    sop_instance_uid=seg_sop_instance_uid,
    instance_number=1,
    manufacturer="The MONAI Consortium", # hard coded
    manufacturer_model_name="MONAI Deploy App SDK", # hard coded
    software_versions=version_str, # hard coded to MONAI Deploy App SDK version
    device_serial_number="0000",
    omit_empty_frames=self._omit_empty_frames,
)

Signed-off-by: bluna301 <luna.bryanr@gmail.com>
@bluna301 bluna301 self-assigned this Apr 7, 2025
Copy link

sonarqubecloud bot commented Apr 7, 2025

@MMelQin MMelQin self-requested a review April 21, 2025 18:02
Copy link
Collaborator

@MMelQin MMelQin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for making the AI Results in the generated DICOM instances consistent.
I think it is OK to leave the Equipment info as is. The the existing implementation already tries to parse out the App SDK version, so the software that generates the DICOM instance is correct. More important is the AI model info encapsulated in the contributing equipment, which is added by this PR.

@MMelQin MMelQin merged commit 7e0a610 into Project-MONAI:main Apr 21, 2025
4 checks passed
MMelQin pushed a commit that referenced this pull request Apr 22, 2025
Signed-off-by: bluna301 <luna.bryanr@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants