Query/Retrieve

Hi,

I run Orthanc 1.0.0 on a Linux computer at a hospital, and I am unable to do a query. I have configured the DicomModalities for the five MR scanners I want to query as follows:

“DicomModalities” : {

“nmr6”: [“K2D8SMR006”, “10.142.52.139”, 4006],
“nmr7”: [“K2D8SMR007”, “10.142.52.141”, 4006],
“nmr8”: [“K2D8SMR008”, “10.142.52.143”, 4006],
“nmr9”: [“K2D8SMR009”, “10.142.52.145”, 4006],
“nmr10”: [“K2D8SMR010”, “10.142.52.147”, 4006]

}

Orthanc Explorer correctly displays all five systems, and pressing “Test Echo” results in the message “The C-Echo has succeeded!”. However, all searches results in an empty list. I’ve also tried the following:

Sending DICOMs from the scanners to Orthanc - Success
Querying using findscu (findscu -v -S -aet myaet -aec AE8 nmr8 4006 -k QueryRetrieveLevel=STUDY -k StudyDate -k StudyDescription -k StudyInstanceUID) - Success
Inspecting the log (http://book.orthanc-server.com/faq/log.html#log) - Gave me this: "DicomUserConnection.cpp:853] Opening a DICOM SCU connection from AET “myaet” to AET “AE8” on host 10.142.52.143:4006 (manufacturer: Generic)
Followed all suggestions in the troubleshooting, including the various settings (http://book.orthanc-server.com/faq/dicom.html) - Still not working

Any help on this would be greatly appreciated.

Henric

I erronously wrote the wrong findscu command above. The aec was K2D8SMR008.

Hello,

Please provide the full Orthanc log, in “–verbose” mode. Please also provide the full log of “findscu”.

You should also check the logs of your remote DICOM modalities.

Make sure that the AET of your Orthanc server is set to the same value as the “findscu” command.

Finally, upgrade to Orthanc 1.3.2.

HTH,
Sébastien-

Thank you for your quick reply. I’ve upgraded to Orthanc 1.3.2. Here’s the full verbose log:

W0528 10:09:50.943141 main.cpp:1298] Orthanc version: 1.3.2
W0528 10:09:50.945754 OrthancInitialization.cpp:168] Scanning folder “/etc/orthanc/” for configuration files
W0528 10:09:50.945861 OrthancInitialization.cpp:120] Reading the configuration from: “/etc/orthanc/orthanc.json”
W0528 10:09:50.946774 OrthancInitialization.cpp:120] Reading the configuration from: “/etc/orthanc/serve-folders.json”
W0528 10:09:50.947090 OrthancInitialization.cpp:120] Reading the configuration from: “/etc/orthanc/worklists.json”
I0528 10:09:50.947459 Toolbox.cpp:1363] Using locale: “en_US.UTF-8” for case-insensitive comparison of strings
I0528 10:09:50.947778 Enumerations.cpp:1819] Default encoding for DICOM was changed to: Latin1
I0528 10:09:50.948089 FromDcmtkBridge.cpp:206] Using DCTMK version: 362
I0528 10:09:50.948212 FromDcmtkBridge.cpp:214] Loading the embedded dictionaries
I0528 10:09:50.979319 FromDcmtkBridge.cpp:226] Loading the embedded dictionary of private tags
I0528 10:09:50.992370 FromDcmtkBridge.cpp:2091] Registering JPEG Lossless codecs in DCMTK
I0528 10:09:50.992399 FromDcmtkBridge.cpp:2096] Registering JPEG codecs in DCMTK
W0528 10:09:51.002349 main.cpp:671] Loading plugin(s) from: /usr/share/orthanc/plugins/
I0528 10:09:51.002390 PluginsManager.cpp:288] Scanning folder /usr/share/orthanc/plugins/ for plugins
W0528 10:09:51.002449 main.cpp:671] Loading plugin(s) from: /home/henric/Downloads/OrthancWebViewer-2.3/build/libOrthancWebViewer.so
W0528 10:09:51.020836 PluginsManager.cpp:269] Registering plugin ‘web-viewer’ (version 2.3)
W0528 10:09:51.020873 PluginsManager.cpp:168] Initializing the Web viewer
W0528 10:09:51.021147 PluginsManager.cpp:168] Web viewer using 10 threads for the decoding of the DICOM images
W0528 10:09:51.021165 PluginsManager.cpp:168] Storing the cache of the Web viewer in folder: /var/lib/orthanc/db-v6/WebViewerCache
W0528 10:09:51.022448 PluginsManager.cpp:168] The version of Orthanc has changed from “1.0.0” to “1.3.2”: The cache of the Web viewer will be cleared
W0528 10:09:51.022484 PluginsManager.cpp:168] Clearing the cache of the Web viewer
W0528 10:09:51.051742 PluginsManager.cpp:168] Web viewer using a cache of 100 MB
W0528 10:09:51.051767 PluginsManager.cpp:168] Using GDCM instead of the DICOM decoder that is built in Orthanc
I0528 10:09:51.051779 OrthancPlugins.cpp:1111] Plugin has registered a callback to decode DICOM images (1 decoder(s) now active)
I0528 10:09:51.051798 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/series/(.)
I0528 10:09:51.051854 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/is-stable-series/(.
)
I0528 10:09:51.051877 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/instances/(.)
I0528 10:09:51.051897 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/libs/(.
)
I0528 10:09:51.051919 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/app/(.*)
I0528 10:09:51.051939 OrthancPlugins.cpp:1038] Plugin has registered an OnChange callback
W0528 10:09:51.051965 OrthancInitialization.cpp:1004] SQLite index directory: “/var/lib/orthanc/db-v6”
W0528 10:09:51.052185 OrthancInitialization.cpp:1074] Storage directory: “/var/lib/orthanc/db-v6”
I0528 10:09:51.052706 DatabaseWrapper.cpp:307] Version of the Orthanc database: 6
W0528 10:09:51.052736 HttpClient.cpp:691] HTTPS will use the CA certificates from this file: /etc/orthanc/
I0528 10:09:51.052752 HttpClient.cpp:157] Setting the default timeout for HTTP client connections: 10 seconds
I0528 10:09:51.052770 HttpClient.cpp:141] Setting the default proxy for HTTP client connections:
I0528 10:09:51.052782 DicomUserConnection.cpp:1216] Default timeout for DICOM connections if Orthanc acts as SCU (client): 10 seconds (0 = no timeout)
I0528 10:09:51.055736 ServerIndex.cpp:1888] Starting the monitor for stable resources (stable age = 60)
W0528 10:09:51.056017 ServerScheduler.cpp:135] The server scheduler has started
I0528 10:09:51.056077 ServerIndex.cpp:365] Starting the database flushing thread (sleep = 10)
W0528 10:09:51.056355 LuaContext.cpp:103] Lua says: Lua toolbox installed
W0528 10:09:51.056411 ServerContext.cpp:182] Disk compression is disabled
I0528 10:09:51.056424 ServerContext.cpp:530] Storing MD5 for attachments: yes
W0528 10:09:51.056436 ServerIndex.cpp:1403] No limit on the number of stored patients
W0528 10:09:51.056457 ServerIndex.cpp:1420] No limit on the size of the storage area
I0528 10:09:51.056749 DicomServer.cpp:125] Setting timeout for DICOM connections if Orthanc acts as SCP (server): 30 seconds (0 = no timeout)
W0528 10:09:51.056770 DicomServer.cpp:168] For best interoperability, only upper case, alphanumeric characters should be present in AET: “henric”
W0528 10:09:51.056965 main.cpp:863] DICOM server listening with AET henric on port: 4006
I0528 10:09:51.057013 MongooseServer.cpp:1049] HTTP keep alive is disabled
W0528 10:09:51.057029 MongooseServer.cpp:1075] HTTP compression is enabled
I0528 10:09:51.057027 DicomServer.cpp:62] DICOM server started
I0528 10:09:51.057080 MongooseServer.cpp:948] Starting embedded Web server using Mongoose
W0528 10:09:51.060887 main.cpp:796] HTTP server listening on port: 8042
W0528 10:09:51.060913 main.cpp:683] Orthanc has started
I0528 10:09:59.341786 MongooseServer.cpp:755] GET /app/explorer.html
I0528 10:09:59.366019 MongooseServer.cpp:755] GET /app/libs/jquery.mobile.min.css
I0528 10:09:59.366089 MongooseServer.cpp:755] GET /app/libs/jqtree.css
I0528 10:09:59.368033 MongooseServer.cpp:755] GET /app/libs/jquery.mobile.simpledialog.min.css
I0528 10:09:59.368153 MongooseServer.cpp:755] GET /app/libs/jquery-file-upload/css/style.css
I0528 10:09:59.368323 MongooseServer.cpp:755] GET /app/libs/jquery-file-upload/css/jquery.fileupload-ui.css
I0528 10:09:59.371944 MongooseServer.cpp:755] GET /app/libs/slimbox2/slimbox2.css
I0528 10:09:59.374649 MongooseServer.cpp:755] GET /app/libs/jquery.min.js
I0528 10:09:59.376206 MongooseServer.cpp:755] GET /app/libs/jquery.mobile.min.js
I0528 10:09:59.376351 MongooseServer.cpp:755] GET /app/libs/jqm.page.params.js
I0528 10:09:59.376451 MongooseServer.cpp:755] GET /app/libs/tree.jquery.js
I0528 10:09:59.376763 MongooseServer.cpp:755] GET /app/libs/date.js
I0528 10:09:59.379251 MongooseServer.cpp:755] GET /app/explorer.css
I0528 10:09:59.379380 MongooseServer.cpp:755] GET /app/libs/jquery.mobile.simpledialog2.js
I0528 10:09:59.383240 MongooseServer.cpp:755] GET /app/libs/slimbox2.js
I0528 10:09:59.383344 MongooseServer.cpp:755] GET /app/libs/jquery.blockui.js
I0528 10:09:59.383463 MongooseServer.cpp:755] GET /app/libs/jquery-file-upload/js/vendor/jquery.ui.widget.js
I0528 10:09:59.387449 MongooseServer.cpp:755] GET /app/libs/jquery-file-upload/js/jquery.iframe-transport.js
I0528 10:09:59.387545 MongooseServer.cpp:755] GET /app/libs/jquery-file-upload/js/jquery.fileupload.js
I0528 10:09:59.387623 MongooseServer.cpp:755] GET /app/file-upload.js
I0528 10:09:59.392158 MongooseServer.cpp:755] GET /app/explorer.js
I0528 10:09:59.392209 MongooseServer.cpp:755] GET /app/query-retrieve.js
I0528 10:09:59.392292 MongooseServer.cpp:755] GET /plugins/explorer.js
I0528 10:09:59.402525 MongooseServer.cpp:755] GET /app/libs/images/ajax-loader.gif
I0528 10:09:59.467608 MongooseServer.cpp:755] GET /system
I0528 10:09:59.471903 MongooseServer.cpp:755] GET /patients
I0528 10:09:59.490451 MongooseServer.cpp:755] GET /app/libs/images/icons-18-white.png
I0528 10:10:01.687433 MongooseServer.cpp:755] GET /system
I0528 10:10:01.697698 MongooseServer.cpp:755] GET /modalities
I0528 10:10:05.598562 MongooseServer.cpp:755] POST /modalities/nmr8/query
I0528 10:10:05.600842 DicomUserConnection.cpp:901] Opening a DICOM SCU connection from AET “henric” to AET “K2D8SMR008” on host 10.142.52.143:4006 (manufacturer: Generic)
I0528 10:10:05.669691 MongooseServer.cpp:755] GET /system
I0528 10:10:05.670326 ReusableDicomUserConnection.cpp:95] Closing the global SCU connection after timeout
I0528 10:10:05.675713 MongooseServer.cpp:755] GET /queries/974056ab-9e26-419e-a2d4-0ab4422f732e/answers
I0528 10:10:07.175704 MongooseServer.cpp:755] GET /system
I0528 10:10:07.183918 MongooseServer.cpp:755] GET /modalities
W0528 10:10:54.409799 main.cpp:741] Orthanc is stopping
W0528 10:10:54.450278 main.cpp:801] HTTP server has stopped

