Mercurial > hg > orthanc
changeset 3861:eb8280b30031 transcoding
integration mainline->transcoding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 27 Apr 2020 15:56:20 +0200 |
parents | 67f988f42cef (current diff) 9ccbbd55bc23 (diff) |
children | 594263db316a |
files | |
diffstat | 3 files changed, 25 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/DicomParsing/DicomModification.cpp Tue Apr 21 16:33:59 2020 +0200 +++ b/Core/DicomParsing/DicomModification.cpp Mon Apr 27 15:56:20 2020 +0200 @@ -358,6 +358,7 @@ allowManualIdentifiers_(true), keepStudyInstanceUid_(false), keepSeriesInstanceUid_(false), + keepSopInstanceUid_(false), updateReferencedRelationships_(true), isAnonymization_(false), //privateCreator_("PrivateCreator"), @@ -388,6 +389,10 @@ { keepSeriesInstanceUid_ = true; } + else if (tag == DICOM_TAG_SOP_INSTANCE_UID) + { + keepSopInstanceUid_ = true; + } else if (tag.IsPrivate()) { privateTagsToKeep_.insert(tag); @@ -1103,7 +1108,14 @@ if (level_ <= ResourceType_Instance && // Always true !IsReplaced(DICOM_TAG_SOP_INSTANCE_UID)) { - MapDicomTags(toModify, ResourceType_Instance); + if (keepSopInstanceUid_) + { + LOG(WARNING) << "Modifying an instance while keeping its original SOPInstanceUID: This should be avoided!"; + } + else + { + MapDicomTags(toModify, ResourceType_Instance); + } } // (7) Update the "referenced" relationships in the case of an anonymization @@ -1341,6 +1353,7 @@ static const char* ALLOW_MANUAL_IDENTIFIERS = "AllowManualIdentifiers"; static const char* KEEP_STUDY_INSTANCE_UID = "KeepStudyInstanceUID"; static const char* KEEP_SERIES_INSTANCE_UID = "KeepSeriesInstanceUID"; + static const char* KEEP_SOP_INSTANCE_UID = "KeepSOPInstanceUID"; static const char* UPDATE_REFERENCED_RELATIONSHIPS = "UpdateReferencedRelationships"; static const char* IS_ANONYMIZATION = "IsAnonymization"; static const char* REMOVALS = "Removals"; @@ -1367,6 +1380,7 @@ value[ALLOW_MANUAL_IDENTIFIERS] = allowManualIdentifiers_; value[KEEP_STUDY_INSTANCE_UID] = keepStudyInstanceUid_; value[KEEP_SERIES_INSTANCE_UID] = keepSeriesInstanceUid_; + value[KEEP_SOP_INSTANCE_UID] = keepSopInstanceUid_; value[UPDATE_REFERENCED_RELATIONSHIPS] = updateReferencedRelationships_; value[IS_ANONYMIZATION] = isAnonymization_; value[PRIVATE_CREATOR] = privateCreator_; @@ -1464,6 +1478,7 @@ allowManualIdentifiers_ = SerializationToolbox::ReadBoolean(serialized, ALLOW_MANUAL_IDENTIFIERS); keepStudyInstanceUid_ = SerializationToolbox::ReadBoolean(serialized, KEEP_STUDY_INSTANCE_UID); keepSeriesInstanceUid_ = SerializationToolbox::ReadBoolean(serialized, KEEP_SERIES_INSTANCE_UID); + keepSopInstanceUid_ = SerializationToolbox::ReadBoolean(serialized, KEEP_SOP_INSTANCE_UID); updateReferencedRelationships_ = SerializationToolbox::ReadBoolean (serialized, UPDATE_REFERENCED_RELATIONSHIPS); isAnonymization_ = SerializationToolbox::ReadBoolean(serialized, IS_ANONYMIZATION);
--- a/Core/DicomParsing/DicomModification.h Tue Apr 21 16:33:59 2020 +0200 +++ b/Core/DicomParsing/DicomModification.h Mon Apr 27 15:56:20 2020 +0200 @@ -83,6 +83,7 @@ bool allowManualIdentifiers_; bool keepStudyInstanceUid_; bool keepSeriesInstanceUid_; + bool keepSopInstanceUid_; bool updateReferencedRelationships_; bool isAnonymization_; DicomMap currentSource_;
--- a/NEWS Tue Apr 21 16:33:59 2020 +0200 +++ b/NEWS Mon Apr 27 15:56:20 2020 +0200 @@ -1,6 +1,14 @@ Pending changes in the mainline =============================== +REST API +-------- + +* Improved: + - "/instances/../modify": it is now possible to "Keep" the "SOPInstanceUID". + Note that it was already possible to "Replace" it. + + Version 1.6.1 (2020-04-21) ==========================