Mercurial > hg > orthanc
changeset 3867:7a7d18875985 c-get
integration mainline->c-get
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 27 Apr 2020 18:36:19 +0200 |
parents | d30bce4bdae9 (current diff) ff0718a4633a (diff) |
children | dba48c162b7b |
files | OrthancServer/main.cpp |
diffstat | 4 files changed, 27 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/DicomParsing/DicomModification.cpp Tue Apr 21 16:39:52 2020 +0200 +++ b/Core/DicomParsing/DicomModification.cpp Mon Apr 27 18:36:19 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:39:52 2020 +0200 +++ b/Core/DicomParsing/DicomModification.h Mon Apr 27 18:36:19 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:39:52 2020 +0200 +++ b/NEWS Mon Apr 27 18:36:19 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) ==========================
--- a/OrthancServer/main.cpp Tue Apr 21 16:39:52 2020 +0200 +++ b/OrthancServer/main.cpp Mon Apr 27 18:36:19 2020 +0200 @@ -38,6 +38,7 @@ #include "../Core/Compatibility.h" #include "../Core/DicomFormat/DicomArray.h" +#include "../Core/DicomNetworking/DicomAssociationParameters.h" #include "../Core/DicomNetworking/DicomServer.h" #include "../Core/DicomParsing/FromDcmtkBridge.h" #include "../Core/HttpServer/EmbeddedResourceHttpHandler.h" @@ -1304,6 +1305,7 @@ HttpClient::SetDefaultProxy(lock.GetConfiguration().GetStringParameter("HttpProxy", "")); DicomUserConnection::SetDefaultTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScuTimeout", 10)); + DicomAssociationParameters::SetDefaultTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScuTimeout", 10)); maxCompletedJobs = lock.GetConfiguration().GetUnsignedIntegerParameter("JobsHistorySize", 10);