Same problem as before.

Now I changed the AETitle to HENRIC instead, as suggested above (and changed accordingly on the scanner)

W0528 10:10:56.336789 main.cpp:1298] Orthanc version: 1.3.2
W0528 10:10:56.339424 OrthancInitialization.cpp:168] Scanning folder “/etc/orthanc/” for configuration files
W0528 10:10:56.339518 OrthancInitialization.cpp:120] Reading the configuration from: “/etc/orthanc/orthanc.json”
W0528 10:10:56.340155 OrthancInitialization.cpp:120] Reading the configuration from: “/etc/orthanc/serve-folders.json”
W0528 10:10:56.340338 OrthancInitialization.cpp:120] Reading the configuration from: “/etc/orthanc/worklists.json”
I0528 10:10:56.340545 Toolbox.cpp:1363] Using locale: “en_US.UTF-8” for case-insensitive comparison of strings
I0528 10:10:56.340745 Enumerations.cpp:1819] Default encoding for DICOM was changed to: Latin1
I0528 10:10:56.340945 FromDcmtkBridge.cpp:206] Using DCTMK version: 362
I0528 10:10:56.341026 FromDcmtkBridge.cpp:214] Loading the embedded dictionaries
I0528 10:10:56.365057 FromDcmtkBridge.cpp:226] Loading the embedded dictionary of private tags
I0528 10:10:56.378654 FromDcmtkBridge.cpp:2091] Registering JPEG Lossless codecs in DCMTK
I0528 10:10:56.378682 FromDcmtkBridge.cpp:2096] Registering JPEG codecs in DCMTK
W0528 10:10:56.388422 main.cpp:671] Loading plugin(s) from: /usr/share/orthanc/plugins/
I0528 10:10:56.388462 PluginsManager.cpp:288] Scanning folder /usr/share/orthanc/plugins/ for plugins
W0528 10:10:56.388510 main.cpp:671] Loading plugin(s) from: /home/henric/Downloads/OrthancWebViewer-2.3/build/libOrthancWebViewer.so
W0528 10:10:56.407415 PluginsManager.cpp:269] Registering plugin ‘web-viewer’ (version 2.3)
W0528 10:10:56.407452 PluginsManager.cpp:168] Initializing the Web viewer
W0528 10:10:56.407726 PluginsManager.cpp:168] Web viewer using 10 threads for the decoding of the DICOM images
W0528 10:10:56.407745 PluginsManager.cpp:168] Storing the cache of the Web viewer in folder: /var/lib/orthanc/db-v6/WebViewerCache
I0528 10:10:56.408340 PluginsManager.cpp:172] No change in the versions, no need to clear the cache of the Web viewer
W0528 10:10:56.408545 PluginsManager.cpp:168] Web viewer using a cache of 100 MB
W0528 10:10:56.408567 PluginsManager.cpp:168] Using GDCM instead of the DICOM decoder that is built in Orthanc
I0528 10:10:56.408581 OrthancPlugins.cpp:1111] Plugin has registered a callback to decode DICOM images (1 decoder(s) now active)
I0528 10:10:56.408604 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/series/(.)
I0528 10:10:56.408664 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/is-stable-series/(.
)
I0528 10:10:56.408691 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/instances/(.)
I0528 10:10:56.408718 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/libs/(.
)
I0528 10:10:56.408741 OrthancPlugins.cpp:1013] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/app/(.*)
I0528 10:10:56.408763 OrthancPlugins.cpp:1038] Plugin has registered an OnChange callback
W0528 10:10:56.408788 OrthancInitialization.cpp:1004] SQLite index directory: “/var/lib/orthanc/db-v6”
W0528 10:10:56.409037 OrthancInitialization.cpp:1074] Storage directory: “/var/lib/orthanc/db-v6”
I0528 10:10:56.409623 DatabaseWrapper.cpp:307] Version of the Orthanc database: 6
W0528 10:10:56.409656 HttpClient.cpp:691] HTTPS will use the CA certificates from this file: /etc/orthanc/
I0528 10:10:56.409671 HttpClient.cpp:157] Setting the default timeout for HTTP client connections: 10 seconds
I0528 10:10:56.409689 HttpClient.cpp:141] Setting the default proxy for HTTP client connections:
I0528 10:10:56.409701 DicomUserConnection.cpp:1216] Default timeout for DICOM connections if Orthanc acts as SCU (client): 10 seconds (0 = no timeout)
I0528 10:10:56.413159 ServerIndex.cpp:1888] Starting the monitor for stable resources (stable age = 60)
W0528 10:10:56.413188 ServerScheduler.cpp:135] The server scheduler has started
I0528 10:10:56.413256 ServerIndex.cpp:365] Starting the database flushing thread (sleep = 10)
W0528 10:10:56.413582 LuaContext.cpp:103] Lua says: Lua toolbox installed
W0528 10:10:56.413645 ServerContext.cpp:182] Disk compression is disabled
I0528 10:10:56.413663 ServerContext.cpp:530] Storing MD5 for attachments: yes
W0528 10:10:56.413677 ServerIndex.cpp:1403] No limit on the number of stored patients
W0528 10:10:56.413696 ServerIndex.cpp:1420] No limit on the size of the storage area
I0528 10:10:56.414059 DicomServer.cpp:125] Setting timeout for DICOM connections if Orthanc acts as SCP (server): 30 seconds (0 = no timeout)
W0528 10:10:56.414306 main.cpp:863] DICOM server listening with AET HENRIC on port: 4006
I0528 10:10:56.414330 DicomServer.cpp:62] DICOM server started
I0528 10:10:56.414340 MongooseServer.cpp:1049] HTTP keep alive is disabled
W0528 10:10:56.414388 MongooseServer.cpp:1075] HTTP compression is enabled
I0528 10:10:56.414406 MongooseServer.cpp:948] Starting embedded Web server using Mongoose
W0528 10:10:56.418889 main.cpp:796] HTTP server listening on port: 8042
W0528 10:10:56.418923 main.cpp:683] Orthanc has started
I0528 10:12:36.022214 MongooseServer.cpp:755] POST /modalities/nmr8/query
I0528 10:12:36.024321 DicomUserConnection.cpp:901] Opening a DICOM SCU connection from AET “HENRIC” to AET “K2D8SMR008” on host 10.142.52.143:4006 (manufacturer: Generic)
I0528 10:12:36.083758 MongooseServer.cpp:755] GET /system
I0528 10:12:36.092397 MongooseServer.cpp:755] GET /queries/af57c6fd-de3d-493c-8b32-6387bd09633d/answers
I0528 10:12:36.123418 ReusableDicomUserConnection.cpp:95] Closing the global SCU connection after timeout
I0528 10:12:40.154368 MongooseServer.cpp:755] GET /system
I0528 10:12:40.165775 MongooseServer.cpp:755] GET /patients
I0528 10:12:41.858650 MongooseServer.cpp:755] GET /system
I0528 10:12:41.863986 MongooseServer.cpp:755] GET /modalities

