Web server

  • Hi Luiz,


    I released your work on Github. I deleted package-lock.json and most of the .xx files to reduce its size as much as possible.


    I ran into an issue on my main development machine (Window7). The latest node.js package to run on there is node-v13.14.0-x64. This version does not have the ?. operator, and no function string.replaceAll. If I take these out of the api it runs fine. My replacement function for replaceAll is shown below.


    Code
    function replaceAll_(string, search, replace) {
    return string.split(search).join(replace);
    }



    Also note that dgate64.exe on the server must be the latest from github for correct json processing.


    Issues:


    1) images are sorted on InstanceNumber as a string, not a number (i.e. as 1, 10, 100, 101 ...)

    2) Also the path lenght issue is there. I.e. the api must be run from a somewhat short path, e.g. c:\temp works fine.

    3) We may need to distribute the Linux version of servertask in the same folder

    4) Is it possible to not show the wait window in the first 100ms or so? That would make slice scrolling much smoother. it is quite fast ~50ms.


    Marcel

  • Hi Marcel

    Please don´t delete "package-lock.json". A paper about it: https://dev.to/adamklein/packa…k-json-in-git-or-not-50l5

    ReplaceAll I think is ok.


    >>1) images are sorted on InstanceNumber as a string, not a number (i.e. as 1, 10, 100, 101 ...)

    Sorry? do you mean the correct is sort by string(1,10,2,3...) instead of numbers(1,2,3...10)?


    >> 2) Also the path lenght issue is there. I.e. the api must be run from a somewhat short path, e.g. c:\temp works fine.

    Unhapilly, I didn´t find a node solution to that.


    >> 3) We may need to distribute the Linux version of servertask in the same folder

    Of course, we need.


    >> 4) Is it possible to not show the wait window in the first 100ms or so? That would make slice scrolling much smoother. it is quite fast ~50ms.

    Yes, it is. I will remove all "wait dialogs", because we already have a circular progress dialog in the upper right corner.

  • Hi,


    I released package-lock.json. Sorry.


    1) These should be sorted as numbers 1, 2, 3, .. 10, 11, ... but they are not, they are sorted as string 1, 10, 11, ... 2, 20, 21, etc (at least with Node13).

    2) Ok.

    3) I guess that should be placed in maklinux

    4) Great


    Marcel

  • Hi, Marcel


    >>3) I guess that should be placed in maklinux

    I have created two folders under "dgate" existent folder.

    They are windows and linux

    Into windows folder I put servertask.exe and queryfunctions.lua

    Into linux folder I put servertask and queryfunctions.lua

    The API will ckeck what OS is running and will set the APIFOLDER to match with OS.

    For sample:


    Code
    let opsys = process.platform;
    if (opsys == "darwin") {
    opsys = "MacOS";
    } else if (opsys == "win32" || opsys == "win64") {
    opsys = "Windows";
    } else if (opsys == "linux") {
    opsys = "Linux";
    }
    let APIFOLDER =
    `${global.appRoot}/api/dgate/` + (opsys == "Windows" ? "windows" : "linux");


    Is this OK?


    If yes, should I add all servertask sources/make into linux folder as well?

  • Hi,


    is that necessary? Can't we have servertask and servertask.exe in the same folder? I assume there is no difference in the lua code. Or I can make the installer just put the correct binary there.


    The source code is in the the src/servertask folder (already released), which is fine.


    Marcel


  • Hi, Marcel

    I sent you the files updated by email
    1. We have servertask and servertask.exe in the same folder just now.

    2. Fix to InstanceNumber sort

    3. Changed "v.replaceall.." with v = v.replace(/,/g, "\\\\");

    4. Removed wait dialog


    Regards, Luiz

  • Hi Luiz,


    I have updated all on Github and also added .elsintjs.rc

    I can now interactively develop the web app which is very nice.


    Some feedback on the app for future improvement:


    Cornerstone page:

    Would be great to add a keyboard interface (see e.g. my wadoseriesviewer in conquest for ideas)

    The DICOM viewer does not fill the available space

    Reduce the debounce time or remove the debounce on scroll to make it load faster

    Too bad the image blinks when changing slices this is very distracting

    I do not like that slicing wraps around

    It would be good if the icon images would scroll with the main image (and they could be smaller)

    The colors of the icon scrollbar are too subtle and it should not auto-hide

    Zoom, pan and level and window settings are not kept when slicing

    Instance number and slice coordinate are not displayed


    Search page:

    Show Series Description in the search page

    Can be lists be made scrollable?

    Respond on enter key to make it search from the patientID or name edits.


    Marcel

  • Hi, Marcel,

    >>Would be great to add a keyboard interface (see e.g. my wadoseriesviewer in conquest for ideas)

    -- I didn´t find how todo that with cornerstone tools


    >> The DICOM viewer does not fill the available space

    I am afraid this is how cornerstone tools works(but I am not sure)

    To fill all space available, then zoom tool must be used.


    >>Reduce the debounce time or remove the debounce on scroll to make it load faster

    >>Too bad the image blinks when changing slices this is very distracting

    - done


    >>I do not like that slicing wraps around - done,

    -- removed


    >>It would be good if the icon images would scroll with the main image (and they could be smaller)

    - done partially(only smaller part)


    >>The colors of the icon scrollbar are too subtle and it should not auto-hide

    done, I changed the colors


    >> Zoom, pan and level and window settings are not kept when slicing

    I am not a cornerstone specialist. I use only the basic.

    But, I will search how to do it.


    >>Instance number and slice coordinate are not displayed - done partially

    - Instance Number is done. I don´t know what you mean with slice coordinate


    Search page:


    >>Show Series Description in the search page - done


    >>Can be lists be made scrollable? - done, but IMHO I don´t like that so much


    >>Respond on enter key to make it search from the patientID or name edits. - done


    Here is the files updated:

    https://www.dropbox.com/s/g3te…com_vue_clientV2.zip?dl=0

  • Hi,


    All updated. I also added a static deployed version in the htdocs/app/luiz folder, as well a PhP based API alternative in the /api/dicom folder. This opens up your work also for non-node users.


    regards,


    Marcel

  • Great,

    If you want you can deploy the app as a normal static site webpage in Apache.

    I use nginx. A proxy to server the API and the front end app. Nginx redirect the requests to api or web app based on query string.

  • Hi, I am way over the level of this topic, but good to see it developed. Just to add some feedback, I managed to acces the built in webserver with the basic conerstone viewer to view some images. Well done!


    I tried to run OHIF, a more advanced cornerstone based viewer with the API.

    In powershell console I can see:


    "GET /api/dicom/rs/studies?PatientName=maria&limit=25&offset=0&fuzzymatching=false&includefield=all&StudyDate=20220715-20220815"


    Note I set FuzzyMatching to false, but I couldnt get any result to show.




    Also, trying Weasis with a DicomWeb node configured (http://localhost:3002/api/dicom/rs)


    In powershell console I see:

    "GET /api/dicom/rs/studies?00100010=maria&00080020=20220801-20220815&includefield=00080020,00080030,00080050,00080061,00080090,00081030,00100010,00100020,00100021,00100030,00100040,0020000D,00200010&limit=10&offset=0"


    I couldnt get any results either.



    I know it is very ealy developement, but if those two viewers could be easily integrated with conquest it would be awesome.


    Thanks for your efforts

  • Hi,


    Could you remove fuzzymatching and try something as:

    Code
    .... rs/studies?PatientName=maria*&limit=25&offset=0&includefield=all&StudyDate=20220715-20220815

Participate now!

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