Orthanc value too long is null through the api

Hi,

We use the orthanc version 1.7.4 and recently we encountered an issue with the tag :
0020,4000 (ImageComments)
When we call the API the value of this tag is always null eventhough the dicom is filled with a value.

Do you have an idea why the api send back null for this field?
Do we have a solution to overcome this?

Thank you
Kind regards,
TE

Hello,

As you don’t provide a sample DICOM file, nor a command line for us to reproduce your issue, my answer will just be a rough guess:
https://book.orthanc-server.com/users/support.html#discussing-a-minimal-working-example

I assume that you are dealing with a DICOM instance whose “ImageComments” tag is longer than 250 characters. In such situations, Orthanc replaces the type of the tag as “TooLong” in order to avoid downloading too much data.

The “/instances/{id}/tags” provides the “ignore-length” argument in order to bypass this limitation.

You’ll see attached to this message a full Python script that creates a DICOM instance containing a long Lorem Ipsum text in its “ImageComments”, and that demonstrates how to use the “http://localhost:8042/instances/{id}/tags?ignore-length=ImageComments” route.

HTH,
Sébastien-

lorem-ipsum.py (2.61 KB)

Hi Sébastien,

Thank you for your answer and sorry for the lack of details.
Indeed it works with the query parameter ignore-length on the get request that you provided us.
However, we are using the callback function OnStoredInstance(instanceId, tags, metadata, origin) in order to send the dicom inserted in our app.
Before sending the dicom inserted via http post request, we print the json representation of the dicom and we can see that the imageComments is missing due to the TooLong type.
Is there a way to post with all the tags without missing tags due to the TooLong type conversion?

Kind regards,
TE

Hello,

Lua scripts are not expressive enough to this end. You’ll have to use Python plugins:
https://book.orthanc-server.com/plugins/python.html

A full example of Python plugin is attached to this message.

Note that you could do the same with C/C++ plugins:
https://book.orthanc-server.com/developers/creating-plugins.html

Sébastien-

lorem-ipsum-plugin.py (2.63 KB)

Hi Sébastien,

Thank you for your help.

Kind regards,
TE