Commit 7a445d63b1857c5d4c9ece1c8237cc498de1133b

Authored by Nikita Kulshreshtha
1 parent 84073353

higlight is working in mirror as well

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1069,38 +1069,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1069 1069 context.restore();
1070 1070  
1071 1071  
1072   - };
1073   -
1074   - if (document.getElementById('canvasDiv') != null)
1075   - document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
1076   -
  1072 + if (FlipedImgCanvas.id.match('_mci')) {
1077 1073  
  1074 + var maskImgData = context.getImageData(0, 0, w, h);
1078 1075  
1079   - if (FlipedImgCanvas.id.match('_mci')) {
  1076 + $scope.MaskCanvasData.push(
  1077 + {
  1078 + "bodyRegionId": bodyRegionId,
  1079 + "canvasId": FlipedImgCanvas.id,
  1080 + "maskData": maskImgData,
1080 1081  
1081   - var maskImgData = context.getImageData(0, 0, w, h);
  1082 + }
  1083 + );
  1084 + }
  1085 + };
1082 1086  
1083   - $scope.MaskCanvasData.push(
1084   - {
1085   - "bodyRegionId": bodyRegionId,
1086   - "canvasId": FlipedImgCanvas.id,
1087   - "maskData": maskImgData,
  1087 + if (document.getElementById('canvasDiv') != null)
  1088 + document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
1088 1089  
1089   - }
1090   - );
1091   - }
1092   - else {
1093   - var colorImgData = context.getImageData(0, 0, w, h);
1094   - $scope.ColoredCanvasData.push(
1095   - {
1096   - "bodyRegionId": bodyRegionId,
1097   - "canvasId": FlipedImgCanvas.id,
1098   - "coloredImageData": colorImgData.data,
1099 1090  
1100   - }
1101   - );
1102   - }
1103 1091  
  1092 +
1104 1093 }
1105 1094  
1106 1095 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
... ... @@ -1363,17 +1352,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1363 1352 }
1364 1353 );
1365 1354 }
1366   - else {
1367   - var colorImgData = context.getImageData(0, 0, w, h);
1368   - $scope.ColoredCanvasData.push(
1369   - {
1370   - "bodyRegionId": bodyRegionId,
1371   - "canvasId": imgCanvas.id,
1372   - "coloredImageData": colorImgData.data,
1373   -
1374   - }
1375   - );
1376   - }
  1355 +
1377 1356 };
1378 1357  
1379 1358 if (document.getElementById('canvasDiv')!=null)
... ... @@ -1435,11 +1414,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1435 1414 grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
1436 1415 }
1437 1416  
1438   - var coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1];
1439   - var grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
  1417 + //var coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1];
  1418 + //var grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
1440 1419  
1441 1420 var worker = new Worker('term-number-wp.js');
1442 1421  
  1422 + //push workers in array to further used the refernece to delete the workers
1443 1423 $scope.runningWorkers.push({'workerName':worker})
1444 1424  
1445 1425 // console.log('for bodyRegionId = ' + bodyRegionId+ ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
... ... @@ -1448,9 +1428,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1448 1428 'termList': TermList,
1449 1429 'maskCanvasData': maskData,
1450 1430 'coloredImageData': coloredImageDataVar,
1451   - 'coloredImageMRCanvasList': $rootScope.coloredImageMRCanvasList,
1452 1431 'grayImageData': grayImageDataVar,
1453   - 'grayImageMRDataList': $rootScope.grayImageMRDataList,
1454 1432 'bodyRegionId': bodyRegionId,
1455 1433 'canvasId': canvasId
1456 1434  
... ... @@ -1468,9 +1446,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1468 1446 var canvasId = (e.data.canvasId).replace('_mci','');
1469 1447 //debugger;
1470 1448 //for (var i = 1; i <= updatedData.length; i++) {
1471   - // var grayCanvasID = canvasId;
  1449 + var grayCanvasID = canvasId;
1472 1450  
1473   - var grayCanvasID = 'imageCanvas' + bodyRegionId;
  1451 + // var grayCanvasID = 'imageCanvas' + bodyRegionId;
1474 1452 var grayCanvas = document.getElementById(grayCanvasID);
1475 1453 var grayCanvasContext = grayCanvas.getContext("2d");
1476 1454  
... ...
400-SOURCECODE/AIAHTML5.Web/term-number-wp.js
... ... @@ -2,12 +2,12 @@
2 2 var doneBRID = [];
3 3 var abc = 'hello';
4 4 previousGrayImageDataList = [];
5   -getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, coloredImageMRCanvasList, grayImageData, grayImageMRDataList, bodyRegionId, canvasId) {
  5 +getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) {
6 6 // console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
7 7 var matchedRGBLocationInBodyRegion = [];
8 8 var matched;
9 9  
10   -
  10 + // debugger;
11 11 var n = maskCanvasData.data.length;
12 12 var maskData = maskCanvasData.data;
13 13 for (var z = 0; z < termList.length; z++) {
... ... @@ -57,7 +57,7 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo
57 57  
58 58 if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) {
59 59  
60   -
  60 + // debugger;
61 61  
62 62  
63 63 // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i });
... ... @@ -84,7 +84,7 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo
84 84  
85 85  
86 86 }
87   -
  87 + // debugger;
88 88 previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData;
89 89  
90 90 // if (matched == true) {
... ... @@ -103,7 +103,7 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo
103 103  
104 104 self.onmessage = function (e) {
105 105 getLocationForMatchedTermsInWholeBody(e.data.termList, e.data.maskCanvasData, e.data.coloredImageData,
106   - e.data.coloredImageMRCanvasList, e.data.grayImageData, e.data.grayImageMRDataList, e.data.bodyRegionId, e.data.canvasId);
  106 + e.data.grayImageData, e.data.bodyRegionId, e.data.canvasId);
107 107  
108 108 }
109 109  
... ...