Modification of DICOM tags without changing UUID.

Hi all,

When I use rest api to modify dicom tags (/modify), orthanc gives me a new modified copy of the file.
Therefore the UUID’s change, which means WADO links too.
I have to send the WADO links to a remote entity.
So when operators make errors, I update the tags but the link already sent becomes invalid.
I can not update the WADO link sent.
In my use case, I have to modify the tags in the original dicom file. Is that possible?

Thanks in advance for your interest.

You should never have the same value of the “SOP Instance UID” tag (0x0008,0x0018) in two DICOM files that encode a different information. This would break medical traceability.

If you really know what you are doing, you can use the “Force” option when modifying one single DICOM instance:

For example:

curl http://localhost:8042/instances/5eb2dd5f-3fca21a8-fa7565fd-63e112ae-344830a4/modify -d ‘{“Replace”:{“PatientName”:“HELLO”,“SOPInstanceUID”:“”},“Force”:true}’ > modified.dcm

Setting the “OverwriteInstances” configuration option of Orthanc to “true” will allow you to re-upload this modified file into Orthanc, replacing the previous one:


Dear Sébastien,

What I want to do is :
Correction of user input mistakes in DICOM data at Patient or Study levels without changing Patient/ Study / Series / SOPInstance UID’s

What /modify does:
At Patient level it generates a COPY of each instance belonging to Patient, modify it (Studies/Series/Instance) while assigning new UID’s at every level.

At Study level it generates a COPY of each instance belonging to Study, modify it (Series/Instance) while assigning new UID’s at every level.

What I want:
At Patient level, modify each instance IN PLACE belonging to Patient (Studies/Series/Instances) WITHOUT assigning new UID’s.
At Study level, modify each instance IN PLACE belonging to Study (Series/instances) WITHOUT assigning new UID’s.

The workarounds I’ve found could be described only with the word : Pathetic :D;
IF At Patient level get All Patient data out of orthanc and delete originals.
IF At Study level get All Study data out of orthanc and delete originals.
Modify with a DCMTK tool .
Send back to orthanc.
This is a killer time consumer.

I have the very same problem here: i want to add a private DICOM Tag to each instance after it has been stored by Orthanc.

The only solution i have found so far is the mentioned “modify >> delete original >> create new instance with old UID”-way.

A simple way to modify (or add) tags of an existing Instance/Series/Study would be much appreciated! :slight_smile:


This feature can readily be added to Orthanc by implementing a third-party plugin:

This plugin would:

Always remember that Orthanc is free and open-source project, and that you should give back to it:


I have tried implementing this plugin as you describe below. I believe I have sucessfully completed these steps as evidenced by the fact I can see all of the instances for the patient now have the new PatientName in the DICOM tag 0010, 0010. However the Orthanc explorer still displays the old name. I have confirmed this is the case by using sqlite browser to manually edit the MainDicomTag table for the appropriate resource of the patient. But I don’t see how I can do this operation from my plugin that I have written.

And the documentation for the existing modify operation says you simply cannot edit the name without editing PatientID (which I don’t want to do).

Any suggestions?

Once a patient/study/series is created in Orthanc, an excerpt of its so-called “main DICOM tags” is extracted and stored into the database (SQLite/PostgreSQL/MySQL). This is this set of tags that is displayed by Orthanc Explorer.

To ensure consistency and performance, this information is never automatically changed, as long as the patient/study/series is not deleted.

You can ask Orthanc to refresh its index by calling the “/{patients|studies|series|instances}/…/reconstruct” route in the REST API (it is a POST without a body).

For instance, in your case, after modifying some instance with Orthanc identifier “{id}” and uploading it back, you could POST to “/instances/{id}/reconstruct” in order to update the main DICOM tags.


Aha!! Now I have success. Thanks very much.



Would you be willing to share this plugin? I’m also very interested in being able to do in-place modification of DICOM tags!


Hi, I’m also very interested in in-place modification of dicom tags of an instance. It would be great if Stacy can share it.

On the other hand , Is there any tutorial to start a plugin in python or c++?