Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerContext.cpp @ 5039:28db9663fc2d
DicomSequencesMap + fix unit tests
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 27 Jun 2022 10:48:46 +0200 |
parents | 877bc3b96476 |
children | 1c08cd68250a |
comparison
equal
deleted
inserted
replaced
5038:f8bea9c1c0fc | 5039:28db9663fc2d |
---|---|
529 dicom.GetSummary(summary); // -> this includes only the leaf nodes | 529 dicom.GetSummary(summary); // -> this includes only the leaf nodes |
530 | 530 |
531 std::set<DicomTag> allMainDicomTags = DicomMap::GetAllMainDicomTags(); | 531 std::set<DicomTag> allMainDicomTags = DicomMap::GetAllMainDicomTags(); |
532 std::set<DicomTag> mainDicomSequences; | 532 std::set<DicomTag> mainDicomSequences; |
533 DicomMap::ExtractSequences(mainDicomSequences, allMainDicomTags); | 533 DicomMap::ExtractSequences(mainDicomSequences, allMainDicomTags); |
534 std::map<DicomTag, Json::Value> sequencesToStore; | 534 DicomSequencesMap sequencesToStore; |
535 | 535 |
536 try | 536 try |
537 { | 537 { |
538 MetricsRegistry::Timer timer(GetMetricsRegistry(), "orthanc_store_dicom_duration_ms"); | 538 MetricsRegistry::Timer timer(GetMetricsRegistry(), "orthanc_store_dicom_duration_ms"); |
539 StorageAccessor accessor(area_, storageCache_, GetMetricsRegistry()); | 539 StorageAccessor accessor(area_, storageCache_, GetMetricsRegistry()); |
542 resultPublicId = hasher.HashInstance(); | 542 resultPublicId = hasher.HashInstance(); |
543 | 543 |
544 Json::Value dicomAsJson; // -> this includes the sequences | 544 Json::Value dicomAsJson; // -> this includes the sequences |
545 | 545 |
546 dicom.GetDicomAsJson(dicomAsJson, mainDicomSequences /*ignoreTagLength*/); // make sure that sequences that we wish to store in DB are not 'cropped' | 546 dicom.GetDicomAsJson(dicomAsJson, mainDicomSequences /*ignoreTagLength*/); // make sure that sequences that we wish to store in DB are not 'cropped' |
547 | 547 sequencesToStore.FromDicomAsJson(dicomAsJson, mainDicomSequences); |
548 for (std::set<DicomTag>::const_iterator it = mainDicomSequences.begin(); | |
549 it != mainDicomSequences.end(); ++it) | |
550 { | |
551 if (dicomAsJson.isMember(it->Format())) | |
552 { | |
553 sequencesToStore[*it] = dicomAsJson[it->Format()]; | |
554 } | |
555 } | |
556 | 548 |
557 Json::Value simplifiedTags; | 549 Json::Value simplifiedTags; |
558 Toolbox::SimplifyDicomAsJson(simplifiedTags, dicomAsJson, DicomToJsonFormat_Human); | 550 Toolbox::SimplifyDicomAsJson(simplifiedTags, dicomAsJson, DicomToJsonFormat_Human); |
559 | 551 |
560 // Test if the instance must be filtered out | 552 // Test if the instance must be filtered out |