Mercurial > hg > orthanc-stone
comparison Applications/StoneWebViewer/WebApplication/app.js @ 1681:f2e8b3ac1dcd
handling multiple windowing presets in the Stone web viewer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 24 Nov 2020 18:08:07 +0100 |
parents | 51bab5188a13 |
children | 4a49de03a419 |
comparison
equal
deleted
inserted
replaced
1680:03afa09cfcf1 | 1681:f2e8b3ac1dcd |
---|---|
298 viewport4Left: '0%', | 298 viewport4Left: '0%', |
299 viewport4Top: '0%', | 299 viewport4Top: '0%', |
300 viewport4Visible: false, | 300 viewport4Visible: false, |
301 viewport4Series: {}, | 301 viewport4Series: {}, |
302 | 302 |
303 showWindowing: false, | |
304 windowingPresets: [], | |
305 | |
303 series: [], | 306 series: [], |
304 studies: [], | 307 studies: [], |
305 seriesIndex: {} // Maps "SeriesInstanceUID" to "index in this.series" | 308 seriesIndex: {} // Maps "SeriesInstanceUID" to "index in this.series" |
306 } | 309 } |
307 }, | 310 }, |
615 } | 618 } |
616 } | 619 } |
617 }, | 620 }, |
618 | 621 |
619 SetWindowing: function(center, width) { | 622 SetWindowing: function(center, width) { |
623 this.showWindowing = false; | |
620 var canvas = this.GetActiveCanvas(); | 624 var canvas = this.GetActiveCanvas(); |
621 if (canvas != '') { | 625 if (canvas != '') { |
622 stone.SetWindowing(canvas, center, width); | 626 stone.SetWindowing(canvas, center, width); |
623 } | |
624 }, | |
625 | |
626 SetPresetWindowing: function() { | |
627 var canvas = this.GetActiveCanvas(); | |
628 if (canvas != '') { | |
629 stone.SetPresetWindowing(canvas); | |
630 } | 627 } |
631 }, | 628 }, |
632 | 629 |
633 InvertContrast: function() { | 630 InvertContrast: function() { |
634 var canvas = this.GetActiveCanvas(); | 631 var canvas = this.GetActiveCanvas(); |
676 this.SetViewportLayout('1x1'); | 673 this.SetViewportLayout('1x1'); |
677 this.leftVisible = false; | 674 this.leftVisible = false; |
678 this.SetViewportSeriesInstanceUid(1, seriesInstanceUid); | 675 this.SetViewportSeriesInstanceUid(1, seriesInstanceUid); |
679 | 676 |
680 stone.FocusFirstOsiriXAnnotation('canvas1'); | 677 stone.FocusFirstOsiriXAnnotation('canvas1'); |
678 } | |
679 }, | |
680 | |
681 ToggleWindowing: function() | |
682 { | |
683 if (this.showWindowing) | |
684 { | |
685 this.showWindowing = false; | |
686 } | |
687 else | |
688 { | |
689 stone.LoadWindowingPresets(this.GetActiveCanvas()); | |
690 this.windowingPresets = JSON.parse(stone.GetStringBuffer()); | |
691 | |
692 var p = $('#windowing-popover').last(); | |
693 var top = p.offset().top + p.height() + 10; | |
694 $('#windowing-content').css('top', top); | |
695 //$('#windowing-content').css('right', '10'); | |
696 //$('#windowing-content').css('left', 'auto'); | |
697 | |
698 this.showWindowing = true; | |
681 } | 699 } |
682 } | 700 } |
683 }, | 701 }, |
684 | 702 |
685 mounted: function() { | 703 mounted: function() { |
781 }); | 799 }); |
782 | 800 |
783 //app.modalWarning = true; | 801 //app.modalWarning = true; |
784 | 802 |
785 | 803 |
786 $('#windowing-popover').popover({ | |
787 container: 'body', | |
788 content: $('#windowing-content').html(), | |
789 template: '<div class="popover wvToolbar__windowingPresetConfigPopover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>', | |
790 placement: 'auto', | |
791 html: true, | |
792 sanitize: false, | |
793 trigger: 'focus' // Close on click | |
794 }); | |
795 | |
796 | |
797 var wasmSource = 'StoneWebViewer.js'; | 804 var wasmSource = 'StoneWebViewer.js'; |
798 | 805 |
799 // Option 1: Loading script using plain HTML | 806 // Option 1: Loading script using plain HTML |
800 | 807 |
801 /* | 808 /* |