Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions monai/deploy/operators/dicom_seg_writer_operator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2025 MONAI Consortium
# Copyright 2021-2026 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -382,7 +382,7 @@ def create_dicom_seg(self, image: np.ndarray, dicom_series: DICOMSeries, output_
seg_purpose_of_reference_code = Dataset()
seg_purpose_of_reference_code.CodeValue = "Newcode1"
seg_purpose_of_reference_code.CodingSchemeDesignator = "99IHE"
seg_purpose_of_reference_code.CodeMeaning = '"Processing Algorithm'
seg_purpose_of_reference_code.CodeMeaning = "Processing Algorithm"
seq_purpose_of_reference_code.append(seg_purpose_of_reference_code)

seq_contributing_equipment = PyDicomSequence()
Expand Down
7 changes: 6 additions & 1 deletion monai/deploy/operators/dicom_text_sr_writer_operator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022 MONAI Consortium
# Copyright 2021-2026 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -96,6 +96,7 @@ def __init__(
# "SR" for Structured Report.
# Media Storage SOP Class UID, e.g.,
# "1.2.840.10008.5.1.4.1.1.88.11" for Basic Text SR Storage
# "1.2.840.10008.5.1.4.1.1.88.22" for Enhanced SR
# "1.2.840.10008.5.1.4.1.1.104.1" for Encapsulated PDF Storage,
# "1.2.840.10008.5.1.4.1.1.88.34" for Comprehensive 3D SR IOD
# "1.2.840.10008.5.1.4.1.1.66.4" for Segmentation Storage
Expand Down Expand Up @@ -192,8 +193,12 @@ def write(self, content_text, dicom_series: Optional[DICOMSeries], output_dir: P
)

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

ds.ReferencedPerformedProcedureStepSequence = Sequence([]) # Required by SR Document Series
ds.PerformedProcedureCodeSequence = Sequence([]) # Required by SR Document General

# Per recommendation of IHE Radiology Technical Framework Supplement
# AI Results (AIR) Rev1.1 - Trial Implementation
# Specifically for Qualitative Findings,
Expand Down
8 changes: 4 additions & 4 deletions monai/deploy/operators/dicom_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MONAI Consortium
# Copyright 2022-2026 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -198,8 +198,8 @@ def write_common_modules(

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

file_meta.MediaStorageSOPClassUID = sop_class_uid
file_meta.MediaStorageSOPInstanceUID = my_sop_instance_uid
Expand Down Expand Up @@ -282,7 +282,7 @@ def write_common_modules(
ds_purpose_of_reference_code = Dataset()
ds_purpose_of_reference_code.CodeValue = "Newcode1"
ds_purpose_of_reference_code.CodingSchemeDesignator = "99IHE"
ds_purpose_of_reference_code.CodeMeaning = '"Processing Algorithm'
ds_purpose_of_reference_code.CodeMeaning = "Processing Algorithm"
seq_purpose_of_reference_code.append(ds_purpose_of_reference_code)

seq_contributing_equipment = Sequence()
Expand Down
2 changes: 1 addition & 1 deletion requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Requirements for minimal tests
-r requirements.txt
setuptools>=59.5.0
setuptools>=59.5.0,<81.0.0 # pkg_resources deprecation
coverage>=5.5
parameterized
24 changes: 8 additions & 16 deletions tests/fixtures/runner_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def sample_map_name():

@pytest.fixture(scope="session")
def faux_app_manifest():
app_manifest = json.loads(
"""{
app_manifest = json.loads("""{
"command": "/usr/bin/python3 -u /opt/monai/app/main.py",
"input": {
"path": "input",
Expand All @@ -63,15 +62,13 @@ def faux_app_manifest():
},
"timeout": 600,
"working-directory": "/var/monai"
}"""
)
}""")
yield app_manifest


@pytest.fixture(scope="session")
def faux_pkg_manifest_with_gpu():
pkg_manifest = json.loads(
"""{
pkg_manifest = json.loads("""{
"sdk-version": "0.0.0",
"models": [
{
Expand All @@ -85,15 +82,13 @@ def faux_pkg_manifest_with_gpu():
"memory": "4Gi"
}
}
"""
)
""")
yield pkg_manifest


@pytest.fixture(scope="session")
def faux_pkg_manifest():
pkg_manifest = json.loads(
"""{
pkg_manifest = json.loads("""{
"sdk-version": "0.0.0",
"models": [
{
Expand All @@ -106,16 +101,14 @@ def faux_pkg_manifest():
"memory": "4Gi"
}
}
"""
)
""")
yield pkg_manifest


@pytest.fixture(scope="session")
def faux_app_manifest_with_absolute_path():
"""App manifest with absolute input and output paths"""
app_manifest = json.loads(
"""{
app_manifest = json.loads("""{
"command": "/usr/bin/python3 -u /opt/monai/app/main.py",
"input": {
"path": "/input",
Expand All @@ -141,8 +134,7 @@ def faux_app_manifest_with_absolute_path():
},
"timeout": 600,
"working-directory": "/var/monai"
}"""
)
}""")
yield app_manifest


Expand Down
6 changes: 2 additions & 4 deletions tools/pipeline-generator/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,11 @@ def test_list_command_with_config(self):
with self.runner.isolated_filesystem():
# Create a test config file
with open("test_config.yaml", "w") as f:
f.write(
"""
f.write("""
endpoints:
- organization: "TestOrg"
description: "Test organization"
"""
)
""")

# Run command with config file
with patch("pipeline_generator.cli.main.HuggingFaceClient") as mock_client_class:
Expand Down