comparison Applications/StoneWebViewer/WebApplication/app.js @ 2029:0cb8796c2a9b deep-learning

measure time for deep learning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Dec 2022 16:58:13 +0100
parents 04148de691a7
children a56f7ed0cdf9
comparison
equal deleted inserted replaced
2027:84ad648b86ac 2029:0cb8796c2a9b
604 studies: [], 604 studies: [],
605 seriesIndex: {}, // Maps "SeriesInstanceUID" to "index in this.series" 605 seriesIndex: {}, // Maps "SeriesInstanceUID" to "index in this.series"
606 virtualSeriesThumbnails: {}, 606 virtualSeriesThumbnails: {},
607 607
608 deepLearningReady: false, 608 deepLearningReady: false,
609 deepLearningProgress: 0 // Floating-point number in the range [0..1] 609 deepLearningProgress: 0, // Floating-point number in the range [0..1]
610 deepLearningStartTime: null
610 } 611 }
611 }, 612 },
612 computed: { 613 computed: {
613 getSelectedStudies() { 614 getSelectedStudies() {
614 var s = ''; 615 var s = '';
1292 }); 1293 });
1293 }, 1294 },
1294 1295
1295 ApplyDeepLearning: function() { 1296 ApplyDeepLearning: function() {
1296 stone.ApplyDeepLearningModel(this.GetActiveCanvas()); 1297 stone.ApplyDeepLearningModel(this.GetActiveCanvas());
1298 app.deepLearningStartTime = performance.now();
1297 }, 1299 },
1298 1300
1299 ChangeActiveSeries: function(offset) { 1301 ChangeActiveSeries: function(offset) {
1300 var seriesTags = this.GetActiveViewportSeriesTags(); 1302 var seriesTags = this.GetActiveViewportSeriesTags();
1301 if (seriesTags !== null) { 1303 if (seriesTags !== null) {
1732 app.deepLearningProgress = 0; 1734 app.deepLearningProgress = 0;
1733 }); 1735 });
1734 1736
1735 window.addEventListener('DeepLearningStep', function(args) { 1737 window.addEventListener('DeepLearningStep', function(args) {
1736 app.deepLearningProgress = args.detail.progress; 1738 app.deepLearningProgress = args.detail.progress;
1739 console.log('Elapsed time: ' + Math.round(performance.now() - app.deepLearningStartTime) + 'ms');
1737 }); 1740 });