comparison OrthancServer/Sources/ServerContext.cpp @ 4507:b4c58795f3a8

widening the use of DicomTransferSyntax enum
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Feb 2021 09:33:48 +0100
parents ac69c9f76c71
children 8f9090b137f1
comparison
equal deleted inserted replaced
4506:ac69c9f76c71 4507:b4c58795f3a8
515 bool hasPixelDataOffset; 515 bool hasPixelDataOffset;
516 uint64_t pixelDataOffset; 516 uint64_t pixelDataOffset;
517 hasPixelDataOffset = DicomStreamReader::LookupPixelDataOffset( 517 hasPixelDataOffset = DicomStreamReader::LookupPixelDataOffset(
518 pixelDataOffset, dicom.GetBufferData(), dicom.GetBufferSize()); 518 pixelDataOffset, dicom.GetBufferData(), dicom.GetBufferSize());
519 519
520 std::string transferSyntax; 520 DicomTransferSyntax transferSyntax;
521 bool hasTransferSyntax = dicom.LookupTransferSyntax(transferSyntax); 521 bool hasTransferSyntax = dicom.LookupTransferSyntax(transferSyntax);
522 522
523 DicomMap summary; 523 DicomMap summary;
524 OrthancConfiguration::DefaultExtractDicomSummary(summary, dicom.GetParsedDicomFile()); 524 dicom.GetSummary(summary);
525 525
526 try 526 try
527 { 527 {
528 MetricsRegistry::Timer timer(GetMetricsRegistry(), "orthanc_store_dicom_duration_ms"); 528 MetricsRegistry::Timer timer(GetMetricsRegistry(), "orthanc_store_dicom_duration_ms");
529 StorageAccessor accessor(area_, GetMetricsRegistry()); 529 StorageAccessor accessor(area_, GetMetricsRegistry());
530 530
531 resultPublicId = dicom.GetParsedDicomFile().GetHasher().HashInstance(); 531 DicomInstanceHasher hasher(summary);
532 resultPublicId = hasher.HashInstance();
532 533
533 Json::Value dicomAsJson; 534 Json::Value dicomAsJson;
534 OrthancConfiguration::DefaultDicomDatasetToJson(dicomAsJson, dicom.GetParsedDicomFile()); 535 dicom.GetDicomAsJson(dicomAsJson);
535 536
536 Json::Value simplifiedTags; 537 Json::Value simplifiedTags;
537 Toolbox::SimplifyDicomAsJson(simplifiedTags, dicomAsJson, DicomToJsonFormat_Human); 538 Toolbox::SimplifyDicomAsJson(simplifiedTags, dicomAsJson, DicomToJsonFormat_Human);
538 539
539 // Test if the instance must be filtered out 540 // Test if the instance must be filtered out
682 // Automated transcoding of incoming DICOM instance 683 // Automated transcoding of incoming DICOM instance
683 684
684 bool transcode = false; 685 bool transcode = false;
685 686
686 DicomTransferSyntax sourceSyntax; 687 DicomTransferSyntax sourceSyntax;
687 if (!FromDcmtkBridge::LookupOrthancTransferSyntax( 688 if (!dicom.LookupTransferSyntax(sourceSyntax) ||
688 sourceSyntax, dicom.GetParsedDicomFile().GetDcmtkObject()) ||
689 sourceSyntax == ingestTransferSyntax_) 689 sourceSyntax == ingestTransferSyntax_)
690 { 690 {
691 // Don't transcode if the incoming DICOM is already in the proper transfer syntax 691 // Don't transcode if the incoming DICOM is already in the proper transfer syntax
692 transcode = false; 692 transcode = false;
693 } 693 }
1682 if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_Before) 1682 if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_Before)
1683 { 1683 {
1684 std::unique_ptr<ImageAccessor> decoded; 1684 std::unique_ptr<ImageAccessor> decoded;
1685 try 1685 try
1686 { 1686 {
1687 decoded.reset(dicom.GetParsedDicomFile().DecodeFrame(frameIndex)); 1687 decoded.reset(dicom.DecodeFrame(frameIndex));
1688 } 1688 }
1689 catch (OrthancException& e) 1689 catch (OrthancException& e)
1690 { 1690 {
1691 } 1691 }
1692 1692
1721 } 1721 }
1722 #endif 1722 #endif
1723 1723
1724 if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_After) 1724 if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_After)
1725 { 1725 {
1726 return dicom.GetParsedDicomFile().DecodeFrame(frameIndex); 1726 return dicom.DecodeFrame(frameIndex);
1727 } 1727 }
1728 else 1728 else
1729 { 1729 {
1730 return NULL; 1730 return NULL;
1731 } 1731 }