# HG changeset patch # User Sebastien Jodogne # Date 1531392948 -7200 # Node ID 062776ab4a218c86e350079b0b2a2697cb42c79c # Parent db0f33b2aeebca339f89e71ce118652b9abef07d fix issue #94 diff -r db0f33b2aeeb -r 062776ab4a21 Core/DicomParsing/DicomModification.cpp --- a/Core/DicomParsing/DicomModification.cpp Thu Jul 12 11:34:45 2018 +0200 +++ b/Core/DicomParsing/DicomModification.cpp Thu Jul 12 12:55:48 2018 +0200 @@ -316,6 +316,7 @@ keepStudyInstanceUid_(false), keepSeriesInstanceUid_(false), updateReferencedRelationships_(true), + isAnonymization_(false), identifierGenerator_(NULL) { } @@ -820,6 +821,8 @@ void DicomModification::SetupAnonymization(DicomVersion version) { + isAnonymization_ = true; + removals_.clear(); clearings_.clear(); ClearReplacements(); @@ -1030,7 +1033,8 @@ MapDicomTags(toModify, ResourceType_Instance); } - // (6) Update the "referenced" relationships + // (6) Update the "referenced" relationships in the case of an anonymization + if (isAnonymization_) { RelationshipsVisitor visitor(*this); @@ -1248,6 +1252,7 @@ static const char* KEEP_STUDY_INSTANCE_UID = "KeepStudyInstanceUID"; static const char* KEEP_SERIES_INSTANCE_UID = "KeepSeriesInstanceUID"; static const char* UPDATE_REFERENCED_RELATIONSHIPS = "UpdateReferencedRelationships"; + static const char* IS_ANONYMIZATION = "IsAnonymization"; static const char* REMOVALS = "Removals"; static const char* CLEARINGS = "Clearings"; static const char* PRIVATE_TAGS_TO_KEEP = "PrivateTagsToKeep"; @@ -1272,6 +1277,7 @@ value[KEEP_STUDY_INSTANCE_UID] = keepStudyInstanceUid_; value[KEEP_SERIES_INSTANCE_UID] = keepSeriesInstanceUid_; value[UPDATE_REFERENCED_RELATIONSHIPS] = updateReferencedRelationships_; + value[IS_ANONYMIZATION] = isAnonymization_; SerializationToolbox::WriteSetOfTags(value, removals_, REMOVALS); SerializationToolbox::WriteSetOfTags(value, clearings_, CLEARINGS); @@ -1368,6 +1374,7 @@ keepSeriesInstanceUid_ = SerializationToolbox::ReadBoolean(serialized, KEEP_SERIES_INSTANCE_UID); updateReferencedRelationships_ = SerializationToolbox::ReadBoolean (serialized, UPDATE_REFERENCED_RELATIONSHIPS); + isAnonymization_ = SerializationToolbox::ReadBoolean(serialized, IS_ANONYMIZATION); SerializationToolbox::ReadSetOfTags(removals_, serialized, REMOVALS); SerializationToolbox::ReadSetOfTags(clearings_, serialized, CLEARINGS); diff -r db0f33b2aeeb -r 062776ab4a21 Core/DicomParsing/DicomModification.h --- a/Core/DicomParsing/DicomModification.h Thu Jul 12 11:34:45 2018 +0200 +++ b/Core/DicomParsing/DicomModification.h Thu Jul 12 12:55:48 2018 +0200 @@ -84,6 +84,7 @@ bool keepStudyInstanceUid_; bool keepSeriesInstanceUid_; bool updateReferencedRelationships_; + bool isAnonymization_; DicomMap currentSource_; IDicomIdentifierGenerator* identifierGenerator_; diff -r db0f33b2aeeb -r 062776ab4a21 NEWS --- a/NEWS Thu Jul 12 11:34:45 2018 +0200 +++ b/NEWS Thu Jul 12 12:55:48 2018 +0200 @@ -47,6 +47,7 @@ * Fix generation of DICOMDIR if PatientID is empty * Fix issue 25 (Deadlock with Lua scripts): The event queue is now implemented for Lua +* Fix issue 94 (Instance modification should not modify FrameOfReferenceUID) * Configuration option "LogExportedResources" is now "false" by default * Header "OrthancCppDatabasePlugin.h" is now part of the "orthanc-databases" project * Upgraded dependencies for static and Windows builds: