modify tags

hi,
How do I change the tags of the studies, since I have tried to do it and every time I try it duplicates the study. my code

curl http://localhost:8042/studies/9b92c6-.../modify -X POST -d ‘{“Replace”:{“institutionName”:“my new institution”}}’

Hi Fredy,

This is a convention in Orthanc to generate a new Patient/Study/Series/Instance when you modify it (I think it’s also a convention in the DICOM world).

You can specify ‘Keep’ tags in the /modify route so you could keep the StudyInstanceUID when you modify your study but that will still generate new SeriesInstanceUID so you’ll still have some duplicates.

So the most versatile way to make modifications is achieved by working at the instance level, you then get as a response the modified instance and re-upload it to Orthanc to overwrite the previous one (as long as you’ve configured “OverwriteInstances”: true in your config.

FYI, here’s a sample docker setup that sanitizes images between a modality and a PACS:
https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/sanitize-middleman-python/

HTH

Alain.

I have configured overwrite true and change for instances, and my code is curl http://localhost:8042/instances/9b92c6-…/modify -X POST -d ‘{“Replace”:{“institutionName”:“my new institution”}}’ , but it throws me the following error… warning: binary output can mess up your terminal warning: curl to output it your terminal anyway

This is a curl warning; please google it before asking this user group.

The output of this curl command is a dicom file therefore you need to save it to disk (and re-upload the file to Orthanc).

Hello,

There is an option “KeepSource” that allows you to remove the original study if set to “false”. For instance:

$ curl http://localhost:8042/studies/66c8e41e-ac3a9029-0b85e42a-8195ee0a-92c2e62e/modify -X POST -d ‘{“Replace”:{“InstitutionName”:“my new institution”},“KeepSource”:false}’

This option was undocumented in the OpenAPI specification of Orthanc 1.9.6, but this has just been fixed by the following changeset:
https://hg.orthanc-server.com/orthanc-book/rev/11ca20599c75

The updated version of the OpenAPI documentation can be found here:

https://api.orthanc-server.com/

HTH,
Sébastien-