Mercurial > hg > orthanc
changeset 1073:01414536c930
complete DICOM conformance
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Jul 2014 10:24:09 +0200 |
parents | 1dffa9f44a94 |
children | 3f3671f7bfe3 |
files | CMakeLists.txt NEWS OrthancServer/Internals/CommandDispatcher.cpp OrthancServer/OrthancRestApi/OrthancRestSystem.cpp Resources/DicomConformanceStatement.py Resources/DicomConformanceStatement.txt |
diffstat | 6 files changed, 408 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Mon Jul 28 13:31:35 2014 +0200 +++ b/CMakeLists.txt Tue Jul 29 10:24:09 2014 +0200 @@ -262,6 +262,7 @@ PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/PrepareDatabase.sql UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade3To4.sql CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json + DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua )
--- a/NEWS Mon Jul 28 13:31:35 2014 +0200 +++ b/NEWS Tue Jul 29 10:24:09 2014 +0200 @@ -8,6 +8,7 @@ * Access patient module at the study level to cope with PatientID collisions * On-the-fly conversion of JSON to XML according to the HTTP Accept header * C-Echo SCU in the REST API +* DICOM conformance statement available at URI "/tools/dicom-conformance" Lua scripts -----------
--- a/OrthancServer/Internals/CommandDispatcher.cpp Mon Jul 28 13:31:35 2014 +0200 +++ b/OrthancServer/Internals/CommandDispatcher.cpp Tue Jul 29 10:24:09 2014 +0200 @@ -234,10 +234,156 @@ #endif + namespace Orthanc { namespace Internals { + /** + * EXTRACT OF FILE "dcmdata/libsrc/dcuid.cc" FROM DCMTK 3.6.0 + * (dcmAllStorageSOPClassUIDs). + * + * an array of const strings containing all known Storage SOP + * Classes that fit into the conventional + * PATIENT-STUDY-SERIES-INSTANCE information model, + * i.e. everything a Storage SCP might want to store in a PACS. + * Special cases such as hanging protocol storage or the Storage + * SOP Class are not included in this list. + * + * THIS LIST CONTAINS ALL STORAGE SOP CLASSES INCLUDING RETIRED + * ONES AND IS LARGER THAN 64 ENTRIES. + */ + + const char* orthancStorageSOPClassUIDs[] = + { + UID_AmbulatoryECGWaveformStorage, + UID_ArterialPulseWaveformStorage, + UID_AutorefractionMeasurementsStorage, + UID_BasicStructuredDisplayStorage, + UID_BasicTextSRStorage, + UID_BasicVoiceAudioWaveformStorage, + UID_BlendingSoftcopyPresentationStateStorage, + UID_BreastTomosynthesisImageStorage, + UID_CardiacElectrophysiologyWaveformStorage, + UID_ChestCADSRStorage, + UID_ColonCADSRStorage, + UID_ColorSoftcopyPresentationStateStorage, + UID_ComprehensiveSRStorage, + UID_ComputedRadiographyImageStorage, + UID_CTImageStorage, + UID_DeformableSpatialRegistrationStorage, + UID_DigitalIntraOralXRayImageStorageForPresentation, + UID_DigitalIntraOralXRayImageStorageForProcessing, + UID_DigitalMammographyXRayImageStorageForPresentation, + UID_DigitalMammographyXRayImageStorageForProcessing, + UID_DigitalXRayImageStorageForPresentation, + UID_DigitalXRayImageStorageForProcessing, + UID_EncapsulatedCDAStorage, + UID_EncapsulatedPDFStorage, + UID_EnhancedCTImageStorage, + UID_EnhancedMRColorImageStorage, + UID_EnhancedMRImageStorage, + UID_EnhancedPETImageStorage, + UID_EnhancedSRStorage, + UID_EnhancedUSVolumeStorage, + UID_EnhancedXAImageStorage, + UID_EnhancedXRFImageStorage, + UID_GeneralAudioWaveformStorage, + UID_GeneralECGWaveformStorage, + UID_GenericImplantTemplateStorage, + UID_GrayscaleSoftcopyPresentationStateStorage, + UID_HemodynamicWaveformStorage, + UID_ImplantAssemblyTemplateStorage, + UID_ImplantationPlanSRDocumentStorage, + UID_ImplantTemplateGroupStorage, + UID_IntraocularLensCalculationsStorage, + UID_KeratometryMeasurementsStorage, + UID_KeyObjectSelectionDocumentStorage, + UID_LensometryMeasurementsStorage, + UID_MacularGridThicknessAndVolumeReportStorage, + UID_MammographyCADSRStorage, + UID_MRImageStorage, + UID_MRSpectroscopyStorage, + UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, + UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, + UID_MultiframeSingleBitSecondaryCaptureImageStorage, + UID_MultiframeTrueColorSecondaryCaptureImageStorage, + UID_NuclearMedicineImageStorage, + UID_OphthalmicAxialMeasurementsStorage, + UID_OphthalmicPhotography16BitImageStorage, + UID_OphthalmicPhotography8BitImageStorage, + UID_OphthalmicTomographyImageStorage, + UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, + UID_PositronEmissionTomographyImageStorage, + UID_ProcedureLogStorage, + UID_PseudoColorSoftcopyPresentationStateStorage, + UID_RawDataStorage, + UID_RealWorldValueMappingStorage, + UID_RespiratoryWaveformStorage, + UID_RTBeamsTreatmentRecordStorage, + UID_RTBrachyTreatmentRecordStorage, + UID_RTDoseStorage, + UID_RTImageStorage, + UID_RTIonBeamsTreatmentRecordStorage, + UID_RTIonPlanStorage, + UID_RTPlanStorage, + UID_RTStructureSetStorage, + UID_RTTreatmentSummaryRecordStorage, + UID_SecondaryCaptureImageStorage, + UID_SegmentationStorage, + UID_SpatialFiducialsStorage, + UID_SpatialRegistrationStorage, + UID_SpectaclePrescriptionReportStorage, + UID_StereometricRelationshipStorage, + UID_SubjectiveRefractionMeasurementsStorage, + UID_SurfaceSegmentationStorage, + UID_TwelveLeadECGWaveformStorage, + UID_UltrasoundImageStorage, + UID_UltrasoundMultiframeImageStorage, + UID_VideoEndoscopicImageStorage, + UID_VideoMicroscopicImageStorage, + UID_VideoPhotographicImageStorage, + UID_VisualAcuityMeasurementsStorage, + UID_VLEndoscopicImageStorage, + UID_VLMicroscopicImageStorage, + UID_VLPhotographicImageStorage, + UID_VLSlideCoordinatesMicroscopicImageStorage, + UID_VLWholeSlideMicroscopyImageStorage, + UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, + UID_XRay3DAngiographicImageStorage, + UID_XRay3DCraniofacialImageStorage, + UID_XRayAngiographicImageStorage, + UID_XRayRadiationDoseSRStorage, + UID_XRayRadiofluoroscopicImageStorage, + // retired + UID_RETIRED_HardcopyColorImageStorage, + UID_RETIRED_HardcopyGrayscaleImageStorage, + UID_RETIRED_NuclearMedicineImageStorage, + UID_RETIRED_StandaloneCurveStorage, + UID_RETIRED_StandaloneModalityLUTStorage, + UID_RETIRED_StandaloneOverlayStorage, + UID_RETIRED_StandalonePETCurveStorage, + UID_RETIRED_StandaloneVOILUTStorage, + UID_RETIRED_StoredPrintStorage, + UID_RETIRED_UltrasoundImageStorage, + UID_RETIRED_UltrasoundMultiframeImageStorage, + UID_RETIRED_VLImageStorage, + UID_RETIRED_VLMultiFrameImageStorage, + UID_RETIRED_XRayAngiographicBiPlaneImageStorage, + // draft + UID_DRAFT_SRAudioStorage, + UID_DRAFT_SRComprehensiveStorage, + UID_DRAFT_SRDetailStorage, + UID_DRAFT_SRTextStorage, + UID_DRAFT_WaveformStorage, + UID_DRAFT_RTBeamsDeliveryInstructionStorage, + NULL + }; + + const int orthancStorageSOPClassUIDsCount = (sizeof(orthancStorageSOPClassUIDs) / sizeof(const char*)) - 1; + + + OFCondition AssociationCleanup(T_ASC_Association *assoc) { OFString temp_str; @@ -355,7 +501,7 @@ transferSyntaxes.push_back(UID_RLELosslessTransferSyntax); /* accept the Verification SOP Class if presented */ - cond = ASC_acceptContextsWithPreferredTransferSyntaxes( assoc->params, &knownAbstractSyntaxes[0], knownAbstractSyntaxes.size(), &transferSyntaxes[0], transferSyntaxes.size()); + cond = ASC_acceptContextsWithPreferredTransferSyntaxes(assoc->params, &knownAbstractSyntaxes[0], knownAbstractSyntaxes.size(), &transferSyntaxes[0], transferSyntaxes.size()); if (cond.bad()) { LOG(INFO) << cond.text(); @@ -364,7 +510,7 @@ } /* the array of Storage SOP Class UIDs comes from dcuid.h */ - cond = ASC_acceptContextsWithPreferredTransferSyntaxes( assoc->params, dcmAllStorageSOPClassUIDs, numberOfAllDcmStorageSOPClassUIDs, &transferSyntaxes[0], transferSyntaxes.size()); + cond = ASC_acceptContextsWithPreferredTransferSyntaxes(assoc->params, orthancStorageSOPClassUIDs, orthancStorageSOPClassUIDsCount, &transferSyntaxes[0], transferSyntaxes.size()); if (cond.bad()) { LOG(INFO) << cond.text(); @@ -668,7 +814,7 @@ } - OFCondition EchoScp( T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) + OFCondition EchoScp(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) { OFString temp_str; LOG(INFO) << "Received Echo Request";
--- a/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp Mon Jul 28 13:31:35 2014 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp Tue Jul 29 10:24:09 2014 +0200 @@ -104,6 +104,15 @@ call.GetOutput().AnswerBuffer(Toolbox::GetNowIsoString(), "text/plain"); } + + static void GetDicomConformanceStatement(RestApiGetCall& call) + { + std::string statement; + GetFileResource(statement, EmbeddedResources::DICOM_CONFORMANCE_STATEMENT); + call.GetOutput().AnswerBuffer(statement, "text/plain"); + } + + void OrthancRestApi::RegisterSystem() { Register("/", ServeRoot); @@ -112,5 +121,6 @@ Register("/tools/generate-uid", GenerateUid); Register("/tools/execute-script", ExecuteScript); Register("/tools/now", GetNowIsoString); + Register("/tools/dicom-conformance", GetDicomConformanceStatement); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/DicomConformanceStatement.py Tue Jul 29 10:24:09 2014 +0200 @@ -0,0 +1,31 @@ +#!/usr/bin/python + +# This file injects the UID information into the DICOM conformance +# statement of Orthanc + +import re + +# Read the conformance statement of Orthanc +with open('DicomConformanceStatement.txt', 'r') as f: + statements = f.readlines() + +# Create an index of all the DICOM UIDs that are known to DCMTK +uids = {} +with open('/usr/include/dcmtk/dcmdata/dcuid.h', 'r') as dcmtk: + for l in dcmtk.readlines(): + m = re.match(r'#define UID_(.+?)\s*"(.+?)"', l) + if m != None: + uids[m.group(1)] = m.group(2) + +# Loop over the lines of the statement, looking for the "|" separator +with open('/tmp/DicomConformanceStatement.txt', 'w') as f: + for l in statements: + m = re.match(r'(\s*)(.*?)(\s*)\|.*$', l) + if m != None: + name = m.group(2) + uid = uids[name] + f.write('%s%s%s| %s\n' % (m.group(1), name, m.group(3), uid)) + + else: + # No "|" in this line, just output it + f.write(l)
--- a/Resources/DicomConformanceStatement.txt Mon Jul 28 13:31:35 2014 +0200 +++ b/Resources/DicomConformanceStatement.txt Tue Jul 29 10:24:09 2014 +0200 @@ -1,4 +1,4 @@ -*** WORK IN PROGRESS, UNSTABLE FILE!!! *** +*** WORK IN PROGRESS, EXPERIMENTAL INFORMATION!!! *** ====================================== @@ -7,18 +7,178 @@ --------------------- +Echo SCP Conformance +--------------------- + +Orthanc supports the following SOP Classes as an SCP for C-Echo: + + VerificationSOPClass | 1.2.840.10008.1.1 + + +--------------------- +Store SCP Conformance +--------------------- + +Orthanc supports the following SOP Classes as an SCP for C-Store: + + AmbulatoryECGWaveformStorage | + ArterialPulseWaveformStorage | + AutorefractionMeasurementsStorage | + BasicStructuredDisplayStorage | + BasicTextSRStorage | + BasicVoiceAudioWaveformStorage | + BlendingSoftcopyPresentationStateStorage | + BreastTomosynthesisImageStorage | + CardiacElectrophysiologyWaveformStorage | + ChestCADSRStorage | + ColonCADSRStorage | + ColorSoftcopyPresentationStateStorage | + ComprehensiveSRStorage | + ComputedRadiographyImageStorage | + CTImageStorage | + DeformableSpatialRegistrationStorage | + DigitalIntraOralXRayImageStorageForPresentation | + DigitalIntraOralXRayImageStorageForProcessing | + DigitalMammographyXRayImageStorageForPresentation | + DigitalMammographyXRayImageStorageForProcessing | + DigitalXRayImageStorageForPresentation | + DigitalXRayImageStorageForProcessing | + EncapsulatedCDAStorage | + EncapsulatedPDFStorage | + EnhancedCTImageStorage | + EnhancedMRColorImageStorage | + EnhancedMRImageStorage | + EnhancedPETImageStorage | + EnhancedSRStorage | + EnhancedUSVolumeStorage | + EnhancedXAImageStorage | + EnhancedXRFImageStorage | + GeneralAudioWaveformStorage | + GeneralECGWaveformStorage | + GenericImplantTemplateStorage | + GrayscaleSoftcopyPresentationStateStorage | + HemodynamicWaveformStorage | + ImplantAssemblyTemplateStorage | + ImplantationPlanSRDocumentStorage | + ImplantTemplateGroupStorage | + IntraocularLensCalculationsStorage | + KeratometryMeasurementsStorage | + KeyObjectSelectionDocumentStorage | + LensometryMeasurementsStorage | + MacularGridThicknessAndVolumeReportStorage | + MammographyCADSRStorage | + MRImageStorage | + MRSpectroscopyStorage | + MultiframeGrayscaleByteSecondaryCaptureImageStorage | + MultiframeGrayscaleWordSecondaryCaptureImageStorage | + MultiframeSingleBitSecondaryCaptureImageStorage | + MultiframeTrueColorSecondaryCaptureImageStorage | + NuclearMedicineImageStorage | + OphthalmicAxialMeasurementsStorage | + OphthalmicPhotography16BitImageStorage | + OphthalmicPhotography8BitImageStorage | + OphthalmicTomographyImageStorage | + OphthalmicVisualFieldStaticPerimetryMeasurementsStorage | + PositronEmissionTomographyImageStorage | + ProcedureLogStorage | + PseudoColorSoftcopyPresentationStateStorage | + RawDataStorage | + RealWorldValueMappingStorage | + RespiratoryWaveformStorage | + RTBeamsTreatmentRecordStorage | + RTBrachyTreatmentRecordStorage | + RTDoseStorage | + RTImageStorage | + RTIonBeamsTreatmentRecordStorage | + RTIonPlanStorage | + RTPlanStorage | + RTStructureSetStorage | + RTTreatmentSummaryRecordStorage | + SecondaryCaptureImageStorage | + SegmentationStorage | + SpatialFiducialsStorage | + SpatialRegistrationStorage | + SpectaclePrescriptionReportStorage | + StereometricRelationshipStorage | + SubjectiveRefractionMeasurementsStorage | + SurfaceSegmentationStorage | + TwelveLeadECGWaveformStorage | + UltrasoundImageStorage | + UltrasoundMultiframeImageStorage | + VideoEndoscopicImageStorage | + VideoMicroscopicImageStorage | + VideoPhotographicImageStorage | + VisualAcuityMeasurementsStorage | + VLEndoscopicImageStorage | + VLMicroscopicImageStorage | + VLPhotographicImageStorage | + VLSlideCoordinatesMicroscopicImageStorage | + VLWholeSlideMicroscopyImageStorage | + XAXRFGrayscaleSoftcopyPresentationStateStorage | + XRay3DAngiographicImageStorage | + XRay3DCraniofacialImageStorage | + XRayAngiographicImageStorage | + XRayRadiationDoseSRStorage | + XRayRadiofluoroscopicImageStorage | + + RETIRED_HardcopyColorImageStorage | + RETIRED_HardcopyGrayscaleImageStorage | + RETIRED_NuclearMedicineImageStorage | + RETIRED_StandaloneCurveStorage | + RETIRED_StandaloneModalityLUTStorage | + RETIRED_StandaloneOverlayStorage | + RETIRED_StandalonePETCurveStorage | + RETIRED_StandaloneVOILUTStorage | + RETIRED_StoredPrintStorage | + RETIRED_UltrasoundImageStorage | + RETIRED_UltrasoundMultiframeImageStorage | + RETIRED_VLImageStorage | + RETIRED_VLMultiFrameImageStorage | + RETIRED_XRayAngiographicBiPlaneImageStorage | + + DRAFT_SRAudioStorage | + DRAFT_SRComprehensiveStorage | + DRAFT_SRDetailStorage | + DRAFT_SRTextStorage | + DRAFT_WaveformStorage | + DRAFT_RTBeamsDeliveryInstructionStorage | + + +-------------------- +Find SCP Conformance +-------------------- + +Orthanc supports the following SOP Classes as an SCP for C-Find: + + FINDPatientRootQueryRetrieveInformationModel | 1.2.840.10008.5.1.4.1.2.1.1 + FINDStudyRootQueryRetrieveInformationModel | 1.2.840.10008.5.1.4.1.2.2.1 + + +-------------------- +Move SCP Conformance +-------------------- + +Orthanc supports the following SOP Classes as an SCP for C-Move: + + MOVEPatientRootQueryRetrieveInformationModel | 1.2.840.10008.5.1.4.1.2.1.2 + MOVEStudyRootQueryRetrieveInformationModel | 1.2.840.10008.5.1.4.1.2.2.2 + + +--------------------- Echo SCU Conformance --------------------- Orthanc supports the following SOP Classes as an SCU for C-Echo: + VerificationSOPClass | 1.2.840.10008.1.1 + --------------------- Store SCU Conformance --------------------- -Orthanc supports the following SOP Classes as an SCU for C-Store: - +All the SOP Classes that are listed in the "Store SCP Conformance" +(see above) section are available as an SCU for C-Store. -------------------- @@ -27,6 +187,9 @@ Orthanc supports the following SOP Classes as an SCU for C-Find: + FINDPatientRootQueryRetrieveInformationModel | + FINDStudyRootQueryRetrieveInformationModel | + FINDStudyRootQueryRetrieveInformationModel | -------------------- @@ -35,56 +198,66 @@ Orthanc supports the following SOP Classes as an SCU for C-Move: - - + MOVEStudyRootQueryRetrieveInformationModel | ---------------------- -Echo SCP Conformance ---------------------- +----------------- +Transfer Syntaxes +----------------- -Orthanc supports the following SOP Classes as an SCP for C-Echo: - -VerificationSOPClass | +Orthanc will accept and negociate presentation contexts for all of the +abovementioned supported SOP Classes using any of the following +transfer syntaxes: + LittleEndianExplicitTransferSyntax | + BigEndianExplicitTransferSyntax | + LittleEndianImplicitTransferSyntax | + DeflatedExplicitVRLittleEndianTransferSyntax | + JPEGProcess1TransferSyntax | + JPEGProcess2_4TransferSyntax | + JPEGProcess3_5TransferSyntax | + JPEGProcess6_8TransferSyntax | + JPEGProcess7_9TransferSyntax | + JPEGProcess10_12TransferSyntax | + JPEGProcess11_13TransferSyntax | + JPEGProcess14TransferSyntax | + JPEGProcess15TransferSyntax | + JPEGProcess16_18TransferSyntax | + JPEGProcess17_19TransferSyntax | + JPEGProcess20_22TransferSyntax | + JPEGProcess21_23TransferSyntax | + JPEGProcess24_26TransferSyntax | + JPEGProcess25_27TransferSyntax | + JPEGProcess28TransferSyntax | + JPEGProcess29TransferSyntax | + JPEGProcess14SV1TransferSyntax | + JPEGLSLosslessTransferSyntax | + JPEGLSLossyTransferSyntax | + JPEG2000LosslessOnlyTransferSyntax | + JPEG2000TransferSyntax | + JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax | + JPEG2000Part2MulticomponentImageCompressionTransferSyntax | + JPIPReferencedTransferSyntax | + JPIPReferencedDeflateTransferSyntax | + MPEG2MainProfileAtMainLevelTransferSyntax | + MPEG2MainProfileAtHighLevelTransferSyntax | + RLELosslessTransferSyntax | ---------------------- -Store SCP Conformance ---------------------- +When possible, Orthanc will prefer the +LittleEndianImplicitTransferSyntax transfer syntax +(1.2.840.10008.1.2). -Orthanc supports the following SOP Classes as an SCP for C-Store: - - +Orthanc does not support extended negotiation. -------------------- -Find SCP Conformance --------------------- - -Orthanc supports the following SOP Classes as an SCP for C-Find: - -FINDPatientRootQueryRetrieveInformationModel | -FINDStudyRootQueryRetrieveInformationModel | - - --------------------- -Move SCP Conformance +Implementation notes -------------------- -Orthanc supports the following SOP Classes as an SCP for C-Move: - -MOVEStudyRootQueryRetrieveInformationModel | -MOVEPatientRootQueryRetrieveInformationModel | - - - ----------------------------- -Implementation notes for SCP ----------------------------- - -The supported SOP classes for Echo SCP, Store SCP, Find SCP and Move -SCP can be found in the function -"Orthanc::Internals::AcceptAssociation()" from file +The information above about the SCP support is readily extracted from +the function "Orthanc::Internals::AcceptAssociation()" from file "OrthancServer/Internals/CommandDispatcher.cpp". - +The information above about the SCU support is derived from the class +"Orthanc::DicomUserConnection" from file +"OrthancServer/DicomProtocol/DicomUserConnection.cpp".