comparison ViewerPlugin/OrthancExplorer.js @ 0:4a7a53257c7d

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 22 Oct 2016 21:48:33 +0200
parents
children a40295af8771
comparison
equal deleted inserted replaced
-1:000000000000 0:4a7a53257c7d
1 $('#series').live('pagebeforeshow', function() {
2 var seriesId = $.mobile.pageData.uuid;
3
4 $('#wsi-button').remove();
5
6 // Test whether this is a whole-slide image by check the SOP Class
7 // UID of one instance of the series
8 GetResource('/series/' + seriesId, function(series) {
9 GetResource('/instances/' + series['Instances'][0] + '/tags?simplify', function(instance) {
10 console.log(instance['SOPClassUID']);
11
12 if (instance['SOPClassUID'] == '1.2.840.10008.5.1.4.1.1.77.1.6') {
13
14 // This is a whole-slide image, register the button
15 var b = $('<a>')
16 .attr('id', 'wsi-button')
17 .attr('data-role', 'button')
18 .attr('href', '#')
19 .attr('data-icon', 'search')
20 .attr('data-theme', 'e')
21 .text('Whole-Slide Imaging Viewer')
22 .button();
23
24 b.insertAfter($('#series-info'));
25 b.click(function() {
26 if ($.mobile.pageData) {
27 window.open('../wsi/app/viewer.html?series=' + seriesId);
28 }
29 });
30
31 }
32 });
33 });
34 });