Mercurial > hg > orthanc
diff Core/DicomParsing/DicomModification.cpp @ 2721:062776ab4a21 jobs
fix issue #94
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Jul 2018 12:55:48 +0200 |
parents | 2540ac79ab6c |
children | 99863d6245b2 |
line wrap: on
line diff
--- 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);