Commit 1370b620ae5c4cf9c83bbfb23a9f40a53131be22

Authored by Amrita Vishnoi
1 parent 4bcfe6cc

multiExtract work in progress

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -40,13 +40,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
40 40 $rootScope.whiteImageDataList = [];
41 41 $rootScope.whiteImageMRDataList = [];
42 42  
43   - $rootScope.grayImageDataListCurrent = [];
44   - $rootScope.grayImageMRDataListCurrent = [];
  43 + $rootScope.updatedGrayDataList = [];
  44 + $rootScope.updatedGrayMRDataList = [];
  45 +
  46 + $rootScope.updatedWhiteDataList = [];
  47 + $rootScope.updatedWhiteMRDataList = [];
45 48  
46 49 $scope.zoomInOut = 75;
47 50 $scope.i = 0;
48 51 $scope.speachBubbleArray = [];
49   - $scope.multiAnnotationIsON = false;
  52 + $rootScope.multiAnnotationIsON = false;
50 53 $scope.previousGrayImageDataVar;
51 54 $scope.previousGrayCanvas;
52 55  
... ... @@ -904,10 +907,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
904 907 FlipedImgCanvas.addEventListener('click', function (evt) {
905 908  
906 909 if (evt.ctrlKey) {
907   - $scope.multiAnnotationIsON = true;
  910 + $rootScope.multiAnnotationIsON= true;
908 911 }
909 912 else {
910   - $scope.multiAnnotationIsON = false;
  913 + $rootScope.multiAnnotationIsON = false;
911 914 }
912 915  
913 916 //get mouse coordinate of mirror image click
... ... @@ -1114,8 +1117,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1114 1117 document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
1115 1118  
1116 1119  
1117   -
1118   -
1119 1120 }
1120 1121  
1121 1122 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
... ... @@ -1164,10 +1165,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1164 1165 imgCanvas.addEventListener('click', function (evt) {
1165 1166  
1166 1167 if (evt.ctrlKey) {
1167   - $scope.multiAnnotationIsON = true;
  1168 + $rootScope.multiAnnotationIsON= true;
1168 1169 }
1169 1170 else {
1170   - $scope.multiAnnotationIsON = false;
  1171 + $rootScope.multiAnnotationIsON = false;
1171 1172 }
1172 1173  
1173 1174 var annotationText;
... ... @@ -1273,6 +1274,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1273 1274  
1274 1275 $rootScope.previousHighlightList.push(RGBColor);
1275 1276  
  1277 + alert('previously highlighted data length: ' + $rootScope.previousHighlightList.length);
  1278 +
1276 1279 var previousIcolor = RGBColor; //ami
1277 1280 //var previousX;
1278 1281 // var previousY;
... ... @@ -1437,7 +1440,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1437 1440 var coloredImageDataVar;
1438 1441 var grayImageDataVar;
1439 1442  
1440   - var white;
  1443 + var whiteData;
1441 1444  
1442 1445 if (canvasId.match('_MR')) {
1443 1446 coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId];
... ... @@ -1447,16 +1450,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1447 1450 if ($rootScope.isExtract) {
1448 1451 if ($scope.multiAnnotationIsON == true) {
1449 1452  
1450   - grayImageDataVar = $rootScope.grayImageMRDataListCurrent[bodyRegionId]
  1453 + whiteData = $rootScope.updatedWhiteMRDataList[bodyRegionId]
1451 1454 }
1452 1455 else
1453   - white = $rootScope.whiteImageMRDataList[bodyRegionId];
  1456 + whiteData = $rootScope.whiteImageMRDataList[bodyRegionId];
1454 1457 }
1455 1458 else
1456 1459 {
1457 1460 if ($scope.multiAnnotationIsON == true) {
1458 1461  
1459   - grayImageDataVar = $rootScope.grayImageMRDataListCurrent[bodyRegionId]
  1462 + grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId]
1460 1463 }
1461 1464 else
1462 1465 grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
... ... @@ -1473,15 +1476,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1473 1476 if ($rootScope.isExtract) {
1474 1477 if ($scope.multiAnnotationIsON == true) {
1475 1478  
1476   - grayImageDataVar = $rootScope.grayImageDataListCurrent[bodyRegionId-1]
  1479 + whiteData = $rootScope.updatedWhiteDataList[bodyRegionId - 1]
  1480 +
  1481 + // alert('updatedWhiteDataList lenth: ' + updatedWhiteDataList.length + ' on multi highlight');
1477 1482 }
1478 1483 else
1479   - white = $rootScope.whiteImageDataList[bodyRegionId-1];
  1484 + whiteData = $rootScope.whiteImageDataList[bodyRegionId - 1];
1480 1485 }
1481 1486 else
1482 1487 {
1483 1488 if ($scope.multiAnnotationIsON == true) {
1484   - grayImageDataVar = $rootScope.grayImageDataListCurrent[bodyRegionId - 1]
  1489 + grayImageDataVar = $rootScope.updatedGrayDataList[bodyRegionId - 1]
1485 1490 }
1486 1491 else
1487 1492 grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
... ... @@ -1502,7 +1507,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1502 1507 'termList': TermList,
1503 1508 'maskCanvasData': maskData,
1504 1509 'coloredImageData': coloredImageDataVar,
1505   - 'grayImageData': white,
  1510 + 'grayImageData': whiteData,
1506 1511 'bodyRegionId': bodyRegionId,
1507 1512 'canvasId': canvasId
1508 1513  
... ... @@ -1554,10 +1559,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1554 1559  
1555 1560 // worker.terminate();
1556 1561  
1557   - if (canvasId.match('_MR'))
1558   - $rootScope.grayImageMRDataListCurrent[bodyRegionId] = updatedData;
  1562 +
  1563 + if($rootScope.isExtract == true)
  1564 + {
  1565 + if (canvasId.match('_MR'))
  1566 + $rootScope.updatedWhiteMRDataList[bodyRegionId] = updatedData;
  1567 + else
  1568 + $rootScope.updatedWhiteDataList[bodyRegionId - 1] = updatedData;
  1569 + }
1559 1570 else
1560   - $rootScope.grayImageDataListCurrent[bodyRegionId - 1] = updatedData;
  1571 + {
  1572 + if (canvasId.match('_MR'))
  1573 + $rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData;
  1574 + else
  1575 + $rootScope.updatedGrayDataList[bodyRegionId - 1] = updatedData;
  1576 +
  1577 + }
1561 1578  
1562 1579 };
1563 1580 worker.onerror = function (e) {
... ... @@ -1836,7 +1853,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1836 1853  
1837 1854 if (event.ctrlKey) {
1838 1855  
1839   - $scope.multiAnnotationIsON = true;
  1856 + $rootScope.multiAnnotationIsON= true;
1840 1857  
1841 1858 $scope.i = $scope.i + 1;
1842 1859 // var a = $("#sppeachBubble").find('span').html();
... ... @@ -1882,7 +1899,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1882 1899  
1883 1900  
1884 1901 else {
1885   - $scope.multiAnnotationIsON = false;
  1902 + $rootScope.multiAnnotationIsON = false;
1886 1903  
1887 1904 $(".com").css("display", "none");
1888 1905 $("#bord").css({ "width": "0px", "display": "none" });
... ... @@ -3276,7 +3293,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3276 3293 else {
3277 3294 $rootScope.isHighLight = true;
3278 3295 $rootScope.isNormalMode = false;
3279   - $scope.highLightBody();
  3296 + $scope.highLightBody();
3280 3297 }
3281 3298  
3282 3299  
... ... @@ -3407,14 +3424,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3407 3424  
3408 3425 if ($rootScope.isExtract) {
3409 3426  
  3427 + debugger;
  3428 +
3410 3429 if (value.haveMirror == 'true') {
3411 3430 $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  3431 +
  3432 + $rootScope.updatedWhiteMRDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
3412 3433 }
3413 3434 else {
3414 3435 //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
3415 3436  
3416 3437 $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
3417 3438  
  3439 + $rootScope.updatedWhiteDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
3418 3440 }
3419 3441 }
3420 3442  
... ... @@ -3435,8 +3457,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3435 3457 $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
3436 3458 })
3437 3459  
3438   - if ($rootScope.isExtract) {
3439   - if ($rootScope.previousHighlightList.length > 0) {
  3460 + if ($rootScope.isExtract == true) {
  3461 + if ($rootScope.previousHighlightList.length > 0)
  3462 + {
3440 3463 angular.forEach($rootScope.previousHighlightList, function (value, key) {
3441 3464  
3442 3465  
... ...