Working with private tags

1,209 views
Skip to first unread message

Luiz Eduardo Guida Valmont

unread,
Jul 9, 2018, 5:10:02 PM7/9/18
to Orthanc Users
Hello, friends

In working in a polling/routing solution, I came accross the concept of private tags/dictionary and I thought it would be a good idea.

But is there a 100% Orthanc solution to go about tagging instances with custom private tags? Any pointers?

I believe a starting point is the OrthancPluginRegisterPrivateDictionaryTag function.


Then again, how do I actually tag an image in a plugin?

Thanks!

Alain Mazy

unread,
Jul 10, 2018, 1:58:11 AM7/10/18
to Luiz Eduardo Guida Valmont, Orthanc Users
When you're defining your own private dictionary, you actually simply define "aliases".
Your private tag name will be displayed in the .../tags output and you can use your tag name in other routes like /modify.

If you want to add a DICOM tag to an instance, the only thing you can do is to modify that instance by calling the rest API from the plugin (http://book.orthanc-server.com/users/anonymization.html?highlight=modify)
--

Alain Mazy / CTO 
a...@osimis.io / +32 494 31 67 27

Osimis

OSIMIS S.A. 
Rue bois Saint-Jean 15/1BE-4102 Seraing 
www.osimis.io

Twitter LinkedIn


Luiz Eduardo Guida Valmont

unread,
Jul 10, 2018, 2:29:17 PM7/10/18
to Orthanc Users
Hi Alain!

Thaks for your answer. I've got a couple of questions:

1. The use of the /modify URL as per the link you mentioined, does it mean the instance will be anonimized? Or can I use it to just change the value of a tag (be it private or otherwise)?
2. Though I could mess with Institution name, I want to create a new private/custom tag. For that I undnerstand I must use the OrthancPluginRegisterDictionaryTag function. Is that correct? If so, then how do I go about selecting a proper group/element id without clashing with other private tags that might exist already?
3. (2 complement) If not, can I just tag replacing for a non-existing tag and will it be inserted?

I read it now and it souds a little confusing to me. In case it really is, please let me know and I'll rewrite whatever needs to be rewritten.

Luiz

Sébastien Jodogne

unread,
Jul 25, 2018, 10:37:55 AM7/25/18
to Orthanc Users
Hello,

I am unsure to understand your needs.

The "DICOM private tags" are non-standardized tags that are embedded inside the DICOM files, and that are specific to one given manufacturer. I'm really not sure this is what you are looking for, as you are dealing with DICOM automation, which implies your workflow should not modify the DICOM files.

If you are trying to associate some user-defined value with some DICOM instance in the Orthanc database (without modifying the DICOM file itself), you are actually looking for "metadata". Please carefully review this section of the Orthanc Book:

In a plugin, you can tag a DICOM instance with some metadata using the REST API, through the "OrthancPluginRestApiPut()" function:

HTH,
Sébastien-

Luiz Eduardo Guida Valmont

unread,
Jul 25, 2018, 11:37:39 AM7/25/18
to Orthanc Users
Hi Sebastien!

I'd like to tag a DICOM instance because I'd like a certain information to be embedded in the file itself. Let me try and explain why.

Images will be routed back and forth. Eventually an OsiriX instance will feed the system a new series based on pre-existing instances. Because of this, the Origin of the image must be preserved.

This is why I'd like to tag the image. So the relevant information goes within it and, more importantly, is still within it when OsiriX sends back the exported new series.

Metadata is not enough because it stays within Orthanc while Osirix generates new SopInstanceUID's. This information must reach OsiriX so it preserves it when exporting.

I will also check with our customer if we can lock the study itself to any given hospital. This way we can register the study origin on a central server we're working on. Personally I believe this is suboptimal since it represents a single point of failure on a cluster'ish scenario. But I digress.

PS: I apoligize for the other thread. I felt it was a necro'ing and I didn't want to just "bump it".

Thanks!
Luiz

Sébastien Jodogne

unread,
Feb 26, 2020, 8:48:36 AM2/26/20
to Orthanc Users
Dear Luiz,

Since yesterday, it is possible to use the "/{patients|studies|series|instances}/{id}/modify" route of the REST API to inject private DICOM tags. This is a direct consequence of solving this issue:

You can find a working example in the "test_bitbucket_issue_140" integration test:

Note that for this process to work, private tags must be declared in the "Dictionary" configuration option of Orthanc. Here is the configuration that corresponds to the integration test above:

  {
    [...]
    "Dictionary" : {
      "4321,1012" : [ "LO", "RadioButton3", 1, 1, "RadioLogic" ]
    }
  }

Note the private creator that is set to "RadioLogic", which must also be provided to the ".../modify" route in the POST body through the new "PrivateCreator" argument.

HTH,
Sébastien-
Reply all
Reply to author
Forward
0 new messages