diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 058cdf2..ae2a01e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -40,13 +40,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.whiteImageDataList = []; $rootScope.whiteImageMRDataList = []; - $rootScope.grayImageDataListCurrent = []; - $rootScope.grayImageMRDataListCurrent = []; + $rootScope.updatedGrayDataList = []; + $rootScope.updatedGrayMRDataList = []; + + $rootScope.updatedWhiteDataList = []; + $rootScope.updatedWhiteMRDataList = []; $scope.zoomInOut = 75; $scope.i = 0; $scope.speachBubbleArray = []; - $scope.multiAnnotationIsON = false; + $rootScope.multiAnnotationIsON = false; $scope.previousGrayImageDataVar; $scope.previousGrayCanvas; @@ -904,10 +907,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo FlipedImgCanvas.addEventListener('click', function (evt) { if (evt.ctrlKey) { - $scope.multiAnnotationIsON = true; + $rootScope.multiAnnotationIsON= true; } else { - $scope.multiAnnotationIsON = false; + $rootScope.multiAnnotationIsON = false; } //get mouse coordinate of mirror image click @@ -1114,8 +1117,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); - - } $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { @@ -1164,10 +1165,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo imgCanvas.addEventListener('click', function (evt) { if (evt.ctrlKey) { - $scope.multiAnnotationIsON = true; + $rootScope.multiAnnotationIsON= true; } else { - $scope.multiAnnotationIsON = false; + $rootScope.multiAnnotationIsON = false; } var annotationText; @@ -1273,6 +1274,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.previousHighlightList.push(RGBColor); + alert('previously highlighted data length: ' + $rootScope.previousHighlightList.length); + var previousIcolor = RGBColor; //ami //var previousX; // var previousY; @@ -1437,7 +1440,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var coloredImageDataVar; var grayImageDataVar; - var white; + var whiteData; if (canvasId.match('_MR')) { coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId]; @@ -1447,16 +1450,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.isExtract) { if ($scope.multiAnnotationIsON == true) { - grayImageDataVar = $rootScope.grayImageMRDataListCurrent[bodyRegionId] + whiteData = $rootScope.updatedWhiteMRDataList[bodyRegionId] } else - white = $rootScope.whiteImageMRDataList[bodyRegionId]; + whiteData = $rootScope.whiteImageMRDataList[bodyRegionId]; } else { if ($scope.multiAnnotationIsON == true) { - grayImageDataVar = $rootScope.grayImageMRDataListCurrent[bodyRegionId] + grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId] } else grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId]; @@ -1473,15 +1476,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.isExtract) { if ($scope.multiAnnotationIsON == true) { - grayImageDataVar = $rootScope.grayImageDataListCurrent[bodyRegionId-1] + whiteData = $rootScope.updatedWhiteDataList[bodyRegionId - 1] + + // alert('updatedWhiteDataList lenth: ' + updatedWhiteDataList.length + ' on multi highlight'); } else - white = $rootScope.whiteImageDataList[bodyRegionId-1]; + whiteData = $rootScope.whiteImageDataList[bodyRegionId - 1]; } else { if ($scope.multiAnnotationIsON == true) { - grayImageDataVar = $rootScope.grayImageDataListCurrent[bodyRegionId - 1] + grayImageDataVar = $rootScope.updatedGrayDataList[bodyRegionId - 1] } else grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1]; @@ -1502,7 +1507,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo 'termList': TermList, 'maskCanvasData': maskData, 'coloredImageData': coloredImageDataVar, - 'grayImageData': white, + 'grayImageData': whiteData, 'bodyRegionId': bodyRegionId, 'canvasId': canvasId @@ -1554,10 +1559,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // worker.terminate(); - if (canvasId.match('_MR')) - $rootScope.grayImageMRDataListCurrent[bodyRegionId] = updatedData; + + if($rootScope.isExtract == true) + { + if (canvasId.match('_MR')) + $rootScope.updatedWhiteMRDataList[bodyRegionId] = updatedData; + else + $rootScope.updatedWhiteDataList[bodyRegionId - 1] = updatedData; + } else - $rootScope.grayImageDataListCurrent[bodyRegionId - 1] = updatedData; + { + if (canvasId.match('_MR')) + $rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData; + else + $rootScope.updatedGrayDataList[bodyRegionId - 1] = updatedData; + + } }; worker.onerror = function (e) { @@ -1836,7 +1853,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (event.ctrlKey) { - $scope.multiAnnotationIsON = true; + $rootScope.multiAnnotationIsON= true; $scope.i = $scope.i + 1; // var a = $("#sppeachBubble").find('span').html(); @@ -1882,7 +1899,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { - $scope.multiAnnotationIsON = false; + $rootScope.multiAnnotationIsON = false; $(".com").css("display", "none"); $("#bord").css({ "width": "0px", "display": "none" }); @@ -3276,7 +3293,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { $rootScope.isHighLight = true; $rootScope.isNormalMode = false; - $scope.highLightBody(); + $scope.highLightBody(); } @@ -3407,14 +3424,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.isExtract) { + debugger; + if (value.haveMirror == 'true') { $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + + $rootScope.updatedWhiteMRDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; } else { //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1; $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + $rootScope.updatedWhiteDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; } } @@ -3435,8 +3457,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); }) - if ($rootScope.isExtract) { - if ($rootScope.previousHighlightList.length > 0) { + if ($rootScope.isExtract == true) { + if ($rootScope.previousHighlightList.length > 0) + { angular.forEach($rootScope.previousHighlightList, function (value, key) {