Bug 94

Summary: a simple instance modification shall not modify FrameOfReferenceUID + ...
Product: Orthanc Reporter: Sébastien Jodogne <s.jodogne>
Component: Orthanc CoreAssignee: Sébastien Jodogne <s.jodogne>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: 5b155037-bc5c-42f6-a3a5-510bc60524e2.dcm

Description Sébastien Jodogne 2020-06-29 15:13:56 CEST
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-06-29.12:51:13]

perform a simple /instances/../modify request with this payload:
```
curl -X POST http://localhost:8042/instances/e294c1b9-64b50db6-4b600ea8-c41de8a4-b7767de5/modify -d '{"Replace" : {"PatientID" : "toto"}, "Force": true}' > modified.dcm
dcmdump modified.dcm | grep "FrameOfReference"

curl -X GET http://localhost:8042/instances/e294c1b9-64b50db6-4b600ea8-c41de8a4-b7767de5/file > original.dcm
dcmdump original.dcm | grep "FrameOfReference"

```

The FrameOfReferenceUID has changed in the modified instance.


Actually, the RelationshipsVisitor is applied and, since the FrameOfReferenceUID is not mentioned in any of the Keep, Remove and Replace, it is "Enabled" and therefore modified.

```
    bool IsEnabled(const DicomTag& tag) const
    {
      return (!that_.IsCleared(tag) &&
              !that_.IsRemoved(tag) &&
              !that_.IsReplaced(tag));
    }
```

When performing simple modification (that is not an Anonymization), we shall probably just not apply the RelationshipVisitor
Comment 1 Sébastien Jodogne 2020-06-29 15:18:10 CEST
Created attachment 75 [details]
5b155037-bc5c-42f6-a3a5-510bc60524e2.dcm
Comment 2 Sébastien Jodogne 2020-06-29 15:21:51 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2018-07-12.10:55:54]

fix issue #94

→ https://hg.orthanc-server.com/orthanc/changeset/062776ab4a21