Skip to content

Commit

Permalink
Fix wrong UIDs in StoragePresentationContexts and remove uncommented …
Browse files Browse the repository at this point in the history
…UIDs
  • Loading branch information
mdebic committed Nov 9, 2024
1 parent 355f99e commit 65c09ad
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 119 deletions.
8 changes: 4 additions & 4 deletions adit/core/utils/dimse_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from ..types import DicomLogEntry
from ..utils.dicom_dataset import QueryDataset, ResultDataset
from ..utils.dicom_utils import has_wildcards, read_dataset
from ..utils.presentation_contexts import AditStoragePresentationContexts
from ..utils.presentation_contexts import StoragePresentationContexts

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -172,19 +172,19 @@ def _associate(self, service: DimseService):
+ UnifiedProcedurePresentationContexts
)
elif service == "C-GET":
# The maximum requested contexts is 128. AditStoragePresentationContexts currently
# The maximum requested contexts is 128. StoragePresentationContexts currently
# contains 120 storage contexts. So even with the query/retrieve contexts added we
# should have no problem.
ae.add_requested_context(PatientRootQueryRetrieveInformationModelGet)
ae.add_requested_context(StudyRootQueryRetrieveInformationModelGet)
for cx in AditStoragePresentationContexts:
for cx in StoragePresentationContexts:
assert cx.abstract_syntax is not None
ae.add_requested_context(cx.abstract_syntax)
ext_neg.append(build_role(cx.abstract_syntax, scp_role=True))
elif service == "C-MOVE":
ae.requested_contexts = QueryRetrievePresentationContexts
elif service == "C-STORE":
ae.requested_contexts = AditStoragePresentationContexts
ae.requested_contexts = StoragePresentationContexts
else:
raise DicomError(f"Invalid DIMSE service: {service}")

