Mercurial > hg > orthanc
comparison OrthancServer/Sources/main.cpp @ 4472:28a4baadde17
rename TransferSyntax enum as TransferSyntaxGroup
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 26 Jan 2021 10:18:50 +0100 |
parents | 5ffa4e14e4bd |
children | 68f52897c119 |
comparison
equal
deleted
inserted
replaced
4471:b6818bbef7b8 | 4472:28a4baadde17 |
---|---|
283 bool alwaysAllowStore_; | 283 bool alwaysAllowStore_; |
284 | 284 |
285 bool IsAllowedTransferSyntax(const std::string& remoteIp, | 285 bool IsAllowedTransferSyntax(const std::string& remoteIp, |
286 const std::string& remoteAet, | 286 const std::string& remoteAet, |
287 const std::string& calledAet, | 287 const std::string& calledAet, |
288 TransferSyntax syntax) | 288 TransferSyntaxGroup syntax) |
289 { | 289 { |
290 std::string configuration; | 290 std::string configuration; |
291 | 291 |
292 switch (syntax) | 292 switch (syntax) |
293 { | 293 { |
294 case TransferSyntax_Deflated: | 294 case TransferSyntaxGroup_Deflated: |
295 configuration = "DeflatedTransferSyntaxAccepted"; | 295 configuration = "DeflatedTransferSyntaxAccepted"; |
296 break; | 296 break; |
297 | 297 |
298 case TransferSyntax_Jpeg: | 298 case TransferSyntaxGroup_Jpeg: |
299 configuration = "JpegTransferSyntaxAccepted"; | 299 configuration = "JpegTransferSyntaxAccepted"; |
300 break; | 300 break; |
301 | 301 |
302 case TransferSyntax_Jpeg2000: | 302 case TransferSyntaxGroup_Jpeg2000: |
303 configuration = "Jpeg2000TransferSyntaxAccepted"; | 303 configuration = "Jpeg2000TransferSyntaxAccepted"; |
304 break; | 304 break; |
305 | 305 |
306 case TransferSyntax_JpegLossless: | 306 case TransferSyntaxGroup_JpegLossless: |
307 configuration = "JpegLosslessTransferSyntaxAccepted"; | 307 configuration = "JpegLosslessTransferSyntaxAccepted"; |
308 break; | 308 break; |
309 | 309 |
310 case TransferSyntax_Jpip: | 310 case TransferSyntaxGroup_Jpip: |
311 configuration = "JpipTransferSyntaxAccepted"; | 311 configuration = "JpipTransferSyntaxAccepted"; |
312 break; | 312 break; |
313 | 313 |
314 case TransferSyntax_Mpeg2: | 314 case TransferSyntaxGroup_Mpeg2: |
315 configuration = "Mpeg2TransferSyntaxAccepted"; | 315 configuration = "Mpeg2TransferSyntaxAccepted"; |
316 break; | 316 break; |
317 | 317 |
318 case TransferSyntax_Mpeg4: | 318 case TransferSyntaxGroup_Mpeg4: |
319 configuration = "Mpeg4TransferSyntaxAccepted"; | 319 configuration = "Mpeg4TransferSyntaxAccepted"; |
320 break; | 320 break; |
321 | 321 |
322 case TransferSyntax_Rle: | 322 case TransferSyntaxGroup_Rle: |
323 configuration = "RleTransferSyntaxAccepted"; | 323 configuration = "RleTransferSyntaxAccepted"; |
324 break; | 324 break; |
325 | 325 |
326 default: | 326 default: |
327 throw OrthancException(ErrorCode_ParameterOutOfRange); | 327 throw OrthancException(ErrorCode_ParameterOutOfRange); |
441 // This is the list of the transfer syntaxes that were supported up to Orthanc 0.7.1 | 441 // This is the list of the transfer syntaxes that were supported up to Orthanc 0.7.1 |
442 target.insert(DicomTransferSyntax_LittleEndianExplicit); | 442 target.insert(DicomTransferSyntax_LittleEndianExplicit); |
443 target.insert(DicomTransferSyntax_BigEndianExplicit); | 443 target.insert(DicomTransferSyntax_BigEndianExplicit); |
444 target.insert(DicomTransferSyntax_LittleEndianImplicit); | 444 target.insert(DicomTransferSyntax_LittleEndianImplicit); |
445 | 445 |
446 // New transfer syntaxes supported since Orthanc 0.7.2 | 446 // Group of transfer syntaxes, supported since Orthanc 0.7.2 |
447 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Deflated)) | 447 std::set<TransferSyntaxGroup> groups; |
448 { | 448 groups.insert(TransferSyntaxGroup_Deflated); |
449 target.insert(DicomTransferSyntax_DeflatedLittleEndianExplicit); | 449 groups.insert(TransferSyntaxGroup_Jpeg); |
450 } | 450 groups.insert(TransferSyntaxGroup_Jpeg2000); |
451 | 451 groups.insert(TransferSyntaxGroup_JpegLossless); |
452 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Jpeg)) | 452 groups.insert(TransferSyntaxGroup_Jpip); |
453 { | 453 groups.insert(TransferSyntaxGroup_Mpeg2); |
454 target.insert(DicomTransferSyntax_JPEGProcess1); | 454 groups.insert(TransferSyntaxGroup_Mpeg4); // New in Orthanc 1.6.0 |
455 target.insert(DicomTransferSyntax_JPEGProcess2_4); | 455 groups.insert(TransferSyntaxGroup_Rle); |
456 target.insert(DicomTransferSyntax_JPEGProcess3_5); | 456 assert(groups.size() == 8u); // Number of items in enum, cf. "ServerEnumerations.h" |
457 target.insert(DicomTransferSyntax_JPEGProcess6_8); | 457 |
458 target.insert(DicomTransferSyntax_JPEGProcess7_9); | 458 for (std::set<TransferSyntaxGroup>::const_iterator |
459 target.insert(DicomTransferSyntax_JPEGProcess10_12); | 459 group = groups.begin(); group != groups.end(); ++group) |
460 target.insert(DicomTransferSyntax_JPEGProcess11_13); | 460 { |
461 target.insert(DicomTransferSyntax_JPEGProcess14); | 461 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, *group)) |
462 target.insert(DicomTransferSyntax_JPEGProcess15); | 462 { |
463 target.insert(DicomTransferSyntax_JPEGProcess16_18); | 463 GetTransferSyntaxGroup(target, *group, false /* don't clear target */); |
464 target.insert(DicomTransferSyntax_JPEGProcess17_19); | 464 } |
465 target.insert(DicomTransferSyntax_JPEGProcess20_22); | |
466 target.insert(DicomTransferSyntax_JPEGProcess21_23); | |
467 target.insert(DicomTransferSyntax_JPEGProcess24_26); | |
468 target.insert(DicomTransferSyntax_JPEGProcess25_27); | |
469 target.insert(DicomTransferSyntax_JPEGProcess28); | |
470 target.insert(DicomTransferSyntax_JPEGProcess29); | |
471 target.insert(DicomTransferSyntax_JPEGProcess14SV1); | |
472 } | |
473 | |
474 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Jpeg2000)) | |
475 { | |
476 target.insert(DicomTransferSyntax_JPEG2000); | |
477 target.insert(DicomTransferSyntax_JPEG2000LosslessOnly); | |
478 target.insert(DicomTransferSyntax_JPEG2000Multicomponent); | |
479 target.insert(DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly); | |
480 } | |
481 | |
482 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_JpegLossless)) | |
483 { | |
484 target.insert(DicomTransferSyntax_JPEGLSLossless); | |
485 target.insert(DicomTransferSyntax_JPEGLSLossy); | |
486 } | |
487 | |
488 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Jpip)) | |
489 { | |
490 target.insert(DicomTransferSyntax_JPIPReferenced); | |
491 target.insert(DicomTransferSyntax_JPIPReferencedDeflate); | |
492 } | |
493 | |
494 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Mpeg2)) | |
495 { | |
496 target.insert(DicomTransferSyntax_MPEG2MainProfileAtMainLevel); | |
497 target.insert(DicomTransferSyntax_MPEG2MainProfileAtHighLevel); | |
498 } | |
499 | |
500 #if DCMTK_VERSION_NUMBER >= 361 | |
501 // New in Orthanc 1.6.0 | |
502 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Mpeg4)) | |
503 { | |
504 target.insert(DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1); | |
505 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_1); | |
506 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo); | |
507 target.insert(DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo); | |
508 target.insert(DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2); | |
509 } | |
510 #endif | |
511 | |
512 if (IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Rle)) | |
513 { | |
514 target.insert(DicomTransferSyntax_RLELossless); | |
515 } | 465 } |
516 } | 466 } |
517 | 467 |
518 | 468 |
519 virtual bool IsUnknownSopClassAccepted(const std::string& remoteIp, | 469 virtual bool IsUnknownSopClassAccepted(const std::string& remoteIp, |