From 1489c89f684ae91fddbf891cd8a52e07905bec10 Mon Sep 17 00:00:00 2001 From: ivmartel Date: Wed, 21 Oct 2015 00:27:19 +0200 Subject: [PATCH] Updated lua scripts to new page structure. Added mobile version. --- resources/dwv-mobile.lua | 243 +++++++++++++++++++++++++++++++++++++++ resources/dwv-simple.lua | 11 +- resources/dwv-static.lua | 60 +++++----- 3 files changed, 282 insertions(+), 32 deletions(-) create mode 100644 resources/dwv-mobile.lua diff --git a/resources/dwv-mobile.lua b/resources/dwv-mobile.lua new file mode 100644 index 0000000000..0e6166b50d --- /dev/null +++ b/resources/dwv-mobile.lua @@ -0,0 +1,243 @@ +-- +-- 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-simple] +-- >> source = dwv-mobile.lua +-- And set it as the default viewer: +-- >> [webdefaults] +-- >> ... +-- >> viewer = dwv-simple +-- 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([[ + + + + +DICOM Web Viewer + + + + +]]) + +print([[ + + + + + + + + + + + + + + + +]]) + +print([[ + +]]) + +print([[ + + + + + +
+ + + + + +
+ +
+ + +
+ + +
+Close +
+

Open

+
+
+
+ + +
+
+Only for HTML5 compatible browsers... +
+
+
+
+
+
+
+
+ + + + +
+ +
+
+
+
+ +
+ +
+ + +
+ +
+Back +

DICOM Tags

+
+ +
+ +
+
+ +
+ + +
+ +
+Back +

DWV Help

+
+ +
+ +
+
+ +
+ + + +]]) diff --git a/resources/dwv-simple.lua b/resources/dwv-simple.lua index f0c75a76c3..bf419ed898 100644 --- a/resources/dwv-simple.lua +++ b/resources/dwv-simple.lua @@ -148,14 +148,19 @@ print([[
+ +
+ -
+
-
-Only for HTML5 compatible browsers... +
+Only for HTML5 compatible browsers...
+
+
diff --git a/resources/dwv-static.lua b/resources/dwv-static.lua index 4adc70cdf6..d3f00e47b3 100644 --- a/resources/dwv-static.lua +++ b/resources/dwv-static.lua @@ -75,7 +75,6 @@ HTML('Content-type: text/html\n\n') -- paths with extra /dwv print([[ - @@ -87,12 +86,12 @@ body { background-color: #222; color: white; margin: 10px; padding: 0; font-size: 80%; } #pageHeader h1 { display: inline-block; margin: 0; color: #fff; } #pageHeader a { color: #ddf; } -#pageHeader #toolbar { display: inline-block; float: right; } -#toolbox li:first-child { list-style-type: none; padding-bottom: 10px; margin-left: -20px; } +#pageHeader .toolbar { display: inline-block; float: right; } +.toolbox li:first-child { list-style-type: none; padding-bottom: 10px; margin-left: -20px; } #pageMain { position: absolute; height: 92%; width: 99%; bottom: 5px; left: 5px; background-color: #333; } -#infotl { color: #333; text-shadow: 0 1px 0 #fff; } -#infotr { color: #333; text-shadow: 0 1px 0 #fff; } -#dropBox { margin: 20px; } +.infotl { color: #333; text-shadow: 0 1px 0 #fff; } +.infotr { color: #333; text-shadow: 0 1px 0 #fff; } +.dropBox { margin: 20px; } ]]) @@ -105,9 +104,9 @@ print([[ - + @@ -163,57 +162,60 @@ print([[ + +
+
-
-
-
+
+
+
-
-
    -
    +
    -
    +
    -
    +
    -
    +
    -
    -
    -
    -Only for HTML5 compatible browsers... -
    -
    -
    -
    -
    -
    +
    +
    +
    +Only for HTML5 compatible browsers... +
    +
    +
    +
    +
    +
    +
    + ]])