No results in the query.

The log of findscu is the following:

findscu -v -S -aet HENRIC -aec K2D8SMR008 nmr8 4006 -k QueryRetrieveLevel=STUDY -k StudyDate -k StudyDescription -k StudyInstanceUID

I: Requesting Association
I: Association Accepted (Max Send PDV: 64222)
I: Sending Find Request (MsgID 1)
I: Request Identifiers:
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0020) DA (no value available) # 0, 0 StudyDate
I: (0008,0052) CS [STUDY] # 6, 1 QueryRetrieveLevel
I: (0008,1030) LO (no value available) # 0, 0 StudyDescription
I: (0020,000d) UI (no value available) # 0, 0 StudyInstanceUID
I:
I: ---------------------------
I: Find Response: 1 (Pending)
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
I: (0008,0020) DA [20180220] # 8, 1 StudyDate
I: (0008,0030) TM [145218] # 6, 1 StudyTime
I: (0008,0052) CS [STUDY ] # 6, 1 QueryRetrieveLevel
I: (0008,0056) CS [ONLINE] # 6, 1 InstanceAvailability
I: (0008,0060) CS [MR] # 2, 1 Modality
I: (0008,0061) CS [MR] # 2, 1 ModalitiesInStudy
I: (0010,0010) PN [MC_QA_TOOL] # 10, 1 PatientName
I: (0010,0020) LO [geservice ] # 10, 1 PatientID
I: (0020,000d) UI [1.2.840.113619.2.440.14196467.849593.20838.1519032832.46] # 56, 1 StudyInstanceUID
I: (0020,0010) SH [50031 ] # 6, 1 StudyID

