Web server

  • Hi, Marcel

    In this function, is there a way to compress the dcm file on tye fly to reduce the amount of data in the network and get a faster image load?

  • Hi,

    no this works on x in memory of course after you read it and before you write it. Usually I read the compression by getting the filesize on disk. In straight lua:

    function filesize(f)
    local h = io.open(f)
    if h==nil then
    return 0
    local s = h:seek('end', 0)
    return s
  • Hi, Marcel

    I have readng about wado specs.

    As I understood a WADO request is simply a HTTP GET request that contains the Study, Series, and Instance identifiers.

    For instance,


    My question is how I set the query string to search studies by patient name or patient id using WADO.

    If this is possible, my intent will be change the API to become WADO compatible.

  • Hi

    That is a good idea, but WADO only provides access to objects, it has no query functionality. For that you need to implement dicomweb, as explained here:


    and here:


    If you want to export WADO through node.js, conquest has a WADO interface that is exposed to servercommand as follows (in C):

    sprintf(obj, "%s\\%s\\%s", studyUID, seriesUID, objectUID);
    sprintf(lwfq, "%d/%d/%d/%d", atoi(windowCenter), atoi(windowWidth), atoi(frameNumber), atoi(imageQuality)
    sprintf(size, "%d/%d", atoi(rows), atoi(columns))
    sprintf(command, "wadorequest:%s,%s,%s,%s,%s,%s,%s,%s,%s", obj, lwfq, size, region, contentType, transferSyntax, anonymize, annotation, bridge);
    SendServerCommand("", command, console, NULL, FALSE);

    in lua the last line would be servercommand(command, 'cgi')


  • Luiz,

    if you use the binary dgate.dic (it is in the distribution look for ~150k size) instead of the text one your server will be faster. You do need to have your additions.


    Hi, Marcel

    But I need add in dgate.dic the next tags. And I can´t do it into binary.

        ConquestDevice: "",
        ConquestObjectFile: "",
        ConquestImageDate: "",
        ConquestImageTime: "",
  • Marcel,

    Does conquest dgate can return a json dicomweb(qido,wadors) compatible for studies, series......? If yes, I can do the qido api.

    I have seen https://github.com/knopkem/dic…se-native/tree/master/src, but I don´t use c++. It´s compiled and used in dicom-dimse-native (https://github.com/knopkem/dicom-dimse-native) with javascript.

    But, But if use these module, I wouldn´t need use dgate.

    And I think dgate is faster than dicom-dimse-native.

    The studies results in dicomweb format will need something as:


  • Hi,

    it does not. It returns json using the dicom tag name as key. On possibility is to code the translation using the dictionary in js. Another is to extend the code is function luaSerialize in dgate.cpp with yet another flag. All the information is there.

    Can you show a longer example of the dicomweb format?


  • It´s hard find return samples. But I found it:

    // The following example is a QIDO-RS SearchForStudies response consisting

    // of two matching studies, corresponding to the example QIDO-RS request:

    // GET http://qido.nema.org/studies?P…&includefield=all&limit=2

  • The code should be changed as follows (this is for myself):

    add parameter dicomweb

    every check for an item having one value should be bypassed for dicomweb e.g.

    if (vr->Length==4 && !dicomweb)

    if (vr->Length>4 | | dicomweb)

    For dicomweb the variable name should be generated as folllows, e.g.:

    "00201208": {

    "vr": "IS",


    Then add a variable br3 that is empty except for dicomweb where it would be "}"

    to add the the closing } all sprintf lines like 7779 should then become:

    Index+=sprintf(result+Index, "%s%c\"%s\"%s,", name, eq, t, br3);

    I think this would bring it a long way for query results, it would not be enough for images.


  • Great,

    My 'c++' and dicom knowledge is poor. Otherwise, I'd help on it.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!