Mercurial > hg > orthanc
comparison OrthancServer/Internals/CommandDispatcher.cpp @ 1073:01414536c930
complete DICOM conformance
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Jul 2014 10:24:09 +0200 |
parents | 84513f2ee1f3 |
children | b161593551db |
comparison
equal
deleted
inserted
replaced
1072:1dffa9f44a94 | 1073:01414536c930 |
---|---|
232 return cond; | 232 return cond; |
233 } | 233 } |
234 #endif | 234 #endif |
235 | 235 |
236 | 236 |
237 | |
237 namespace Orthanc | 238 namespace Orthanc |
238 { | 239 { |
239 namespace Internals | 240 namespace Internals |
240 { | 241 { |
242 /** | |
243 * EXTRACT OF FILE "dcmdata/libsrc/dcuid.cc" FROM DCMTK 3.6.0 | |
244 * (dcmAllStorageSOPClassUIDs). | |
245 * | |
246 * an array of const strings containing all known Storage SOP | |
247 * Classes that fit into the conventional | |
248 * PATIENT-STUDY-SERIES-INSTANCE information model, | |
249 * i.e. everything a Storage SCP might want to store in a PACS. | |
250 * Special cases such as hanging protocol storage or the Storage | |
251 * SOP Class are not included in this list. | |
252 * | |
253 * THIS LIST CONTAINS ALL STORAGE SOP CLASSES INCLUDING RETIRED | |
254 * ONES AND IS LARGER THAN 64 ENTRIES. | |
255 */ | |
256 | |
257 const char* orthancStorageSOPClassUIDs[] = | |
258 { | |
259 UID_AmbulatoryECGWaveformStorage, | |
260 UID_ArterialPulseWaveformStorage, | |
261 UID_AutorefractionMeasurementsStorage, | |
262 UID_BasicStructuredDisplayStorage, | |
263 UID_BasicTextSRStorage, | |
264 UID_BasicVoiceAudioWaveformStorage, | |
265 UID_BlendingSoftcopyPresentationStateStorage, | |
266 UID_BreastTomosynthesisImageStorage, | |
267 UID_CardiacElectrophysiologyWaveformStorage, | |
268 UID_ChestCADSRStorage, | |
269 UID_ColonCADSRStorage, | |
270 UID_ColorSoftcopyPresentationStateStorage, | |
271 UID_ComprehensiveSRStorage, | |
272 UID_ComputedRadiographyImageStorage, | |
273 UID_CTImageStorage, | |
274 UID_DeformableSpatialRegistrationStorage, | |
275 UID_DigitalIntraOralXRayImageStorageForPresentation, | |
276 UID_DigitalIntraOralXRayImageStorageForProcessing, | |
277 UID_DigitalMammographyXRayImageStorageForPresentation, | |
278 UID_DigitalMammographyXRayImageStorageForProcessing, | |
279 UID_DigitalXRayImageStorageForPresentation, | |
280 UID_DigitalXRayImageStorageForProcessing, | |
281 UID_EncapsulatedCDAStorage, | |
282 UID_EncapsulatedPDFStorage, | |
283 UID_EnhancedCTImageStorage, | |
284 UID_EnhancedMRColorImageStorage, | |
285 UID_EnhancedMRImageStorage, | |
286 UID_EnhancedPETImageStorage, | |
287 UID_EnhancedSRStorage, | |
288 UID_EnhancedUSVolumeStorage, | |
289 UID_EnhancedXAImageStorage, | |
290 UID_EnhancedXRFImageStorage, | |
291 UID_GeneralAudioWaveformStorage, | |
292 UID_GeneralECGWaveformStorage, | |
293 UID_GenericImplantTemplateStorage, | |
294 UID_GrayscaleSoftcopyPresentationStateStorage, | |
295 UID_HemodynamicWaveformStorage, | |
296 UID_ImplantAssemblyTemplateStorage, | |
297 UID_ImplantationPlanSRDocumentStorage, | |
298 UID_ImplantTemplateGroupStorage, | |
299 UID_IntraocularLensCalculationsStorage, | |
300 UID_KeratometryMeasurementsStorage, | |
301 UID_KeyObjectSelectionDocumentStorage, | |
302 UID_LensometryMeasurementsStorage, | |
303 UID_MacularGridThicknessAndVolumeReportStorage, | |
304 UID_MammographyCADSRStorage, | |
305 UID_MRImageStorage, | |
306 UID_MRSpectroscopyStorage, | |
307 UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, | |
308 UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, | |
309 UID_MultiframeSingleBitSecondaryCaptureImageStorage, | |
310 UID_MultiframeTrueColorSecondaryCaptureImageStorage, | |
311 UID_NuclearMedicineImageStorage, | |
312 UID_OphthalmicAxialMeasurementsStorage, | |
313 UID_OphthalmicPhotography16BitImageStorage, | |
314 UID_OphthalmicPhotography8BitImageStorage, | |
315 UID_OphthalmicTomographyImageStorage, | |
316 UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, | |
317 UID_PositronEmissionTomographyImageStorage, | |
318 UID_ProcedureLogStorage, | |
319 UID_PseudoColorSoftcopyPresentationStateStorage, | |
320 UID_RawDataStorage, | |
321 UID_RealWorldValueMappingStorage, | |
322 UID_RespiratoryWaveformStorage, | |
323 UID_RTBeamsTreatmentRecordStorage, | |
324 UID_RTBrachyTreatmentRecordStorage, | |
325 UID_RTDoseStorage, | |
326 UID_RTImageStorage, | |
327 UID_RTIonBeamsTreatmentRecordStorage, | |
328 UID_RTIonPlanStorage, | |
329 UID_RTPlanStorage, | |
330 UID_RTStructureSetStorage, | |
331 UID_RTTreatmentSummaryRecordStorage, | |
332 UID_SecondaryCaptureImageStorage, | |
333 UID_SegmentationStorage, | |
334 UID_SpatialFiducialsStorage, | |
335 UID_SpatialRegistrationStorage, | |
336 UID_SpectaclePrescriptionReportStorage, | |
337 UID_StereometricRelationshipStorage, | |
338 UID_SubjectiveRefractionMeasurementsStorage, | |
339 UID_SurfaceSegmentationStorage, | |
340 UID_TwelveLeadECGWaveformStorage, | |
341 UID_UltrasoundImageStorage, | |
342 UID_UltrasoundMultiframeImageStorage, | |
343 UID_VideoEndoscopicImageStorage, | |
344 UID_VideoMicroscopicImageStorage, | |
345 UID_VideoPhotographicImageStorage, | |
346 UID_VisualAcuityMeasurementsStorage, | |
347 UID_VLEndoscopicImageStorage, | |
348 UID_VLMicroscopicImageStorage, | |
349 UID_VLPhotographicImageStorage, | |
350 UID_VLSlideCoordinatesMicroscopicImageStorage, | |
351 UID_VLWholeSlideMicroscopyImageStorage, | |
352 UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, | |
353 UID_XRay3DAngiographicImageStorage, | |
354 UID_XRay3DCraniofacialImageStorage, | |
355 UID_XRayAngiographicImageStorage, | |
356 UID_XRayRadiationDoseSRStorage, | |
357 UID_XRayRadiofluoroscopicImageStorage, | |
358 // retired | |
359 UID_RETIRED_HardcopyColorImageStorage, | |
360 UID_RETIRED_HardcopyGrayscaleImageStorage, | |
361 UID_RETIRED_NuclearMedicineImageStorage, | |
362 UID_RETIRED_StandaloneCurveStorage, | |
363 UID_RETIRED_StandaloneModalityLUTStorage, | |
364 UID_RETIRED_StandaloneOverlayStorage, | |
365 UID_RETIRED_StandalonePETCurveStorage, | |
366 UID_RETIRED_StandaloneVOILUTStorage, | |
367 UID_RETIRED_StoredPrintStorage, | |
368 UID_RETIRED_UltrasoundImageStorage, | |
369 UID_RETIRED_UltrasoundMultiframeImageStorage, | |
370 UID_RETIRED_VLImageStorage, | |
371 UID_RETIRED_VLMultiFrameImageStorage, | |
372 UID_RETIRED_XRayAngiographicBiPlaneImageStorage, | |
373 // draft | |
374 UID_DRAFT_SRAudioStorage, | |
375 UID_DRAFT_SRComprehensiveStorage, | |
376 UID_DRAFT_SRDetailStorage, | |
377 UID_DRAFT_SRTextStorage, | |
378 UID_DRAFT_WaveformStorage, | |
379 UID_DRAFT_RTBeamsDeliveryInstructionStorage, | |
380 NULL | |
381 }; | |
382 | |
383 const int orthancStorageSOPClassUIDsCount = (sizeof(orthancStorageSOPClassUIDs) / sizeof(const char*)) - 1; | |
384 | |
385 | |
386 | |
241 OFCondition AssociationCleanup(T_ASC_Association *assoc) | 387 OFCondition AssociationCleanup(T_ASC_Association *assoc) |
242 { | 388 { |
243 OFString temp_str; | 389 OFString temp_str; |
244 OFCondition cond = ASC_dropSCPAssociation(assoc); | 390 OFCondition cond = ASC_dropSCPAssociation(assoc); |
245 if (cond.bad()) | 391 if (cond.bad()) |
353 transferSyntaxes.push_back(UID_MPEG2MainProfileAtMainLevelTransferSyntax); | 499 transferSyntaxes.push_back(UID_MPEG2MainProfileAtMainLevelTransferSyntax); |
354 transferSyntaxes.push_back(UID_MPEG2MainProfileAtHighLevelTransferSyntax); | 500 transferSyntaxes.push_back(UID_MPEG2MainProfileAtHighLevelTransferSyntax); |
355 transferSyntaxes.push_back(UID_RLELosslessTransferSyntax); | 501 transferSyntaxes.push_back(UID_RLELosslessTransferSyntax); |
356 | 502 |
357 /* accept the Verification SOP Class if presented */ | 503 /* accept the Verification SOP Class if presented */ |
358 cond = ASC_acceptContextsWithPreferredTransferSyntaxes( assoc->params, &knownAbstractSyntaxes[0], knownAbstractSyntaxes.size(), &transferSyntaxes[0], transferSyntaxes.size()); | 504 cond = ASC_acceptContextsWithPreferredTransferSyntaxes(assoc->params, &knownAbstractSyntaxes[0], knownAbstractSyntaxes.size(), &transferSyntaxes[0], transferSyntaxes.size()); |
359 if (cond.bad()) | 505 if (cond.bad()) |
360 { | 506 { |
361 LOG(INFO) << cond.text(); | 507 LOG(INFO) << cond.text(); |
362 AssociationCleanup(assoc); | 508 AssociationCleanup(assoc); |
363 return NULL; | 509 return NULL; |
364 } | 510 } |
365 | 511 |
366 /* the array of Storage SOP Class UIDs comes from dcuid.h */ | 512 /* the array of Storage SOP Class UIDs comes from dcuid.h */ |
367 cond = ASC_acceptContextsWithPreferredTransferSyntaxes( assoc->params, dcmAllStorageSOPClassUIDs, numberOfAllDcmStorageSOPClassUIDs, &transferSyntaxes[0], transferSyntaxes.size()); | 513 cond = ASC_acceptContextsWithPreferredTransferSyntaxes(assoc->params, orthancStorageSOPClassUIDs, orthancStorageSOPClassUIDsCount, &transferSyntaxes[0], transferSyntaxes.size()); |
368 if (cond.bad()) | 514 if (cond.bad()) |
369 { | 515 { |
370 LOG(INFO) << cond.text(); | 516 LOG(INFO) << cond.text(); |
371 AssociationCleanup(assoc); | 517 AssociationCleanup(assoc); |
372 return NULL; | 518 return NULL; |
666 | 812 |
667 return !finished; | 813 return !finished; |
668 } | 814 } |
669 | 815 |
670 | 816 |
671 OFCondition EchoScp( T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) | 817 OFCondition EchoScp(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) |
672 { | 818 { |
673 OFString temp_str; | 819 OFString temp_str; |
674 LOG(INFO) << "Received Echo Request"; | 820 LOG(INFO) << "Received Echo Request"; |
675 //LOG(DEBUG) << DIMSE_dumpMessage(temp_str, msg->msg.CEchoRQ, DIMSE_INCOMING, NULL, presID)); | 821 //LOG(DEBUG) << DIMSE_dumpMessage(temp_str, msg->msg.CEchoRQ, DIMSE_INCOMING, NULL, presID)); |
676 | 822 |