init
344
nv/html/dwv/resources/conquest/dwv-mobile.lua
Normal file
@@ -0,0 +1,344 @@
|
||||
--
|
||||
-- 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([[
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>DICOM Web Viewer</title>
|
||||
<meta charset="UTF-8">
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/css/style.css">
|
||||
]])
|
||||
|
||||
print([[
|
||||
<style type="text/css" >
|
||||
body { margin: 10px; padding: 0; }
|
||||
.layerContainer { margin: auto; text-align: center; }
|
||||
.imageLayer { left: 0px; }
|
||||
.dropBox { margin: 20px auto; }
|
||||
.inline { display: inline-block !important; }
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/ext/jquery-mobile/jquery.mobile-1.4.5.min.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/ext/nprogress/nprogress.css" />
|
||||
<style type="text/css" >
|
||||
.ui-popup .ui-controlgroup { background-color: #252525; }
|
||||
.colourLi > .ui-input-text { text-align: center; }
|
||||
.colourLi > .ui-input-text input { min-height: 2em; width: 7em; display:inline-block }
|
||||
.lwColourLi > .ui-input-text { text-align: center; }
|
||||
.lwColourLi > .ui-input-text input { min-height: 2em; width: 7em; display:inline-block }
|
||||
.ffColourLi > .ui-input-text { text-align: center; }
|
||||
.ffColourLi > .ui-input-text input { min-height: 2em; width: 7em; display:inline-block }
|
||||
/* jquery-mobile strip not visible enough */
|
||||
.table-stripe tbody tr:nth-child(odd) td,
|
||||
.table-stripe tbody tr:nth-child(odd) th {
|
||||
background-color: #eeeeee; /* non-RGBA fallback */
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/ext/jquery-mobile/jquery.mobile-1.4.5.min.css">
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Third party (dwv) -->
|
||||
<script type="text/javascript" src="/dwv/ext/modernizr/modernizr.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18next.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18nextXHRBackend.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18nextBrowserLanguageDetector.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/konva/konva.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/magic-wand/magic-wand.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/jszip/jszip.min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Third party (viewer) -->
|
||||
<script type="text/javascript" src="/dwv/ext/jquery/jquery-2.1.4.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/jquery-mobile/jquery.mobile-1.4.5.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/nprogress/nprogress.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/flot/jquery.flot.min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Decoders -->
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/jpx.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/util.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/arithmetic_decoder.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/jpg.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/rii-mango/lossless-min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Local -->
|
||||
<script type="text/javascript" src="/dwv/dwv-0.23.0-beta.min.js"></script>
|
||||
<!-- Launch the app -->
|
||||
<script type="text/javascript" src="/dwv/viewers/mobile/appgui.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<script type="text/javascript">
|
||||
// start app function
|
||||
function startApp() {
|
||||
// translate page
|
||||
dwv.i18nPage();
|
||||
// main application
|
||||
var myapp = new dwv.App();
|
||||
myapp.init({
|
||||
"containerDivId": "dwv",
|
||||
"fitToWindow": true,
|
||||
"tools": ["Scroll", "WindowLevel", "ZoomAndPan", "Draw", "Livewire", "Filter", "Floodfill"],
|
||||
"filters": ["Threshold", "Sharpen", "Sobel"],
|
||||
"shapes": ["Arrow", "Ruler", "Protractor", "Rectangle", "Roi", "Ellipse", "FreeHand"],
|
||||
"gui": ["tool", "load", "help", "undo", "version", "tags", "drawList"],
|
||||
"loaders": ["File", "Url"],
|
||||
"isMobile": true,
|
||||
"skipLoadUrl": true
|
||||
});
|
||||
var size = dwv.gui.getWindowSize();
|
||||
$(".layerContainer").height(size.height);
|
||||
]])
|
||||
-- create javascript url array
|
||||
print([[
|
||||
var inputUrls = [
|
||||
]])
|
||||
for i=1, #images do
|
||||
print(' "'..urls[i]..'",')
|
||||
end
|
||||
print([[
|
||||
];
|
||||
]])
|
||||
-- load data
|
||||
print([[
|
||||
if( inputUrls && inputUrls.length > 0 ) myapp.loadURLs(inputUrls);
|
||||
}; // end startApp
|
||||
]])
|
||||
|
||||
print([[
|
||||
// check browser support
|
||||
dwv.browser.check();
|
||||
// initialise i18n
|
||||
dwv.i18nInitialise("en","/dwv");
|
||||
]])
|
||||
|
||||
print([[
|
||||
// status flags
|
||||
var domContentLoaded = false;
|
||||
var i18nInitialised = false;
|
||||
// launch when both DOM and i18n are ready
|
||||
function launchApp() {
|
||||
if ( domContentLoaded && i18nInitialised ) {
|
||||
startApp();
|
||||
}
|
||||
}
|
||||
// DOM ready?
|
||||
$(document).ready( function() {
|
||||
domContentLoaded = true;
|
||||
launchApp();
|
||||
});
|
||||
// i18n ready?
|
||||
dwv.i18nOnInitialised( function () {
|
||||
// call next once the overlays are loaded
|
||||
var onLoaded = function (data) {
|
||||
dwv.gui.info.overlayMaps = data;
|
||||
i18nInitialised = true;
|
||||
launchApp();
|
||||
};
|
||||
// load overlay map info
|
||||
$.getJSON( dwv.i18nGetLocalePath("overlays.json"), onLoaded )
|
||||
.fail( function () {
|
||||
console.log("Using fallback overlays.");
|
||||
$.getJSON( dwv.i18nGetFallbackLocalePath("overlays.json"), onLoaded );
|
||||
});
|
||||
});
|
||||
]])
|
||||
|
||||
print([[
|
||||
</script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Main page -->
|
||||
<div data-role="page" data-theme="b" id="main">
|
||||
|
||||
<!-- pageHeader #dwvversion -->
|
||||
<div id="pageHeader" data-role="header">
|
||||
<h1>DWV <span class="dwv-version"></span></h1>
|
||||
<a href="#help_page" data-icon="carat-r" class="ui-btn-right"
|
||||
data-transition="slide" data-i18n="basics.help">Help</a>
|
||||
</div><!-- /pageHeader -->
|
||||
|
||||
<!-- DWV -->
|
||||
<div id="dwv">
|
||||
|
||||
<div id="pageMain" data-role="content" style="padding:2px;">
|
||||
|
||||
<!-- Toolbar -->
|
||||
<div class="toolbar"></div>
|
||||
|
||||
<!-- Open popup -->
|
||||
<div data-role="popup" id="popupOpen">
|
||||
<a href="#" data-rel="back" data-role="button" data-icon="delete"
|
||||
data-iconpos="notext" class="ui-btn-right" data-i18n="basics.close">Close</a>
|
||||
<div style="padding:10px 20px;">
|
||||
<h3 data-i18n="basics.open">Open</h3>
|
||||
<div id="dwv-loaderlist"></div>
|
||||
</div>
|
||||
</div><!-- /popup -->
|
||||
|
||||
<!-- Layer Container -->
|
||||
<div class="layerContainer">
|
||||
<div class="dropBox"></div>
|
||||
<canvas class="imageLayer">Only for HTML5 compatible browsers...</canvas>
|
||||
<div class="drawDiv"></div>
|
||||
<div class="infoLayer">
|
||||
<div class="infotl info"></div>
|
||||
<div class="infotc infoc"></div>
|
||||
<div class="infotr info"></div>
|
||||
<div class="infocl infoc"></div>
|
||||
<div class="infocr infoc"></div>
|
||||
<div class="infobl info"></div>
|
||||
<div class="infobc infoc"></div>
|
||||
<div class="infobr info"></div>
|
||||
</div><!-- /infoLayer -->
|
||||
</div><!-- /layerContainer -->
|
||||
|
||||
<!-- History -->
|
||||
<div class="history" title="History" style="display:none;"></div>
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
<div data-role="footer">
|
||||
<div data-role="navbar" class="toolList">
|
||||
</div><!-- /navbar -->
|
||||
</div><!-- /footer -->
|
||||
|
||||
</div><!-- /page main -->
|
||||
|
||||
</div><!-- /dwv -->
|
||||
|
||||
<!-- Tags page -->
|
||||
<div data-role="page" data-theme="b" id="tags_page">
|
||||
|
||||
<div data-role="header">
|
||||
<a href="#main" data-icon="back" data-transition="slide"
|
||||
data-direction="reverse" data-i18n="basics.back">Back</a>
|
||||
<h1 data-i18n="basics.dicomTags">DICOM Tags</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div data-role="content">
|
||||
<!-- Tags -->
|
||||
<div id="dwv-tags" title="Tags"></div>
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page tags_page-->
|
||||
|
||||
<!-- Draw list page -->
|
||||
<div data-role="page" data-theme="b" id="drawList_page">
|
||||
|
||||
<div data-role="header">
|
||||
<a href="#main" data-icon="back" data-transition="slide"
|
||||
data-direction="reverse" data-i18n="basics.back">Back</a>
|
||||
<h1 data-i18n="basics.drawList">Draw list</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div data-role="content">
|
||||
<!-- DrawList -->
|
||||
<div id="dwv-drawList" title="Draw list"></div>
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page draw-list_page-->
|
||||
|
||||
<!-- Help page -->
|
||||
<div data-role="page" data-theme="b" id="help_page">
|
||||
|
||||
<div data-role="header">
|
||||
<a href="#main" data-icon="back" data-transition="slide"
|
||||
data-direction="reverse" data-i18n="basics.back">Back</a>
|
||||
<h1 data-i18n="basics.help">Help</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div data-role="content">
|
||||
<!-- Help -->
|
||||
<div id="dwv-help" title="Help"></div>
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page help_page-->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
]])
|
||||
213
nv/html/dwv/resources/conquest/dwv-simple.lua
Normal file
@@ -0,0 +1,213 @@
|
||||
--
|
||||
-- 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-simple.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([[
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>DICOM Web Viewer</title>
|
||||
<meta charset="UTF-8">
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/ext/jquery-mobile/jquery.mobile-1.4.5.min.css">
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Third party (dwv) -->
|
||||
<script type="text/javascript" src="/dwv/ext/modernizr/modernizr.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18next.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18nextXHRBackend.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18nextBrowserLanguageDetector.min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Third party (viewer) -->
|
||||
<script type="text/javascript" src="/dwv/ext/jquery/jquery-2.1.4.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/jquery-mobile/jquery.mobile-1.4.5.min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Decoders -->
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/jpx.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/util.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/arithmetic_decoder.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/jpg.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/rii-mango/lossless-min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Local -->
|
||||
<script type="text/javascript" src="/dwv/dwv-0.23.0-beta.min.js"></script>
|
||||
<!-- Launch the app -->
|
||||
<script type="text/javascript" src="/dwv/viewers/simple/appgui.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<script type="text/javascript">
|
||||
// start app function
|
||||
function startApp() {
|
||||
// main application
|
||||
var myapp = new dwv.App();
|
||||
// initialise the application
|
||||
myapp.init({
|
||||
"containerDivId": "dwv",
|
||||
"fitToWindow": true,
|
||||
"tools": ["Scroll", "ZoomAndPan", "WindowLevel"],
|
||||
"gui": ["tool"],
|
||||
"isMobile": true,
|
||||
"skipLoadUrl": true
|
||||
});
|
||||
dwv.gui.appendResetHtml(myapp);
|
||||
]])
|
||||
-- create javascript url array
|
||||
print([[
|
||||
var inputUrls = [
|
||||
]])
|
||||
for i=1, #images do
|
||||
print(' "'..urls[i]..'",')
|
||||
end
|
||||
print([[
|
||||
];
|
||||
]])
|
||||
-- load data
|
||||
print([[
|
||||
if( inputUrls && inputUrls.length > 0 ) myapp.loadURLs(inputUrls);
|
||||
}; // end startApp
|
||||
]])
|
||||
|
||||
print([[
|
||||
// check browser support
|
||||
dwv.browser.check();
|
||||
// initialise i18n
|
||||
dwv.i18nInitialise("en","/dwv");
|
||||
]])
|
||||
|
||||
print([[
|
||||
// status flags
|
||||
var domContentLoaded = false;
|
||||
var i18nInitialised = false;
|
||||
// launch when both DOM and i18n are ready
|
||||
function launchApp() {
|
||||
if ( domContentLoaded && i18nInitialised ) {
|
||||
startApp();
|
||||
}
|
||||
}
|
||||
// DOM ready?
|
||||
$(document).ready( function() {
|
||||
domContentLoaded = true;
|
||||
launchApp();
|
||||
});
|
||||
// i18n ready?
|
||||
dwv.i18nOnInitialised( function () {
|
||||
i18nInitialised = true;
|
||||
launchApp();
|
||||
});
|
||||
]])
|
||||
|
||||
print([[
|
||||
</script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Main page -->
|
||||
<div data-role="page" data-theme="b">
|
||||
|
||||
<!-- Main content -->
|
||||
<div data-role="content">
|
||||
|
||||
<!-- DWV -->
|
||||
<div id="dwv">
|
||||
|
||||
<!-- Toolbar -->
|
||||
<div class="toolbar"></div>
|
||||
|
||||
<!-- Layer Container -->
|
||||
<div class="layerContainer">
|
||||
<canvas class="imageLayer">Only for HTML5 compatible browsers...</canvas>
|
||||
</div><!-- /layerContainer -->
|
||||
|
||||
</div><!-- /dwv -->
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
]])
|
||||
298
nv/html/dwv/resources/conquest/dwv-static.lua
Normal file
@@ -0,0 +1,298 @@
|
||||
--
|
||||
-- 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([[
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>DICOM Web Viewer</title>
|
||||
<meta charset="UTF-8">
|
||||
]])
|
||||
|
||||
print([[
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/css/style.css">
|
||||
<style type="text/css" >
|
||||
body { background-color: #222; color: white; font-size: 80%; }
|
||||
#pageHeader h1 { display: inline-block; margin: 0; color: #fff; }
|
||||
#pageHeader a { color: #ddf; }
|
||||
#pageHeader .toolbar { display: inline-block; float: right; }
|
||||
.toolList ul { padding: 0; }
|
||||
.toolList li { list-style-type: none; }
|
||||
#pageMain { position: absolute; height: 92%; width: 99%; bottom: 5px; left: 5px; background-color: #333; }
|
||||
.infotl { text-shadow: 0 1px 0 #000; }
|
||||
.infotc { text-shadow: 0 1px 0 #000; }
|
||||
.infotr { text-shadow: 0 1px 0 #000; }
|
||||
.infocl { text-shadow: 0 1px 0 #000; }
|
||||
.infocr { text-shadow: 0 1px 0 #000; }
|
||||
.infobl { text-shadow: 0 1px 0 #000; }
|
||||
.infobc { text-shadow: 0 1px 0 #000; }
|
||||
.infobr { text-shadow: 0 1px 0 #000; }
|
||||
.dropBox { margin: 20px; }
|
||||
.ui-icon { zoom: 125%; }
|
||||
.tagsTable tr:nth-child(even) { background-color: #333; }
|
||||
.drawList tr:nth-child(even) { background-color: #333; }
|
||||
button, input, li, table { margin-top: 0.2em; }
|
||||
li button, li input { margin: 0; }
|
||||
.history_list { width: 100%; }
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="/dwv/ext/jquery-ui/themes/ui-darkness/jquery-ui-1.12.1.min.css">
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Third party (dwv) -->
|
||||
<script type="text/javascript" src="/dwv/ext/modernizr/modernizr.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18next.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18nextXHRBackend.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/i18next/i18nextBrowserLanguageDetector.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/konva/konva.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/magic-wand/magic-wand.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/jszip/jszip.min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Third party (viewer) -->
|
||||
<script type="text/javascript" src="/dwv/ext/jquery/jquery-2.1.4.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/jquery-ui/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/dwv/ext/flot/jquery.flot.min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Decoders -->
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/jpx.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/util.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/arithmetic_decoder.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/pdfjs/jpg.js"></script>
|
||||
<script type="text/javascript" src="/dwv/decoders/rii-mango/lossless-min.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<!-- Local -->
|
||||
<script type="text/javascript" src="/dwv/dwv-0.23.0-beta.min.js"></script>
|
||||
<!-- Launch the app -->
|
||||
<script type="text/javascript" src="/dwv/viewers/static/appgui.js"></script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
<script type="text/javascript">
|
||||
// start app function
|
||||
function startApp() {
|
||||
// gui setup
|
||||
dwv.gui.setup();
|
||||
// main application
|
||||
var myapp = new dwv.App();
|
||||
// initialise the application
|
||||
myapp.init({
|
||||
"containerDivId": "dwv",
|
||||
"fitToWindow": true,
|
||||
"gui": ["tool", "load", "help", "undo", "version", "tags", "drawList"],
|
||||
"loaders": ["File", "Url"],
|
||||
"tools": ["Scroll", "WindowLevel", "ZoomAndPan", "Draw", "Livewire", "Filter", "Floodfill"],
|
||||
"filters": ["Threshold", "Sharpen", "Sobel"],
|
||||
"shapes": ["Arrow", "Ruler", "Protractor", "Rectangle", "Roi", "Ellipse", "FreeHand"],
|
||||
"isMobile": false,
|
||||
"skipLoadUrl": true
|
||||
});
|
||||
// help
|
||||
// TODO Seems accordion only works when at end...
|
||||
$("#accordion").accordion({ collapsible: "true", active: "false", heightStyle: "content" });
|
||||
]])
|
||||
-- create javascript url array
|
||||
print([[
|
||||
var inputUrls = [
|
||||
]])
|
||||
for i=1, #images do
|
||||
print(' "'..urls[i]..'",')
|
||||
end
|
||||
print([[
|
||||
];
|
||||
]])
|
||||
-- load data
|
||||
print([[
|
||||
if( inputUrls && inputUrls.length > 0 ) myapp.loadURLs(inputUrls);
|
||||
}; // end startApp
|
||||
]])
|
||||
|
||||
print([[
|
||||
// check browser support
|
||||
dwv.browser.check();
|
||||
// initialise i18n
|
||||
dwv.i18nInitialise("en","/dwv");
|
||||
]])
|
||||
|
||||
print([[
|
||||
// status flags
|
||||
var domContentLoaded = false;
|
||||
var i18nInitialised = false;
|
||||
// launch when both DOM and i18n are ready
|
||||
function launchApp() {
|
||||
if ( domContentLoaded && i18nInitialised ) {
|
||||
startApp();
|
||||
}
|
||||
}
|
||||
// DOM ready?
|
||||
$(document).ready( function() {
|
||||
domContentLoaded = true;
|
||||
launchApp();
|
||||
});
|
||||
// i18n ready?
|
||||
dwv.i18nOnInitialised( function () {
|
||||
// call next once the overlays are loaded
|
||||
var onLoaded = function (data) {
|
||||
dwv.gui.info.overlayMaps = data;
|
||||
i18nInitialised = true;
|
||||
launchApp();
|
||||
};
|
||||
// load overlay map info
|
||||
$.getJSON( dwv.i18nGetLocalePath("overlays.json"), onLoaded )
|
||||
.fail( function () {
|
||||
console.log("Using fallback overlays.");
|
||||
$.getJSON( dwv.i18nGetFallbackLocalePath("overlays.json"), onLoaded );
|
||||
});
|
||||
});
|
||||
]])
|
||||
|
||||
print([[
|
||||
</script>
|
||||
]])
|
||||
|
||||
print([[
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- DWV -->
|
||||
<div id="dwv">
|
||||
|
||||
<div id="pageHeader">
|
||||
|
||||
<!-- Title -->
|
||||
<h1>DWV <span class="dwv-version"></span></h1>
|
||||
|
||||
<!-- Toolbar -->
|
||||
<div class="toolbar"></div>
|
||||
|
||||
</div><!-- /pageHeader -->
|
||||
|
||||
<div id="pageMain">
|
||||
|
||||
<!-- Open file -->
|
||||
<div class="openData" title="File">
|
||||
<div class="loaderlist"></div>
|
||||
<div id="progressbar"></div>
|
||||
</div>
|
||||
|
||||
<!-- Toolbox -->
|
||||
<div class="toolList" title="Toolbox"></div>
|
||||
|
||||
<!-- History -->
|
||||
<div class="history" title="History"></div>
|
||||
|
||||
<!-- Tags -->
|
||||
<div class="tags" title="Tags"></div>
|
||||
|
||||
<!-- DrawList -->
|
||||
<div class="drawList" title="Draw list"></div>
|
||||
|
||||
<!-- Help -->
|
||||
<div class="help" title="Help"></div>
|
||||
|
||||
<!-- Layer Container -->
|
||||
<div class="layerDialog" title="Image">
|
||||
<div class="dropBox"></div>
|
||||
<div class="layerContainer">
|
||||
<canvas class="imageLayer">Only for HTML5 compatible browsers...</canvas>
|
||||
<div class="drawDiv"></div>
|
||||
<div class="infoLayer">
|
||||
<div class="infotl"></div>
|
||||
<div class="infotc"></div>
|
||||
<div class="infotr"></div>
|
||||
<div class="infocl"></div>
|
||||
<div class="infocr"></div>
|
||||
<div class="infobl"></div>
|
||||
<div class="infobc"></div>
|
||||
<div class="infobr" style="bottom: 64px;"></div>
|
||||
<div class="plot"></div>
|
||||
</div><!-- /infoLayer -->
|
||||
</div><!-- /layerContainer -->
|
||||
</div><!-- /layerDialog -->
|
||||
|
||||
</div><!-- /pageMain -->
|
||||
|
||||
</div><!-- /dwv -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
]])
|
||||
18
nv/html/dwv/resources/doc/jsdoc.conf.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"templates": {
|
||||
"systemName" : "dwv",
|
||||
"footer" : "",
|
||||
"copyright" : "",
|
||||
"includeDate" : true,
|
||||
"navType" : "inline",
|
||||
"theme" : "yeti",
|
||||
"linenums" : true,
|
||||
"collapseSymbols" : false,
|
||||
"inverseNav" : true,
|
||||
"outputSourceFiles" : true,
|
||||
"outputSourcePath" : true,
|
||||
"dateFormat" : "dddd, MMMM Do YYYY",
|
||||
"syntaxTheme" : "default",
|
||||
"sort" : true
|
||||
}
|
||||
}
|
||||
5
nv/html/dwv/resources/doc/readme-doc.md
Normal file
@@ -0,0 +1,5 @@
|
||||
This is the DWV code documentation.
|
||||
|
||||
DWV (DICOM Web Viewer) is an open source zero footprint medical image viewer. It uses _only_ javascript and HTML5 technologies, meaning that it can be run on any platform that provides a modern browser (laptop, tablet, phone and even modern TVs). It can load local or remote data in DICOM format (the standard for medical imaging data such as MR, CT, Echo, Mammo, NM...) and provides standard tools for its manipulation such as contrast, zoom, drag, possibility to draw regions on top of the image and imaging filters such as threshold and sharpening.
|
||||
|
||||
The DWV home page is [github.com/ivmartel/dwv](https://github.com/ivmartel/dwv).
|
||||
BIN
nv/html/dwv/resources/help/click.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
nv/html/dwv/resources/help/double_click.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
nv/html/dwv/resources/help/double_tap.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
nv/html/dwv/resources/help/mouse_drag.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
nv/html/dwv/resources/help/mouse_wheel.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
nv/html/dwv/resources/help/tap.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
nv/html/dwv/resources/help/tap_and_hold.png
Normal file
|
After Width: | Height: | Size: 955 B |
BIN
nv/html/dwv/resources/help/touch_drag.png
Normal file
|
After Width: | Height: | Size: 1014 B |
BIN
nv/html/dwv/resources/help/twotouch_drag.png
Normal file
|
After Width: | Height: | Size: 911 B |
BIN
nv/html/dwv/resources/help/twotouch_pinch.png
Normal file
|
After Width: | Height: | Size: 756 B |
BIN
nv/html/dwv/resources/icons/dwv-128.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nv/html/dwv/resources/icons/dwv-16.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
nv/html/dwv/resources/icons/dwv-32.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
nv/html/dwv/resources/icons/dwv-60.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
nv/html/dwv/resources/icons/dwv-90.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
nv/html/dwv/resources/img/contrast-64.png
Normal file
|
After Width: | Height: | Size: 332 B |
59
nv/html/dwv/resources/module/intro.js
Normal file
@@ -0,0 +1,59 @@
|
||||
// Inspired from umdjs
|
||||
// See https://github.com/umdjs/umd/blob/master/templates/returnExports.js
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([
|
||||
'modernizr',
|
||||
'i18next',
|
||||
'i18nextXHRBackend',
|
||||
'i18nextBrowserLanguageDetector',
|
||||
'jszip',
|
||||
'konva',
|
||||
''
|
||||
], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
|
||||
// i18next-xhr-backend: requires XMlHttpRequest
|
||||
// Konva: requires 'canvas' -> deactivated for now...
|
||||
// MagicWand: no package -> deactivated
|
||||
|
||||
module.exports = factory(
|
||||
require('modernizr'),
|
||||
require('i18next'),
|
||||
require('i18next-xhr-backend'),
|
||||
require('i18next-browser-languagedetector'),
|
||||
require('jszip'),
|
||||
null,
|
||||
null
|
||||
);
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.dwv = factory(
|
||||
root.Modernizr,
|
||||
root.i18next,
|
||||
root.i18nextXHRBackend,
|
||||
root.i18nextBrowserLanguageDetector,
|
||||
root.JSZip,
|
||||
root.Konva,
|
||||
root.MagicWand
|
||||
);
|
||||
}
|
||||
}(this, function (
|
||||
Modernizr,
|
||||
i18next,
|
||||
i18nextXHRBackend,
|
||||
i18nextBrowserLanguageDetector,
|
||||
JSZip,
|
||||
Konva,
|
||||
MagicWand) {
|
||||
|
||||
// similar to what browserify does but reversed
|
||||
//https://www.contentful.com/blog/2017/01/17/the-global-object-in-javascript/
|
||||
var window = typeof window !== 'undefined' ?
|
||||
window : typeof self !== 'undefined' ?
|
||||
self : typeof global !== 'undefined' ?
|
||||
global : {};
|
||||
2
nv/html/dwv/resources/module/outro.js
Normal file
@@ -0,0 +1,2 @@
|
||||
return dwv;
|
||||
}));
|
||||
10
nv/html/dwv/resources/readme.md
Normal file
@@ -0,0 +1,10 @@
|
||||
Resources
|
||||
=========
|
||||
|
||||
* `conquest`: Conquest PACS lua files.
|
||||
* `doc`: dwv doc resources.
|
||||
* `help`: dwv help resources. The touch icons are modified versions of a theme set by P.J. Onori found on [icon finder](https://www.iconfinder.com/iconsets/cue).
|
||||
* `icons`: dwv icons.
|
||||
* `img`: misc images.
|
||||
* `module`: javascript module scripts.
|
||||
* `scripts`: apps and update scripts.
|
||||
20
nv/html/dwv/resources/scripts/chrome-background.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/* global chrome */
|
||||
|
||||
// local chrome app setting
|
||||
// Goes in pair with a simple manifest.json including name, description,
|
||||
// version, icons and this:
|
||||
//
|
||||
// "app": {
|
||||
// "background": {
|
||||
// "scripts": ["/resources/scripts/chrome-background.js"]
|
||||
// }
|
||||
// },
|
||||
|
||||
chrome.app.runtime.onLaunched.addListener(function() {
|
||||
chrome.app.window.create('../viewers/mobile/index.html', {
|
||||
'bounds': {
|
||||
'width': 1100,
|
||||
'height': 800
|
||||
}
|
||||
});
|
||||
});
|
||||
19
nv/html/dwv/resources/scripts/manifest.webapp
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "dwv",
|
||||
"description": "DICOM Web Viewer.",
|
||||
"version": "0.23.0-beta",
|
||||
"developer": {
|
||||
"name": "ivmartel",
|
||||
"url": "https://github.com/ivmartel"
|
||||
},
|
||||
"default_locale": "en",
|
||||
"launch_path": "/dwv/demo/stable/viewers/mobile/index.html",
|
||||
"appcache_path": "/dwv/demo/stable/viewers/mobile/cache.manifest",
|
||||
"icons": {
|
||||
"16": "/dwv/demo/stable/resources/icons/dwv-16.png",
|
||||
"32": "/dwv/demo/stable/resources/icons/dwv-32.png",
|
||||
"60": "/dwv/demo/stable/resources/icons/dwv-60.png",
|
||||
"90": "/dwv/demo/stable/resources/icons/dwv-90.png",
|
||||
"128": "/dwv/demo/stable/resources/icons/dwv-128.png"
|
||||
}
|
||||
}
|
||||
26
nv/html/dwv/resources/scripts/update-gh-pages.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
#Script to push build results on the repository gh-pages branch.
|
||||
|
||||
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
echo -e "Starting to update gh-pages\n"
|
||||
#copy data we're interested in to other place
|
||||
cp -R build $HOME/built
|
||||
#go to home and setup git
|
||||
cd $HOME
|
||||
git config --global user.email "travis@travis-ci.org"
|
||||
git config --global user.name "Travis"
|
||||
#using token clone gh-pages branch
|
||||
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/ivmartel/dwv.git gh-pages > /dev/null
|
||||
#go into directory and copy data we're interested in to that directory
|
||||
cd gh-pages
|
||||
#clean doc dir
|
||||
rm -Rf demo/trunk/doc/*
|
||||
#copy new build
|
||||
cp -Rf $HOME/built/dist/* demo/trunk
|
||||
cp -Rf $HOME/built/doc demo/trunk
|
||||
#add, commit and push files
|
||||
git add -Af .
|
||||
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
|
||||
git push -fq origin gh-pages > /dev/null
|
||||
echo -e "Done updating.\n"
|
||||
fi
|
||||