comparison OrthancFramework/Sources/DicomParsing/DicomModification.cpp @ 4273:0034f855c023

tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Nov 2020 12:24:50 +0100
parents 0ae2ca210077
children 785a2713323e
comparison
equal deleted inserted replaced
4272:1661544ea94d 4273:0034f855c023
326 default: 326 default:
327 throw OrthancException(ErrorCode_InternalError); 327 throw OrthancException(ErrorCode_InternalError);
328 } 328 }
329 329
330 std::string original; 330 std::string original;
331 if (!dicom.GetTagValue(original, *tag)) 331 if (!const_cast<const ParsedDicomFile&>(dicom).GetTagValue(original, *tag))
332 { 332 {
333 original = ""; 333 original = "";
334 } 334 }
335 335
336 std::string mapped = MapDicomIdentifier(Toolbox::StripSpaces(original), level); 336 std::string mapped = MapDicomIdentifier(Toolbox::StripSpaces(original), level);
1015 { 1015 {
1016 if (IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID)) 1016 if (IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
1017 { 1017 {
1018 std::string original; 1018 std::string original;
1019 std::string replacement = GetReplacementAsString(DICOM_TAG_STUDY_INSTANCE_UID); 1019 std::string replacement = GetReplacementAsString(DICOM_TAG_STUDY_INSTANCE_UID);
1020 toModify.GetTagValue(original, DICOM_TAG_STUDY_INSTANCE_UID); 1020 const_cast<const ParsedDicomFile&>(toModify).GetTagValue(original, DICOM_TAG_STUDY_INSTANCE_UID);
1021 RegisterMappedDicomIdentifier(original, replacement, ResourceType_Study); 1021 RegisterMappedDicomIdentifier(original, replacement, ResourceType_Study);
1022 } 1022 }
1023 1023
1024 if (IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID)) 1024 if (IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
1025 { 1025 {
1026 std::string original; 1026 std::string original;
1027 std::string replacement = GetReplacementAsString(DICOM_TAG_SERIES_INSTANCE_UID); 1027 std::string replacement = GetReplacementAsString(DICOM_TAG_SERIES_INSTANCE_UID);
1028 toModify.GetTagValue(original, DICOM_TAG_SERIES_INSTANCE_UID); 1028 const_cast<const ParsedDicomFile&>(toModify).GetTagValue(original, DICOM_TAG_SERIES_INSTANCE_UID);
1029 RegisterMappedDicomIdentifier(original, replacement, ResourceType_Series); 1029 RegisterMappedDicomIdentifier(original, replacement, ResourceType_Series);
1030 } 1030 }
1031 1031
1032 if (IsReplaced(DICOM_TAG_SOP_INSTANCE_UID)) 1032 if (IsReplaced(DICOM_TAG_SOP_INSTANCE_UID))
1033 { 1033 {
1034 std::string original; 1034 std::string original;
1035 std::string replacement = GetReplacementAsString(DICOM_TAG_SOP_INSTANCE_UID); 1035 std::string replacement = GetReplacementAsString(DICOM_TAG_SOP_INSTANCE_UID);
1036 toModify.GetTagValue(original, DICOM_TAG_SOP_INSTANCE_UID); 1036 const_cast<const ParsedDicomFile&>(toModify).GetTagValue(original, DICOM_TAG_SOP_INSTANCE_UID);
1037 RegisterMappedDicomIdentifier(original, replacement, ResourceType_Instance); 1037 RegisterMappedDicomIdentifier(original, replacement, ResourceType_Instance);
1038 } 1038 }
1039 } 1039 }
1040 1040
1041 1041
1112 { 1112 {
1113 RelationshipsVisitor visitor(*this); 1113 RelationshipsVisitor visitor(*this);
1114 1114
1115 if (updateReferencedRelationships_) 1115 if (updateReferencedRelationships_)
1116 { 1116 {
1117 toModify.Apply(visitor); 1117 const_cast<const ParsedDicomFile&>(toModify).Apply(visitor);
1118 } 1118 }
1119 else 1119 else
1120 { 1120 {
1121 visitor.RemoveRelationships(toModify); 1121 visitor.RemoveRelationships(toModify);
1122 } 1122 }