-- -- DICOM Web Viewer (DWV) lua script for integration in a Conquest PACS server. -- -- Usage: -- 1. copy this file onto your web server -- 2. in the 'dicom.ini' of your web server, create the dwv viewer: -- >> [dwv-static] -- >> source = dwv-static.lua -- And set it as the default viewer: -- >> [webdefaults] -- >> ... -- >> viewer = dwv-static -- 3. copy the DWV distribution files in a 'dwv' folder -- in the web folder of your web server. It should be accessible -- via '[server address]/dwv'. -- -- This script relies on the 'kFactorFile', 'ACRNemaMap' and 'Dictionary' -- variables being set correctly. -- Get ids local patientid = string.gsub(series2, ':.*$', '') local seriesuid = string.gsub(series2, '^.*:', '') -- Functions declaration function getstudyuid() local a, b, s s = servercommand('get_param:MyACRNema') b = newdicomobject() b.PatientID = patientid b.SeriesInstanceUID = seriesuid b.StudyInstanceUID = '' a = dicomquery(s, 'SERIES', b) return a[0].StudyInstanceUID end function queryimages() local images, imaget, b, s s = servercommand('get_param:MyACRNema') b = newdicomobject() b.PatientID = patientid b.SeriesInstanceUID = seriesuid b.SOPInstanceUID = '' images = dicomquery(s, 'IMAGE', b) imaget={} for k=0,#images-1 do imaget[k+1]={} imaget[k+1].SOPInstanceUID = images[k].SOPInstanceUID end table.sort(imaget, function(a,b) return a.SOPInstanceUID < b.SOPInstanceUID end) return imaget end -- Main local studyuid = getstudyuid() local images = queryimages() -- create the url lua array local urlRoot = webscriptadress urlRoot = urlRoot .. '?requestType=WADO&contentType=application/dicom' urlRoot = urlRoot .. '&seriesUID=' .. seriesuid urlRoot = urlRoot .. '&studyUID=' .. studyuid local urls = {} for i=1, #images do urls[i] = urlRoot .. '&objectUID=' .. images[i].SOPInstanceUID end -- Generate html HTML('Content-type: text/html\n\n') -- paths with extra /dwv print([[