Commit 8c5fc71ba632e0c754300c93b6706b4a10493790
1 parent
719175ec
Single Extract is working in both mirror and non mirror.
Showing
2 changed files
with
36 additions
and
34 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -63,6 +63,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
63 | 63 | $rootScope.whiteImageDataList = []; |
64 | 64 | $rootScope.whiteImageMRDataList = []; |
65 | 65 | $rootScope.previousHighlightList = []; |
66 | + $rootScope.updatedWhiteImageDataList = []; | |
67 | + $rootScope.updatedWhiteImageMRDataList = []; | |
66 | 68 | |
67 | 69 | //normal mode |
68 | 70 | $rootScope.isNormalMode = false; |
... | ... | @@ -1052,6 +1054,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1052 | 1054 | } |
1053 | 1055 | |
1054 | 1056 | $rootScope.previousHighlightList.push(RGBColor); |
1057 | + | |
1055 | 1058 | $scope.highLightBodyBasedOnIcolor(RGBColor); |
1056 | 1059 | } |
1057 | 1060 | |
... | ... | @@ -1143,9 +1146,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1143 | 1146 | if (document.getElementById('canvasDiv') != null) |
1144 | 1147 | document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); |
1145 | 1148 | |
1146 | - | |
1147 | - | |
1148 | - | |
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { |
... | ... | @@ -1296,22 +1296,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1296 | 1296 | |
1297 | 1297 | var grayImageDataMR = $rootScope.grayImageMRDataList[bodyRegionId]; |
1298 | 1298 | |
1299 | - grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0) | |
1299 | + grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0); | |
1300 | + | |
1301 | + | |
1300 | 1302 | } |
1301 | 1303 | |
1302 | 1304 | } |
1303 | 1305 | } |
1304 | 1306 | } |
1305 | - | |
1306 | - $rootScope.previousHighlightList.push(RGBColor); | |
1307 | - | |
1308 | - | |
1309 | - //var previousIcolor = RGBColor; | |
1310 | - // $scope.previousSelectedTermList.push(previousIcolor); | |
1307 | + $rootScope.previousHighlightList.push(RGBColor); | |
1308 | + | |
1311 | 1309 | |
1312 | 1310 | if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { } |
1313 | 1311 | else |
1312 | + { | |
1314 | 1313 | $scope.highLightBodyBasedOnIcolor(RGBColor); |
1314 | + } | |
1315 | 1315 | |
1316 | 1316 | } |
1317 | 1317 | |
... | ... | @@ -1448,7 +1448,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1448 | 1448 | |
1449 | 1449 | if ($scope.multiAnnotationIsON == true) { |
1450 | 1450 | |
1451 | - white = $rootScope.updatedImageMRDataList[bodyRegionId] | |
1451 | + white = $rootScope.updatedWhiteImageMRDataList[bodyRegionId] | |
1452 | 1452 | } |
1453 | 1453 | else |
1454 | 1454 | white = $rootScope.whiteImageMRDataList[bodyRegionId]; |
... | ... | @@ -1460,7 +1460,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1460 | 1460 | |
1461 | 1461 | if ($scope.multiAnnotationIsON == true) { |
1462 | 1462 | |
1463 | - grayImageDataVar = $rootScope.updatedImageDataList[bodyRegionId - 1] | |
1463 | + white = $rootScope.updatedWhiteImageDataList[bodyRegionId - 1] | |
1464 | 1464 | } |
1465 | 1465 | else |
1466 | 1466 | { |
... | ... | @@ -1488,7 +1488,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1488 | 1488 | //} |
1489 | 1489 | |
1490 | 1490 | worker.onmessage = function (e) { |
1491 | - console.log('callback for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); | |
1491 | + console.log('callback in extract for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); | |
1492 | 1492 | |
1493 | 1493 | |
1494 | 1494 | var updatedData = e.data.value; |
... | ... | @@ -1512,9 +1512,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1512 | 1512 | // worker.terminate(); |
1513 | 1513 | |
1514 | 1514 | if (canvasId.match('_MR')) |
1515 | - $rootScope.grayImageMRDataListCurrent[bodyRegionId] = updatedData; | |
1515 | + $rootScope.whiteImageMRDataList[bodyRegionId] = e.data.value; | |
1516 | 1516 | else |
1517 | - $rootScope.grayImageDataListCurrent[bodyRegionId - 1] = updatedData; | |
1517 | + $rootScope.whiteImageDataList[bodyRegionId - 1] = e.data.value; | |
1518 | 1518 | |
1519 | 1519 | }; |
1520 | 1520 | worker.onerror = function (e) { |
... | ... | @@ -1606,11 +1606,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1606 | 1606 | |
1607 | 1607 | worker.onmessage = function (e) { |
1608 | 1608 | console.log('callback for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); |
1609 | - | |
1610 | - debugger; | |
1611 | - | |
1612 | - var highlightedPortion; | |
1613 | - | |
1609 | + | |
1614 | 1610 | var updatedData = e.data.value; |
1615 | 1611 | |
1616 | 1612 | var bodyRegionId = e.data.bodyRegionId; |
... | ... | @@ -1632,11 +1628,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1632 | 1628 | |
1633 | 1629 | if (canvasId.match('_MR')) { |
1634 | 1630 | $rootScope.grayImageMRDataListCurrent[bodyRegionId] = updatedData; |
1635 | - $rootScope.whiteImageMRDataList[bodyRegionId] = updatedData; | |
1631 | + // $rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData; | |
1636 | 1632 | } |
1637 | 1633 | else |
1638 | 1634 | $rootScope.grayImageDataListCurrent[bodyRegionId - 1] = updatedData; |
1639 | - $rootScope.whiteImageDataList[bodyRegionId - 1] = updatedData; | |
1635 | + // $rootScope.updatedWhiteImageMRDataList[bodyRegionId - 1] = updatedData; | |
1640 | 1636 | |
1641 | 1637 | }; |
1642 | 1638 | worker.onerror = function (e) { |
... | ... | @@ -3657,10 +3653,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3657 | 3653 | |
3658 | 3654 | } |
3659 | 3655 | |
3660 | - $scope.enableExtract = function () { | |
3661 | - // alert('extract called'); | |
3656 | + $scope.enableExtract = function () | |
3657 | + { | |
3658 | + | |
3662 | 3659 | |
3663 | - //debugger; | |
3660 | + var workerCount = $scope.runningWorkers.length; | |
3661 | + if (workerCount > 0) { | |
3662 | + for (var i = workerCount - 1; i >= 0; i--) { | |
3663 | + var runningWorker = $scope.runningWorkers[i].workerName; | |
3664 | + runningWorker.terminate(); | |
3665 | + $scope.runningWorkers.splice(i, 1); | |
3666 | + // workerCount--; | |
3667 | + } | |
3668 | + } | |
3664 | 3669 | |
3665 | 3670 | if ($rootScope.isExtract == true) { |
3666 | 3671 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/extract-wp.js
1 | -var doneBRID = []; | |
1 | +var UpdatedGrayImageDataList = []; | |
2 | +var doneBRID = []; | |
2 | 3 | var abc = 'hello'; |
3 | -var previousGrayImageDataList = []; | |
4 | +previousGrayImageDataList = []; | |
4 | 5 | getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) { |
5 | - // console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) | |
6 | + console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) | |
6 | 7 | var matchedRGBLocationInBodyRegion = []; |
7 | 8 | var matched; |
8 | 9 | |
9 | - // debugger; | |
10 | + console.log(grayImageData) | |
10 | 11 | var n = maskCanvasData.data.length; |
11 | 12 | var maskData = maskCanvasData.data; |
12 | 13 | for (var z = 0; z < termList.length; z++) { |
... | ... | @@ -15,11 +16,7 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo |
15 | 16 | grayImageData = previousGrayImageDataList[parseInt(bodyRegionId - 1)]; |
16 | 17 | |
17 | 18 | } |
18 | - | |
19 | - var grayImageDataVar; | |
20 | - if (grayImageData != null) { | |
21 | - grayImageDataVar = grayImageData.data; | |
22 | - } | |
19 | + var grayImageDataVar = grayImageData.data; | |
23 | 20 | var coloredImageDataVar = coloredImageData.data; |
24 | 21 | |
25 | 22 | for (var i = 0; i < n; i += 4) { | ... | ... |