Then the response repeated for all patients. Ending with this

I: Received Final Find Response (Success)
I: Releasing Association

I’ve tried finding a relevant log on the scanner, but was unable to.

Again, thanks for your help.
Henric

Hello,

These lines in the log look rather strange:

I0528 10:12:36.024321 DicomUserConnection.cpp:901] Opening a DICOM SCU connection from AET “HENRIC” to AET “K2D8SMR008” on host 10.142.52.143:4006 (manufacturer: Generic)
I0528 10:12:36.083758 MongooseServer.cpp:755] GET /system
I0528 10:12:36.092397 MongooseServer.cpp:755] GET /queries/af57c6fd-de3d-493c-8b32-6387bd09633d/answers
I0528 10:12:36.123418 ReusableDicomUserConnection.cpp:95] Closing the global SCU connection after timeout

They seem to indicate that Orthanc receives no answer from host “10.142.52.143”. Are you sure that the IP address is OK (i.e. correspond to host “nmr8”), and that the port 4006 is not blocked on the host running Orthanc?

Please also post here the C-FIND request that is issued by Orthanc, by installing the following Lua script and copying the log:
http://book.orthanc-server.com/users/lua.html#fixing-c-find-requests

function OutgoingFindRequestFilter(query, modality)
PrintRecursive(query)
PrintRecursive(modality)
return query