Expand Down
140 changes: 25 additions & 115 deletions adit/core/utils/presentation_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
_storage = [
"1.2.840.10008.5.1.4.1.1.9.1.3", # AmbulatoryECGWaveformStorage
"1.2.840.10008.5.1.4.1.1.9.5.1", # ArterialPulseWaveformStorage
"1.2.840.10008.5.1.4.1.1.78.4", # AutorefractionMeasurementsStorage
"1.2.840.10008.5.1.4.1.1.78.2", # AutorefractionMeasurementsStorage
"1.2.840.10008.5.1.4.1.1.131", # BasicStructuredDisplayStorage
"1.2.840.10008.5.1.4.1.1.88.11", # BasicTextSRStorage
"1.2.840.10008.5.1.4.1.1.9.4.1", # BasicVoiceAudioWaveformStorage
Expand Down Expand Up @@ -41,11 +41,11 @@
"1.2.840.10008.5.1.4.1.1.9.1.2", # GeneralECGWaveformStorage
"1.2.840.10008.5.1.4.1.1.11.1", # GrayscaleSoftcopyPresentationStateStorage
"1.2.840.10008.5.1.4.1.1.9.2.1", # HemodynamicWaveformStorage
"1.2.840.10008.5.1.4.1.1.88.68", # ImplantationPlanSRStorage
"1.2.840.10008.5.1.4.1.1.88.70", # ImplantationPlanSRStorage
"1.2.840.10008.5.1.4.1.1.78.8", # IntraocularLensCalculationsStorage
"1.2.840.10008.5.1.4.1.1.14.1", # IntravascularOpticalCoherenceTomographyImageStorageForPresentation # noqa
"1.2.840.10008.5.1.4.1.1.14.2", # IntravascularOpticalCoherenceTomographyImageStorageForProcessing # noqa
"1.2.840.10008.5.1.4.1.1.78.2", # KeratometryMeasurementsStorage
"1.2.840.10008.5.1.4.1.1.14.1", # IntravascularOpticalCoherenceTomographyImageStorageForPresentation # noqa: E501
"1.2.840.10008.5.1.4.1.1.14.2", # IntravascularOpticalCoherenceTomographyImageStorageForProcessing # noqa: E501
"1.2.840.10008.5.1.4.1.1.78.3", # KeratometryMeasurementsStorage
"1.2.840.10008.5.1.4.1.1.88.59", # KeyObjectSelectionDocumentStorage
"1.2.840.10008.5.1.4.1.1.2.2", # LegacyConvertedEnhancedCTImageStorage
"1.2.840.10008.5.1.4.1.1.4.4", # LegacyConvertedEnhancedMRImageStorage
Expand Down Expand Up @@ -88,7 +88,7 @@
"1.2.840.10008.5.1.4.1.1.66.1", # SpatialRegistrationStorage
"1.2.840.10008.5.1.4.1.1.78.6", # SpectaclePrescriptionReportStorage
"1.2.840.10008.5.1.4.1.1.77.1.5.3", # StereometricRelationshipStorage
"1.2.840.10008.5.1.4.1.1.78.3", # SubjectiveRefractionMeasurementsStorage
"1.2.840.10008.5.1.4.1.1.78.4", # SubjectiveRefractionMeasurementsStorage
"1.2.840.10008.5.1.4.1.1.68.1", # SurfaceScanMeshStorage
"1.2.840.10008.5.1.4.1.1.68.2", # SurfaceScanPointCloudStorage
"1.2.840.10008.5.1.4.1.1.66.5", # SurfaceSegmentationStorage
Expand All @@ -102,121 +102,31 @@
"1.2.840.10008.5.1.4.1.1.77.1.1", # VLEndoscopicImageStorage
"1.2.840.10008.5.1.4.1.1.77.1.2", # VLMicroscopicImageStorage
"1.2.840.10008.5.1.4.1.1.77.1.4", # VLPhotographicImageStorage
"1.2.840.10008.5.1.4.1.1.77.1.5.1", # VLSlideCoordinatesMicroscopicImageStorage
"1.2.840.10008.5.1.4.1.1.77.1.3", # VLSlideCoordinatesMicroscopicImageStorage
"1.2.840.10008.5.1.4.1.1.77.1.6", # VLWholeSlideMicroscopyImageStorage
"1.2.840.10008.5.1.4.1.1.11.5", # XAXRFGrayscaleSoftcopyPresentationStateStorage
"1.2.840.10008.5.1.4.1.1.13.1.1", # XRay3DAngiographicImageStorage
"1.2.840.10008.5.1.4.1.1.13.1.2", # XRay3DCraniofacialImageStorage
"1.2.840.10008.5.1.4.1.1.12.1", # XRayAngiographicImageStorage
"1.2.840.10008.5.1.4.1.1.88.67", # XRayRadiationDoseSRStorage
"1.2.840.10008.5.1.4.1.1.12.2", # XRayRadiofluoroscopicImageStorage
## recently approved
# "1.2.840.10008.5.1.4.1.1.88.74", # AcquisitionContextSRStorage
# "1.2.840.10008.5.1.4.1.1.11.8", # AdvancedBlendingPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.9.8.1", # BodyPositionWaveformStorage
# "1.2.840.10008.5.1.4.1.1.1.2.2", # BreastProjectionXRayImageStorageForPresentation
# "1.2.840.10008.5.1.4.1.1.1.2.3", # BreastProjectionXRayImageStorageForProcessing
# "1.2.840.10008.5.1.4.1.1.481.22", # CArmPhotonElectronRadiationRecordStorage
# "1.2.840.10008.5.1.4.1.1.481.21", # CArmPhotonElectronRadiationStorage
# "1.2.840.10008.5.1.4.1.1.11.7", # CompositingPlanarMPRVolumetricPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.77.1.8", # ConfocalMicroscopyImageStorage
# "1.2.840.10008.5.1.4.1.1.77.1.9", # ConfocalMicroscopyTiledPyramidalImageStorage
# "1.2.840.10008.5.1.4.1.1.88.73", # ContentAssessmentResultsStorage
# "1.2.840.10008.5.1.4.1.1.82.1", # CornealTopographyMapStorage
# "1.2.840.10008.5.1.4.1.1.200.2", # CTPerformedProcedureProtocolStorage
# "1.2.840.10008.5.1.4.1.1.77.1.7", # DermoscopicPhotographyImageStorage
# "1.2.840.10008.5.1.4.1.1.9.7.2", # ElectromyogramWaveformStorage
# "1.2.840.10008.5.1.4.1.1.9.7.3", # ElectrooculogramWaveformStorage
# "1.2.840.10008.5.1.4.1.1.104.5", # EncapsulatedMTLStorage
# "1.2.840.10008.5.1.4.1.1.104.4", # EncapsulatedOBJStorage
# "1.2.840.10008.5.1.4.1.1.104.3", # EncapsulatedSTLStorage
# "1.2.840.10008.5.1.4.1.1.481.16", # EnhancedContinuousRTImageStorage
# "1.2.840.10008.5.1.4.1.1.481.15", # EnhancedRTImageStorage
# "1.2.840.10008.5.1.4.1.1.88.76", # EnhancedXRayRadiationDoseSRStorage
# "1.2.840.10008.5.1.4.1.1.88.35", # ExtensibleSRStorage
# "1.2.840.10008.5.1.4.1.1.9.1.4", # General32BitECGWaveformStorage
# "1.2.840.10008.5.1.4.1.1.11.6", # GrayscalePlanarMPRVolumetricPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.77.1.10", # MicroscopyBulkSimpleAnnotationsStorage
# "1.2.840.10008.5.1.4.1.1.9.6.2", # MultichannelRespiratoryWaveformStorage
# "1.2.840.10008.5.1.4.1.1.11.11", # MultipleVolumeRenderingVolumetricPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.77.1.5.8", # OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage # noqa
# "1.2.840.10008.5.1.4.1.1.77.1.5.7", # OphthalmicOpticalCoherenceTomographyEnFaceImageStorage
# "1.2.840.10008.5.1.4.1.1.30", # ParametricMapStorage
# "1.2.840.10008.5.1.4.1.1.88.72", # PatientRadiationDoseSRStorage
# "1.2.840.10008.5.1.4.1.1.88.75", # PerformedImagingAgentAdministrationSRStorage
# "1.2.840.10008.5.1.4.1.1.6.3", # PhotoacousticImageStorage
# "1.2.840.10008.5.1.4.1.1.88.77", # PlannedImagingAgentAdministrationSRStorage
# "1.2.840.10008.5.1.4.1.1.88.71", # RadiopharmaceuticalRadiationDoseSRStorage
# "1.2.840.10008.5.1.4.1.1.481.25", # RoboticArmRadiationStorage
# "1.2.840.10008.5.1.4.1.1.481.26", # RoboticRadiationRecordStorage
# "1.2.840.10008.5.1.4.1.1.9.7.1", # RoutineScalpElectroencephalogramWaveformStorage
# "1.2.840.10008.5.1.4.34.10", # RTBrachyApplicationSetupDeliveryInstructionStorage
# "1.2.840.10008.5.1.4.34.9", # RTPatientPositionAcquisitionInstructionStorage
# "1.2.840.10008.5.1.4.1.1.481.10", # RTPhysicianIntentStorage
# "1.2.840.10008.5.1.4.1.1.481.14", # RTRadiationRecordSetStorage
# "1.2.840.10008.5.1.4.1.1.481.13", # RTRadiationSalvageRecordStorage
# "1.2.840.10008.5.1.4.34.8", # RTRadiationSetDeliveryInstructionStorage
# "1.2.840.10008.5.1.4.1.1.481.12", # RTRadiationSetStorage
# "1.2.840.10008.5.1.4.1.1.481.11", # RTSegmentAnnotationStorage
# "1.2.840.10008.5.1.4.1.1.481.17", # RTTreatmentPreparationStorage
# "1.2.840.10008.5.1.4.1.1.11.10", # SegmentedVolumeRenderingVolumetricPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.88.78", # SimplifiedAdultEchoSRStorage
# "1.2.840.10008.5.1.4.1.1.9.7.4", # SleepElectroencephalogramWaveformStorage
# "1.2.840.10008.5.1.4.1.1.481.24", # TomotherapeuticRadiationRecordStorage
# "1.2.840.10008.5.1.4.1.1.481.23", # TomotherapeuticRadiationStorage
# "1.2.840.10008.5.1.4.1.1.66.6", # TractographyResultsStorage
# "1.2.840.10008.5.1.4.1.1.11.12", # VariableModalityLUTSoftcopyPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.11.9", # VolumeRenderingVolumetricPresentationStateStorage
# "1.2.840.10008.5.1.4.1.1.88.70", # WaveformAnnotationSRStorage
# "1.2.840.10008.5.1.4.1.1.77.1.5.5", # WideFieldOphthalmicPhotographyStereographicProjectionImageStorage # noqa
# "1.2.840.10008.5.1.4.1.1.77.1.5.6", # WideFieldOphthalmicPhotography3DCoordinatesImageStorage
# "1.2.840.10008.5.1.4.1.1.200.8" # XAPerformedProcedureProtocolStorage
## non-patient
# "1.2.840.10008.5.1.4.39.2", # ColorPaletteStorage
# "1.2.840.10008.5.1.4.1.1.200.1", # CTDefinedProcedureProtocolStorage
# "1.2.840.10008.5.1.4.43.1", # GenericImplantTemplateStorage
# "1.2.840.10008.5.1.4.38.1", # HangingProtocolStorage
# "1.2.840.10008.5.1.4.44.1", # ImplantAssemblyTemplateStorage
# "1.2.840.10008.5.1.4.45.1", # ImplantTemplateGroupStorage
# "1.2.840.10008.5.1.4.1.1.201.1", # InventoryStorage
# "1.2.840.10008.5.1.4.1.1.200.3", # ProtocolApprovalStorage
# "1.2.840.10008.5.1.4.1.1.200.7", # XADefinedProcedureProtocolStorage
## retired
"1.2.840.10008.5.1.4.1.1.30", # RETIRED_HardcopyColorImageStorage
"1.2.840.10008.5.1.4.1.1.29", # RETIRED_HardcopyGrayscaleImageStorage
"1.2.840.10008.5.1.4.1.1.5", # RETIRED_NuclearMedicineImageStorage
"1.2.840.10008.5.1.4.1.1.9", # RETIRED_StandaloneCurveStorage
"1.2.840.10008.5.1.4.1.1.10", # RETIRED_StandaloneModalityLUTStorage
"1.2.840.10008.5.1.4.1.1.8", # RETIRED_StandaloneOverlayStorage
"1.2.840.10008.5.1.4.1.1.129", # RETIRED_StandalonePETCurveStorage
"1.2.840.10008.5.1.4.1.1.11", # RETIRED_StandaloneVOILUTStorage
"1.2.840.10008.5.1.4.1.1.27", # RETIRED_StoredPrintStorage
"1.2.840.10008.5.1.4.1.1.6", # RETIRED_UltrasoundImageStorage
"1.2.840.10008.5.1.4.1.1.3", # RETIRED_UltrasoundMultiframeImageStorage
"1.2.840.10008.5.1.4.1.1.77.1", # RETIRED_VLImageStorage
"1.2.840.10008.5.1.4.1.1.77.2", # RETIRED_VLMultiframeImageStorage
"1.2.840.10008.5.1.4.1.1.12.3", # RETIRED_XRayAngiographicBiPlaneImageStorage
## draft
# "1.2.840.10008.5.1.4.34.7", # DRAFT_RTBeamsDeliveryInstructionStorage
# "1.2.840.10008.5.1.4.1.1.88.2", # DRAFT_SRAudioStorage
# "1.2.840.10008.5.1.4.1.1.88.3", # DRAFT_SRComprehensiveStorage
# "1.2.840.10008.5.1.4.1.1.88.4", # DRAFT_SRDetailStorage
# "1.2.840.10008.5.1.4.1.1.88.5", # DRAFT_SRTextStorage
# "1.2.840.10008.5.1.4.1.1.9.1", # DRAFT_WaveformStorage
## DICOS
# "1.2.840.10008.5.1.4.1.1.501.1", # DICOS_CTImageStorage
# "1.2.840.10008.5.1.4.1.1.501.2.1", # DICOS_DigitalXRayImageStorageForPresentation
# "1.2.840.10008.5.1.4.1.1.501.2.2", # DICOS_DigitalXRayImageStorageForProcessing
# "1.2.840.10008.5.1.4.1.1.501.3", # DICOS_ThreatDetectionReportStorage
# "1.2.840.10008.5.1.4.1.1.501.4", # DICOS_2DAITStorage
# "1.2.840.10008.5.1.4.1.1.501.5", # DICOS_3DAITStorage
# "1.2.840.10008.5.1.4.1.1.501.6", # DICOS_QuadrupoleResonanceStorage
## DICONDE
# "1.2.840.10008.5.1.4.1.1.601.1", # DICONDE_EddyCurrentImageStorage
# "1.2.840.10008.5.1.4.1.1.601.2", # DICONDE_EddyCurrentMultiframeImageStorage
## retired but still in use
"1.2.840.10008.5.1.1.30", # HardcopyColorImageStorage
"1.2.840.10008.5.1.1.29", # HardcopyGrayscaleImageStorage
"1.2.840.10008.5.1.4.1.1.5", # NuclearMedicineImageStorageRetired
"1.2.840.10008.5.1.4.1.1.9", # StandaloneCurveStorage
"1.2.840.10008.5.1.4.1.1.10", # StandaloneModalityLUTStorage
"1.2.840.10008.5.1.4.1.1.8", # StandaloneOverlayStorage
"1.2.840.10008.5.1.4.1.1.129", # StandalonePETCurveStorage
"1.2.840.10008.5.1.4.1.1.11", # StandaloneVOILUTStorage
"1.2.840.10008.5.1.1.27", # StoredPrintStorage
"1.2.840.10008.5.1.4.1.1.6", # UltrasoundImageStorageRetired
"1.2.840.10008.5.1.4.1.1.3", # UltrasoundMultiframeImageStorageRetired
"1.2.840.10008.5.1.4.1.1.77.1", # VLImageStorage
"1.2.840.10008.5.1.4.1.1.77.2", # VLMultiframeImageStorage
"1.2.840.10008.5.1.4.1.1.12.3", # XRayAngiographicBiPlaneImageStorage
]
assert len(_storage) <= 120

assert len(_storage) <= 128

AditStoragePresentationContexts = [build_context(uid) for uid in sorted(_storage)]
"""Pre-built presentation contexts for :dcm:`Storage<part04/chapter_B.html>` matching the DCMTK Implementation.""" # noqa
StoragePresentationContexts = [build_context(uid) for uid in sorted(_storage)]
"""Pre-built presentation contexts for :dcm:`Storage<part04/chapter_B.html>` containing 120 selected SOP Classes.""" # noqa: E501

0 comments on commit 65c09ad

Please sign in to comment.