Conquest and html5+js DICOM viewer (DWV), dwv025 below

  • Hola,
    I'm trying to integrate a home made html5+js DICOM viewer (DWV) with the Conquest PACS.
    This viewer can take a DICOM file as URL argument as in this link: http://ivmartel.github.com/dwv….org%2F%3F53320924%26.dcm
    This works with WADO too as long as the script is hosted with the PACS.
    Marcel left an issue on the project page (https://github.com/ivmartel/dwv/issues/15) with examples but I am not clear on what would be the best way to integrate the two. Can't the "view (WADO)" link be replaced on the "mode=imagefinder" page when you browse data on the PACS? I tried playing with the wadoviewer.lua but could not find the link I needed to write to launch it. Is it "dgate.exe?mode=wadoviewer" but with more arguments? Where are these image viewers accessed from in the Conquest web interface?
    Best,
    Yves

  • Hi,


    The conquest web interface config (cgi-bin/dicom.ini) has a option viewer that refers to the 'view' link in the browse series pages that can start a lua script to generate a HTML page. Passed in the CGI parameters is a 'series' argument with syntax patientid:seriesinstanceuid. The lua script takes this to do a DICOM query and generate a list WADO DICOM urls as shown in the samples for Weasis a few posts back.


    The WADO viewer here http://forum.image-systems.biz…7&hilit=wadoviewer#p24487 works similar (it uses jpeg references though).


    If you can generate a minimalistic HTML file that includes an an array of DICOM urls to view, it should be easy to replace the links dynamically for a selected series and make it into a series viewer. I will gladly help with that.


    Marcel

  • Hi,


    I realise it is difficult. This is a working WADO series viewer:


    file: viewers\wadoseriesviewer.lua


    You enable it with these entries in cgi=bin\dicom.ini:


    [webdefaults]
    viewer = wadoseriesviewer
    [wadoseriesviewer]
    source = viewers\wadoseriesviewer.lua


    The WADO request can be made to return DICOM images using: contentType=application/dicom. You should first get it to run from your web setup; and then be able to slowly change the lua to source to use DWV to view the images. You can also capture the page source and modify that. If you send it back working for one series, I can convert it into lua.


    Regards,


    Marcel

  • Hola,
    I must have missed something... I have 1.4.17alpha on windows 7 with your file installed in my apache cgi-bin and configured in the dicom.ini as you say.
    From the web interface, I do not have a link to open the wadoseriesviewer, I just have the "view (WADO)" that load a gif image. So I'm trying to guess the url by putting a mode=wadoseriesviewer but it seems I get it wrong since the result page is blank (no html code at all). The script is loaded because when I just put calls to HTML they get displayed.
    Any idea?
    Yves

  • Hi Yves,


    the code I posted is a page that is loaded from 'List local patients' and then drill down to series level and select 'view'. This option shows data in conquest and is configurable to any viewer.


    The link you refer to is reached from 'Find ... on server ....', which has a WADO bridge method to look at external DICOM archive. This option is NOT configurable.


    Hope this helps,


    Marcel

  • Hi Yves,


    Great, I will try it out tonight. As far as I know there are currently no other open source and free HTML5 DICOM viewers, that is why I knocked on your door. In principle we should be able to set it up such that a page like 'list' ... on server ... link will query that server and spit out WADO links to that server. I.e., the conquest web interface would then be a query frontend to other PACS systems. The lua code I sent you can easily be modified to connect to any PACS modifying the AE and WADO links.


    JAVA viewers around (e.g., Weasis) typically provide a JAVA frontend to do the querying, which then generates an xml document passed into Weasis with all the information. That model may be suitable for your viewer. You might have a look at their pages or in this forum where the connection between conquest and weasis is posted.


    Regards,


    Marcel

  • Hi,


    the script does not work, because these 2 lines must be on top and not in the middle:


    local patid = string.gsub(series2, ':.*$', '')
    local seriesuid = string.gsub(series2, '^.*:', '')


    lua uses lexical scoping, i.e., globals must be defined before using them. You also need to use series2 instead of series that has spaces substituted by %20 etc - this would be an issue for the PatientID


    I also get an error box: "Error: Exceeded the size of the input string", but otherwise things seem to work OK after my change.


    Marcel

  • Ok, I've updated the script. About the data length, it seems the pixel data is one byte longer than expected. I get this error from data that I upload to the server but not with the original file. Is it possible that there was an error when generating it?

  • Hi Yves,


    can you elaborate? The pixel data is 7fe0,0010 and typically has a length of 2 x #pixels. What is one byte longer? Or is there maybe a 0 byte appended to the image by me in the process of the WADO file generation, that would be possible.


    Marcel

  • Hi,


    I just tested. Indeed there is a 0 byte appended. I have added it to the bug list.


    The reason is that I use a DICOM tag to transmit the entire DICOM image from dicom server to web server. But "application/dicom\n\n" must be prepended which has an ODD length. The tag size must be even so one byte is left. The fix must be in SendServerCommand to catch application/dicom and then write one byte less to buf or stdout....


    Marcel

  • If you put this in the scripts somewhere:


    Code
    function load(){ app.loadDicomURL(']]..webscriptadress..[[?requestType=WADO&contentType=application/dicom'+ '&studyUID=]]..studyuid..[[' + '&seriesUID=]]..seriesuid..[[' + '&objectUID=' + document.forms[0].slice.value);}function nextslice(){ if (document.forms[0].slice.selectedIndex == document.forms[0].slice.length-1) document.forms[0].slice.selectedIndex = 0; else document.forms[0].slice.selectedIndex = document.forms[0].slice.selectedIndex + 1; load()}


    And this before the print([[</body>]]), you get a slice selector.



    I would also block out the throw new Error("Exceeded the size of the file"); code for now.


    Marcel

  • Thanks, I added your code to the dwv.lua on my github. I have some display issues in firefox to solve...
    About the extra pixel, I changed it from a message to a javascript warning.
    All speed-ups are welcome!

  • Hi,


    I was trying to get DWV viewer running together with ConQuest but I have a problem which I am not sure how to deal with. First of all I followed this thread and everything is setup how it is described here. Now when I click on view link in ConQuest web interface. DWV is opened, however I cannot see any image. The only toolbox window which is active is File. There the slice dropdownlist is displaying the correct number of slices. But when I choose next slice I got and error:


    Error occured while retrieving the file.


    DWV connection with ConQuest server seems to be OK. When view link was clicked, I can see that conquest is executing query.


    Do you have any ideas what could be wrong in my setup?


    thanks in advice.

  • Hi,


    I am doing some prototyping with ConQuest DICOM, because I would like to use it together with CRF system (most likely OpenClinica) in order to create a study database. As OpenClinica does not have any special support for DICOM I would like to have these two nicely integrated. One example is preview of DICOM files, and for this I was thinking about DWV as a nice HTML5 viewer.


    I was following this thread and setup DWV in ConQuest. So now when I choose view option from ConQuest web interface it opens DWV but the problem is that no file is displayed. The only toolbox which is active is File toolbox. There I can see that dropdownlist for slices was correctly filled with appropriate numbers of slices, however when next slice is chosen, I got an error:


    An error occurred while retrieving the file.


    The connection between DWV and ConQest seems to be ok, because I can see that the dicom query is executed. The server is printing out this info while view option is triggered:



    my own feeling is that something is wrong with associating image file to image element. I have also setup for different WADO viewer (taken from OpenClinica integration thread). And when the server as a response on the query usually puts one more line on the output. Something like: Locating file:MAG0 samples/0001_003000_892665662.v2


    do you have any idea what could be wrong.


    thanks in advice

  • Hi,


    if you look into the generated HTML page source you will see the WADO requests listed out somewhere. The start bit is generated from lua variable "webscriptadress" which is a misspelled copy of "webscriptaddress" in cgi-bin/dicom.ini. Most likely this variable is set wrong.


    Marcel

  • ok now I see, the variable webscriptaddress from dicom.ini has to have same naming convention as it is used to access to web dicom interface (localhost != IP address).


    However there are still some display issues. Which kind of browser are you using fro testing? Using Iceweasel (firefox) I got: RefferenceError: DataView is not defined.


    Chromium (Chrome): have problems with history, toobox windows. They are not places into movable containers but somehow directly printed into canvas.


    Runing under debian linux.


    Tomas

  • Hi Tomas,


    I tested with firefox under windows. I do not like the layout of the tools etc very much either but this viewer code is a great start. Does it fail to display in some browsers?


    Marcel

  • Hi Marcel,


    I wanted to ask you one more thing, which is not directly related to DWV viewer but is regarding DICOM viewers for ConQuest in general. First I thought that it is a problem of DWV but, it does not matter if I use this one or the serversideviewer or any other (e.g. simple WADO viewer from lua scripts).


    In a web interface when I browse thumbs images they look OK. When I open dicom file from file system using dedicated DICOM viewer software it also looks OK. However if I use view option from ConQuest web interface (again does not matter which viewer is setup) it always disrupt the image. Hard to explain the image is other mostly back, or the height is small, etc.


    I do not have any idea what is causing this behavior. Could you point me what could be wrong in my setup?


    thanks in advice


    Tomas

Participate now!

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