end

Note that the sample Lua filter that replaces “*” by “” in outgoing C-FIND requests might solve your issue (check out the link above).

Finally, have you tried all the possible values for the manufacturer type in the “DicomModalities” configuration option of Orthanc? The log indicates that Orthanc uses a “Generic” manufacturer, but you should try with “GenericNoWildcardInDates”, “GenericNoUniversalWildcard”, “StoreScp”, “ClearCanvas”, “Dcm4Chee” and “Vitrea”.

HTH,
Sébastien-

Hi again,

after doing the asterisk replacement trick as suggested, it’s finally working! Thanks!

For those in the future ending up here, here’s what I did:

  • Created a lua file (/etc/orthanc/filterAsterisks.lua) with this content:

function OutgoingFindRequestFilter(query, modality)
for key, value in pairs(query) do
if value == ‘*’ then
query[key] = ‘’
end
end

return query
end

  • Added the script to configuration (/etc/orthanc.json) file:

“LuaScripts” : [
“/etc/orthanc/filterAsterisks.lua”
],

  • Restart orthanc
    Thanks a lot

Great news, thanks for the feedback!

For future reference, please could you tell us what are the manufacturer and model of your modality?

Please could you also give a try by removing the Lua script, then declaring the manufacturer type of your modality as “GenericNoUniversalWildcard” in the “DicomModalities” configuration option? This should be equivalent to the Lua script.

Sure! It’s MRI scanners from GE. Models include “Signa Premier” and “Optima 450w”.

I also disabled the Lua script and changed the DicomModalities to:

“nmr8”: [“K2D8SMR008”, “10.142.52.143”, 4006, “GenericNoUniversalWildcard”],

which was also successful. However, my (old?) config file does not state this option in the comments.

Now I just need to figure out how to add 1.3.2 as a service.

Thanks!

Regarding services, you can draw your inspiration from the official GNU/Linux packages: