DicomWebPlugin does not return series metadata properly

Hi Author,

I have a dicom file (anonymized.dcm - Google Drive) , uploaded to Orthanc (running on docker jodogne/orthanc-python:1.12.3). When I retrieve series metadata via URL : http://localhost:8042/wado-rs/studies/1.2.410.200024.1.1.0.20240920.082608.1/series/1.2.410.200024.1.2.0.20240920.082608.2/metadata , the response does not contains tags : PixelSpacing (0028,0030), WindowCenter (0028,1051), WindowWidth (0028,1051) ā€¦ .

        "00280030": {
            "Value": [],
            "vr": "DS"
        },

Whilst DCM4CHEE can handle this case

        "00280030": {
            "vr": "DS",
            "Value": [
                "0,143",
                "0,143"
            ]
        },

Below is the verbosed log from Orthanc

I0925 02:41:06.393056             MAIN LuaScripting.cpp:861] Starting the Lua engine
I0925 02:41:49.625380           HTTP-0 HttpServer.cpp:1262] (http) GET /wado-rs/studies/1.2.410.200024.1.1.0.20240920.082608.1/series/1.2.410.200024.1.2.0.20240920.082608.2/metadata
I0925 02:41:49.625558           HTTP-0 OrthancPlugins.cpp:2475] (plugins) Delegating HTTP request to plugin for URI: /wado-rs/studies/1.2.410.200024.1.1.0.20240920.082608.1/series/1.2.410.200024.1.2.0.20240920.082608.2/metadata
I0925 02:41:49.625754           HTTP-0 OrthancPlugins.cpp:4058] (plugins) Plugin making REST POST call to URI /tools/find (after plugins)
I0925 02:41:49.636113           HTTP-0 ServerContext.cpp:1561] Number of candidate resources after fast DB filtering on main DICOM tags: 1
I0925 02:41:49.638267           HTTP-0 ServerContext.cpp:1709] Number of matching resources: 1
I0925 02:41:49.638337           HTTP-0 OrthancPlugins.cpp:3221] (plugins) Plugin making REST GET call on URI /series/c71a385f-50264889-a633d8bd-a2635ff8-89985509 (built-in API)
I0925 02:41:49.640924     7fb43e7c4700 OrthancPlugins.cpp:3221] (plugins) Plugin making REST GET call on URI /instances/1e7003b4-c185fb01-b40e76d9-8dd2a375-13c04294 (built-in API)
I0925 02:41:49.640943     7fb43efc5700 OrthancPlugins.cpp:3221] (plugins) Plugin making REST GET call on URI /instances/2bba593d-c11f5756-58dc45b2-661d603f-b672ef1e (built-in API)
I0925 02:41:49.645338     7fb43efc5700 FilesystemStorage.cpp:182] Reading attachment "1690750b-1dc2-44db-8a19-9e6043dabc6c" of "DICOM" content type (range from 0 to 1356)
I0925 02:41:49.645410     7fb43efc5700 FilesystemStorage.cpp:189] Read range of attachment "1690750b-1dc2-44db-8a19-9e6043dabc6c" (1.32KB in 54.00us = 200.89Mbps)
I0925 02:41:49.645779     7fb43e7c4700 FilesystemStorage.cpp:182] Reading attachment "18f1fbda-6270-4602-9792-710102eb428e" of "DICOM" content type (range from 0 to 1362)
I0925 02:41:49.645833     7fb43e7c4700 FilesystemStorage.cpp:189] Read range of attachment "18f1fbda-6270-4602-9792-710102eb428e" (1.33KB in 47.00us = 231.83Mbps)
W0925 02:41:49.646490     7fb43efc5700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0018,0060) with invalid content for VR DS: 70,
W0925 02:41:49.646538     7fb43efc5700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0018,115e) with invalid content for VR DS: 0,
W0925 02:41:49.646626     7fb43efc5700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,0030) with invalid content for VR DS: 0,143\0,143
W0925 02:41:49.646641     7fb43efc5700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,0030) with invalid content for VR DS: 0,143\0,143
W0925 02:41:49.646670     7fb43efc5700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,1050) with invalid content for VR DS: 29936,
W0925 02:41:49.646687     7fb43efc5700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,1051) with invalid content for VR DS: 59874,
W0925 02:41:49.646960     7fb43e7c4700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0018,0060) with invalid content for VR DS: 83,
W0925 02:41:49.647000     7fb43e7c4700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0018,115e) with invalid content for VR DS: 0,
W0925 02:41:49.647077     7fb43e7c4700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,0030) with invalid content for VR DS: 0,143\0,143
W0925 02:41:49.647092     7fb43e7c4700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,0030) with invalid content for VR DS: 0,143\0,143
W0925 02:41:49.647118     7fb43e7c4700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,1050) with invalid content for VR DS: 29010,
W0925 02:41:49.647135     7fb43e7c4700 DicomWebJsonVisitor.cpp:714] Ignoring DICOM tag (0028,1051) with invalid content for VR DS: 58021,

Seems like the function DicomWebJsonVisitor::VisitString in DicomWebJsonVisitor.cpp does not handle those values well.

Could you please help to investigate what is the problem ?
Thanks in advance

Hi Christophe,

One way to solve the issue is to contact the producer of the image and suggest him to review the DICOM standard ;-):

DS: A string of characters representing either a fixed point number or a floating point number. A fixed point number shall contain only the characters 0-9 with an optional leading ā€œ+ā€ or ā€œ-ā€ and an optional ā€œ.ā€ to mark the decimal point. A floating point number shall be conveyed as defined in ANSI X3.9, with an ā€œEā€ or ā€œeā€ to indicate the start of the exponent. Decimal Strings may be padded with leading or trailing spaces. Embedded spaces are not allowed.

This is confirmed by the output of dciodvfy:

Error - Value invalid for this VR - (0x0018,0x0060) DS KVP  DS [0] = <83,> - Character invalid for this VR = ',' (0x2c)
Error - Value invalid for this VR - (0x0018,0x115e) DS Image and Fluoroscopy Area Dose Product  DS [0] = <0,> - Character invalid for this VR = ',' (0x2c)
Error - Value invalid for this VR - (0x0028,0x0030) DS Pixel Spacing  DS [0] = <0,143> - Character invalid for this VR = ',' (0x2c)
Error - Value invalid for this VR - (0x0028,0x0030) DS Pixel Spacing  DS [1] = <0,143> - Character invalid for this VR = ',' (0x2c)
Error - Value invalid for this VR - (0x0028,0x1050) DS Window Center  DS [0] = <29010,> - Character invalid for this VR = ',' (0x2c)
Error - Value invalid for this VR - (0x0028,0x1051) DS Window Width  DS [0] = <58021,> - Character invalid for this VR = ',' (0x2c)

Another alternative is of course to make Orthanc resilient to these errors but why is it always the small open-source developer who has to adapt to the mistakes of others? :wink:

Best,

Alain.

Thank you @alainmazy, I understood. I will find other solutions to preprocess dicoms before pushing them into the storage.

BTW, if there really is a modality manufacturer that generates this kind of erroneous files, we can probably make Orthanc resilient to them instead of having many Orthanc users implement their own sanitization.

So I have upgraded Orthanc to get rid of trailing commas and replace commas by dots to make them valid decimal strings.

This should be available tomorrow in the mainline binaries.

1 Like