diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 9b0eda1..f4b54c3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -4741,11 +4741,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - var context_gray = imageCanvas.getContext('2d'); - var dataURL = imageCanvas.toDataURL(); - var img = new Image(); - img.src = dataURL; + var context_gray = imageCanvas.getContext('2d'); + + var dataURL = imageCanvas.toDataURL(); + + + var img = new Image(); + + img.src = dataURL; img.onload = function () { console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' @@ -4768,9 +4772,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - context_gray.putImageData(DAData.data, 0, 0) + context_gray.putImageData(DAData.data, 0, 0) - $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); + //NIKI- to resolve lateral arm black issue in highlight mode if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) { @@ -4791,6 +4795,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo + //push BRID into array + $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); var grayImageData = context_gray.getImageData(0, 0, width, ht); var grayImageImageDataVar = grayImageData.data; @@ -6303,7 +6309,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#canvasDiv").scrollTop(scrolly); $("#canvasDiv").scrollLeft(scrollx); - $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); + if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { + $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); + } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js.orig b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js.orig index cc653b3..5a6b5e2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js.orig +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js.orig @@ -211,8 +211,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.selectedGenderBodyViewData != null || $scope.selectedGenderBodyViewData != undefined) { angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { - var userEthnicity = $rootScope.globalSetting.ethnicity; - var userModestysettings = $rootScope.globalSetting.modesty; + + var userEthnicity; + var userModestysettings; + var curentEthnicity = localStorage.getItem("globalEthnicity"); + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { + userEthnicity = curentEthnicity; + } + else { + userEthnicity = $rootScope.globalSetting.ethnicity; + } + + var curentmodesty = localStorage.getItem("globalmodesty"); + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { + userModestysettings = curentmodesty + } + else { + userModestysettings = $rootScope.globalSetting.modesty; + } + + + //var userSelectedSkintone = 'W'; //$scope.userModestySetting = 'Y' var thumbnailImage; @@ -246,6 +265,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.openView = function ($event) { // debugger; + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $rootScope.currentBodyViewId = $event.currentTarget.id; $rootScope.ViewTitle = $event.currentTarget.textContent; @@ -325,6 +347,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //0. we will initially append container to load body + //check if localstorage has any settings + var curentEthnicity = localStorage.getItem("globalEthnicity"); + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { + $rootScope.globalSetting.ethnicity = curentEthnicity; + } + + var curentmodesty = localStorage.getItem("globalmodesty"); + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { + $rootScope.globalSetting.modesty = curentmodesty + } + //0.1 var currentBodyViewId = localStorage.getItem("currentBodyViewId"); @@ -498,7 +531,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }); bodyViewWorker.onmessage = function (e) { - console.log('callback in extr'); + //console.log('callback in extr'); $rootScope.BodyRegionData = e.data.bodyRegionData; $rootScope.bgartData = e.data.bodyArtData; @@ -869,6 +902,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }); + + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); } if (($rootScope.globalSetting.modesty == 'Y')) { @@ -1131,6 +1167,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.multiAnnotationIsON = true; } else { + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { + $rootScope.previousHighlightList = []; + } + $rootScope.multiAnnotationIsON = false; } @@ -1331,52 +1371,47 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } ); - // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) + // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) - if (($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { - - if((($rootScope.viewOrientationId=='1') || ($rootScope.viewOrientationId=='4')) && ($scope.ColoredImageSRC.length == 9)) - { + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { + + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { $scope.isEligibleForHighlight = true; } - else if((($rootScope.viewOrientationId=='2') || ($rootScope.viewOrientationId=='3')) && ($scope.ColoredImageSRC.length == 5)) - { + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { $scope.isEligibleForHighlight = true; } - else if(($rootScope.viewOrientationId=='5') && ($scope.ColoredImageSRC.length == 4)) - { + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { $scope.isEligibleForHighlight = true; } - else if(($rootScope.viewOrientationId=='6') && ($scope.ColoredImageSRC.length == 1)) - { + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { $scope.isEligibleForHighlight = true; } else { $scope.isEligibleForHighlight = false; } - - if($scope.isEligibleForHighlight == true) - { + + if ($scope.isEligibleForHighlight == true) { + if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); - - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); - $timeout(function () { - console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) - $rootScope.isHighLight = true; - $scope.highLightBody() - }, 500); - } - } + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $timeout(function () { + console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) + $rootScope.isHighLight = true; + + $scope.highLightBody() + }, 500); + } + } } - // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); + // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); } if (FlipedImgCanvas.id.match('_mci')) { @@ -1402,7 +1437,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { - + var imgCanvas = document.createElement('canvas'); // imgCanvas.style.backgroundColor = 'red'; imgCanvas.height = h; @@ -1459,6 +1494,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.multiAnnotationIsON = true; } else { + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { + $rootScope.previousHighlightList = []; + } $rootScope.multiAnnotationIsON = false; } @@ -1650,8 +1688,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') { //do nothing } - else - { + else { $scope.ColoredImageSRC.push( { "bodyRegionId": bodyRegionId, "SRC": src, @@ -1664,28 +1701,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo ); - console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) - if (($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { + //console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { - $scope.isEligibleForHighlight = true; - } - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { - $scope.isEligibleForHighlight = true; - } - else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { - $scope.isEligibleForHighlight = true; - } - else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { - $scope.isEligibleForHighlight = true; - } - else { - $scope.isEligibleForHighlight = false; - } + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { + $scope.isEligibleForHighlight = true; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { + $scope.isEligibleForHighlight = true; + } + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { + $scope.isEligibleForHighlight = true; + } + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { + $scope.isEligibleForHighlight = true; + } + else { + $scope.isEligibleForHighlight = false; + } - if ($scope.isEligibleForHighlight == true) { + if ($scope.isEligibleForHighlight == true) { + if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); @@ -1707,37 +1744,37 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && ($scope.ColoredImageSRC.length == 9)) { - // console.log('after check= ' + $scope.ColoredImageSRC.length) - // $rootScope.isLoading = false; - // $('#spinner').css('visibility', 'hidden'); - - // if ($rootScope.isListManagerSelected == true || $rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { - // $rootScope.isLoading = true; - // $('#spinner').css('visibility', 'visible'); - // $timeout(function () { - // console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) - // $rootScope.isHighLight = true; - - // $scope.highLightBody() - // }, 500); - // } - // } - // } + // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && ($scope.ColoredImageSRC.length == 9)) { + // console.log('after check= ' + $scope.ColoredImageSRC.length) + // $rootScope.isLoading = false; + // $('#spinner').css('visibility', 'hidden'); + + // if ($rootScope.isListManagerSelected == true || $rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { + // $rootScope.isLoading = true; + // $('#spinner').css('visibility', 'visible'); + // $timeout(function () { + // console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) + // $rootScope.isHighLight = true; + + // $scope.highLightBody() + // }, 500); + // } + // } + // } + + //} + if (imgCanvas.id.match('_mci')) { + var maskImgData = context.getImageData(0, 0, w, h); + $rootScope.MaskCanvasData.push( + { + "bodyRegionId": bodyRegionId, + "canvasId": imgCanvas.id, + "maskData": maskImgData, + + } + ); + } - //} - if (imgCanvas.id.match('_mci')) { - var maskImgData = context.getImageData(0, 0, w, h); - $rootScope.MaskCanvasData.push( - { - "bodyRegionId": bodyRegionId, - "canvasId": imgCanvas.id, - "maskData": maskImgData, - - } - ); - } - }; if (document.getElementById('canvasDiv') != null) @@ -1761,7 +1798,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (TermList != null) { //4. - $scope.HighlightBodyByTermList(TermList); } } @@ -1873,27 +1909,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var bodyRegionId = e.data.bodyRegionId; - //if ((CallBackBodyRegion != null || CallBackBodyRegion != undefined)) - //{ - // if (CallBackBodyRegion.length > 0) { - // for (var i = 1; i <= CallBackBodyRegion.length; i++) { - // if (CallBackBodyRegion[i].match(bodyRegionId)) { - // console.log("already have body region id: " + bodyRegionId); - // } - // else { - // CallBackBodyRegion.push(bodyRegionId); - - // console.log("pushed body region id: " + bodyRegionId); - // } - // } - // } - // else - - // { - // CallBackBodyRegion.push(bodyRegionId); - // } - //} - var canvasId = (e.data.canvasId).replace('_mci', ''); //debugger; //for (var i = 1; i <= updatedData.length; i++) { @@ -1952,7 +1967,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('HighlightBodyByTermList is called'); - $scope.highlightedBR = null; + // $scope.highlightedBR = null; $scope.highlightedBR = []; $scope.terminateCurrentlyRunningWPs(); @@ -2244,6 +2259,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //layer change function $scope.LayerChange = function () { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + //1. $scope.terminateCurrentlyRunningWPs(); @@ -2351,17 +2369,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $timeout(function () { $scope.DisableProgressBar() }, 1000); } - //if ($rootScope.isHighLight) { - // //alert('isHighlight: ' + $scope.isHighLight); - - // $('#btnHighLight').removeClass('btn btn-black'); - // $('#btnHighLight').addClass('btn-primary'); - - // $timeout(function () { $scope.highLightBody() }, 350); - - - - //} $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber)); } @@ -4300,10 +4307,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var tBox = document.getElementById('transparencyCanvas'); -<<<<<<< HEAD - -======= ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 + if (tBox != null) { tBox.parentNode.removeChild(tBox) var elements = document.getElementsByClassName('ui-icon ui-icon-gripsmall-diagonal-se'); @@ -4582,9 +4586,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - - - $timeout(function () { $scope.highLightBody() }, 50); + else { + $timeout(function () { $scope.highLightBody() }, 50); + } } @@ -4682,355 +4686,197 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.terminateCurrentlyRunningWPs(); -<<<<<<< HEAD //different body views have different count of bodyegions so the length of ColoredImageSRC will be different - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { - $scope.doHighlightOrExtract = true; - } - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { - $scope.doHighlightOrExtract = true; - } - else if ((($rootScope.viewOrientationId == '5')) && ($scope.ColoredImageSRC.length == 4)) { - $scope.doHighlightOrExtract = true; - } - else if ((($rootScope.viewOrientationId == '6')) && ($scope.ColoredImageSRC.length == 1)) { - $scope.doHighlightOrExtract = true; - } - else { - $scope.doHighlightOrExtract = false; - } + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { + $scope.doHighlightOrExtract = true; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { + $scope.doHighlightOrExtract = true; + } + else if ((($rootScope.viewOrientationId == '5')) && ($scope.ColoredImageSRC.length == 4)) { + $scope.doHighlightOrExtract = true; + } + else if ((($rootScope.viewOrientationId == '6')) && ($scope.ColoredImageSRC.length == 1)) { + $scope.doHighlightOrExtract = true; + } + else { + $scope.doHighlightOrExtract = false; + } - if ($scope.doHighlightOrExtract == true) { - if ($rootScope.isHighLight == true) { + if ($scope.doHighlightOrExtract == true) { + if ($rootScope.isHighLight == true) { - $scope.grayeddBR = []; + $scope.grayedBR = []; - angular.forEach($scope.ColoredImageSRC, function (value, key) { - console.log('$scope.ColoredImageSRC length begore gray= ' + $scope.ColoredImageSRC.length) - var id; - if (value.haveMirror == 'true') { - id = 'imageCanvas' + value.bodyRegionId + '_MR'; - } - else { - id = 'imageCanvas' + value.bodyRegionId; - } + angular.forEach($scope.ColoredImageSRC, function (value, key) { + console.log('$scope.ColoredImageSRC length before gray= ' + $scope.ColoredImageSRC.length) + var id; + if (value.haveMirror == 'true') { + id = 'imageCanvas' + value.bodyRegionId + '_MR'; + } + else { + id = 'imageCanvas' + value.bodyRegionId; + } - //alert(value.bodyRegionId) + var imageCanvas = document.getElementById(id); - var imageCanvas = document.getElementById(id); -======= - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length == 9) { + var width = value.Width; + var ht = value.Height; - if ($rootScope.isHighLight == true) { + var coloredCanvasContext = imageCanvas.getContext("2d"); + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); + var coloredImageDataVar = coloredImageData; - $scope.grayeddBR = []; - angular.forEach($scope.ColoredImageSRC, function (value, key) { - var id; - if (value.haveMirror == 'true') { - id = 'imageCanvas' + value.bodyRegionId + '_MR'; - } - else { - id = 'imageCanvas' + value.bodyRegionId; - } + if (value.haveMirror == 'true') { + $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; + } + else { - var imageCanvas = document.getElementById(id); - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; - //var coloredCanvas = document.getElementById(coloredCanvasID); + $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; - var width = value.Width; - var ht = value.Height; + } - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 + var context_gray = imageCanvas.getContext('2d'); - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; - //var coloredCanvas = document.getElementById(coloredCanvasID); + var dataURL = imageCanvas.toDataURL(); + var img = new Image(); + img.src = dataURL; -<<<<<<< HEAD - var width = value.Width; - var ht = value.Height; -======= - if (value.haveMirror == 'true') { - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; - } - else { ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 + img.onload = function () { + console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' + + value.bodyRegionId) - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; +<<<<<<< HEAD + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); + DAData.draw(img); -<<<<<<< HEAD + var colorMode; - if (value.haveMirror == 'true') { - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; + if ($scope.isExtract == true) { + colorMode = $scope.applyWhiteMatrix(img, context_gray); } else { - - - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; - + colorMode = $scope.applyGrayMatrix(img, context_gray); } - - - var context_gray = imageCanvas.getContext('2d'); - - - //NIKI- for lateral arm highlight issue - - if ($rootScope.viewOrientationId && value.bodyRegionId == 6) { - var imgData = context_gray.getImageData(0, 0, width, ht); - var data = imgData.data; - for (var i = 0; i < data.length; i += 4) { - // if (data[i + 3] < 255) { - // data[i] = 255 - data[i]; - // data[i + 1] = 255 - data[i + 1]; - // data[i + 2] = 255 - data[i + 2]; - data[i + 3] = 255//255 - data[i + 3]; - // } - } - context_gray.putImageData(imgData, 0, 0); - } - //NIKI - - - - +======= var dataURL = imageCanvas.toDataURL(); var img = new Image(); img.src = dataURL; +>>>>>>> a080a6b1b96bcd2459bfec5e3fa4b17b26766772 + var zeroPoint = new Point(); + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); +<<<<<<< HEAD + context_gray.putImageData(DAData.data, 0, 0) +======= img.onload = function () { - console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' - + value.bodyRegionId) + // console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' + // + value.bodyRegionId) +>>>>>>> a080a6b1b96bcd2459bfec5e3fa4b17b26766772 - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); - DAData.draw(img); + $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); - var colorMode; + var grayImageData = context_gray.getImageData(0, 0, width, ht); + var grayImageImageDataVar = grayImageData.data; - if ($scope.isExtract == true) { - colorMode = $scope.applyWhiteMatrix(img, context_gray); + if ($scope.isExtract == true) { + if (value.haveMirror == 'true') { + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; } else { - colorMode = $scope.applyGrayMatrix(img, context_gray); - } - - var zeroPoint = new Point(); - - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - - context_gray.putImageData(DAData.data, 0, 0) - //push BRID into array - $scope.grayeddBR.push({ 'BRID': value.bodyRegionId }); - - var grayImageData = context_gray.getImageData(0, 0, width, ht); - var grayImageImageDataVar = grayImageData.data; - - if ($scope.isExtract == true) { - if (value.haveMirror == 'true') { - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } + } + else { - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } +<<<<<<< HEAD + if (value.haveMirror == 'true') { + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; } else { - - if (value.haveMirror == 'true') { - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; +======= + + context_gray.putImageData(DAData.data, 0, 0) + + //NIKI- to resolve lateral arm black issue in highlight mode + + if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) { + + var imgData = context_gray.getImageData(0, 0, width, ht); + var data = imgData.data; + var c=0; + for (var i = 0; i < data.length; i += 4) { + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { + data[i + 3] = 0; + } + } - else { -======= - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; - - } - - - var context_gray = imageCanvas.getContext('2d'); - - - var dataURL = imageCanvas.toDataURL(); - - - var img = new Image(); - - img.src = dataURL; - - - - img.onload = function () { - console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height)) - - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); - DAData.draw(img); - - var colorMode; - - if ($scope.isExtract == true) { - colorMode = $scope.applyWhiteMatrix(img, context_gray); - } - else { - colorMode = $scope.applyGrayMatrix(img, context_gray); - } - - var zeroPoint = new Point(); - - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - - context_gray.putImageData(DAData.data, 0, 0) - - //push BRID into array - $scope.grayeddBR.push({ 'BRID': value.bodyRegionId }); - - if ($scope.grayeddBR.length == 9) { - - if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { - - $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); - } - else if ($scope.isHighlightByListManager == true) { - - console.log('$scope.grayeddBR.length is ' + $scope.grayeddBR.length); - $timeout(function () { + context_gray.putImageData(imgData, 0, 0); + } + - // $rootScope.isHighLight = false; - //align - // $scope.aligneCanvasWithTerm(); + //NIKI - $scope.HighlightBodyByTermList($scope.AllTerms) - }, 800); + +>>>>>>> a080a6b1b96bcd2459bfec5e3fa4b17b26766772 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } } - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; } + else { -<<<<<<< HEAD + $scope.isEligibleForHighlightBodyByTermList = false; + } + if ($scope.isEligibleForHighlightBodyByTermList == true) { + //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE + if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { + $scope.isLoading = false; - if ($scope.grayeddBR != null || $scope.grayeddBR != undefined) { - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayeddBR.length == 9)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; - } - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayeddBR.length == 5)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; - } - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayeddBR.length == 4)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; + $('#spinner').css('visibility', 'hidden'); } - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayeddBR.length == 1)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; - } - else { - - $scope.isEligibleForHighlightBodyByTermList = false; - } - - if ($scope.isEligibleForHighlightBodyByTermList == true) { - //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE - if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { - $scope.isLoading = false; - - $('#spinner').css('visibility', 'hidden'); -======= - console.log('inside highlight body'); - - var multiTermList = []; - angular.forEach($rootScope.previousHighlightList, function (value, key) { - - //debugger; - var ActualTermNo = $scope.getActualTermNumber(value); - if (ActualTermNo != null) { - var TermList = $scope.getTermNumberList(ActualTermNo); - if (TermList != null) { - for (var i = 0; i < TermList.length; i++) { + if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { - multiTermList.push(TermList[i]); - } ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 - } + $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); } + else if ($scope.isHighlightByListManager == true) { -<<<<<<< HEAD - if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { -======= - }); ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 - - $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); - } - else if ($scope.isHighlightByListManager == true) { - -<<<<<<< HEAD - // console.log('$scope.grayeddBR.length is ' + $scope.grayeddBR.length); - $timeout(function () { -======= - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); - } ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 - - // $rootScope.isHighLight = false; - //align - // $scope.aligneCanvasWithTerm(); - -<<<<<<< HEAD - $scope.HighlightBodyByTermList($scope.AllTerms) - }, 800); - - } - - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - - - //console.log('inside highlight body'); - - var multiTermList = []; - angular.forEach($rootScope.previousHighlightList, function (value, key) { - - //debugger; - - var ActualTermNo = $scope.getActualTermNumber(value); - if (ActualTermNo != null) { - var TermList = $scope.getTermNumberList(ActualTermNo); - if (TermList != null) { - for (var i = 0; i < TermList.length; i++) { - - multiTermList.push(TermList[i]); - } - } - } - - }); - - - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); - } - + // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length); + $timeout(function () { + $scope.HighlightBodyByTermList($scope.AllTerms) + }, 800); } @@ -5038,366 +4884,175 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); - - - // console.log('the value of isHighlightByListManager ' + $scope.isHighlightByListManager); - - // console.log('$scope.grayeddBR.length: ' + $scope.grayeddBR.length) -======= - } + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); - var grayImageData = context_gray.getImageData(0, 0, width, ht); - var grayImageImageDataVar = grayImageData.data; - if ($scope.isExtract == true) { - if (value.haveMirror == 'true') { - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { + if ($rootScope.isExtract == true) { + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); } } else { - - if (value.haveMirror == 'true') { - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { - - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } - } - } - - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); - - - console.log('the value of isHighlightByListManager ' + $scope.isHighlightByListManager); - - console.log('$scope.grayeddBR.length: ' + $scope.grayeddBR.length) ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 - - - - -<<<<<<< HEAD - if ($rootScope.isExtract == true) { - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); + // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode + //and then highlight the previously selected body regions at the time of normal mode. + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { + $scope.isEligibleForHighlightBodyByTermList = true; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { + $scope.isEligibleForHighlightBodyByTermList = true; + } + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { + $scope.isEligibleForHighlightBodyByTermList = true; + } + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { + $scope.isEligibleForHighlightBodyByTermList = true; } - } - else { - // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode - //and then highlight the previously selected body regions at the time of normal mode. - if ($scope.grayeddBR != null || $scope.grayeddBR != undefined) { - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayeddBR.length == 9)) { - $scope.isEligibleForHighlightBodyByTermList = true; - } - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayeddBR.length == 5)) { - $scope.isEligibleForHighlightBodyByTermList = true; - } - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayeddBR.length == 4)) { - $scope.isEligibleForHighlightBodyByTermList = true; - } - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayeddBR.length == 1)) { - $scope.isEligibleForHighlightBodyByTermList = true; - } - - if ($scope.isEligibleForHighlightBodyByTermList == true) { - - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - - var multiTermList = []; - angular.forEach($rootScope.previousHighlightList, function (value, key) { - - //debugger; - - var ActualTermNo = $scope.getActualTermNumber(value); - if (ActualTermNo != null) { - var TermList = $scope.getTermNumberList(ActualTermNo); - if (TermList != null) { - for (var i = 0; i < TermList.length; i++) { - - multiTermList.push(TermList[i]); - } - } - } - - }); - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); - } -======= - if ($rootScope.isExtract == true) { - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { + } - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); + // } - } - else { - // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode - //and then highlight the previously selected body regions at the time of normal mode. - - if ($scope.grayeddBR.length == 9) { + }) - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { + if ($scope.isEligibleForHighlightBodyByTermList == true) { + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - var multiTermList = []; - angular.forEach($rootScope.previousHighlightList, function (value, key) { + var multiTermList = []; + angular.forEach($rootScope.previousHighlightList, function (value, key) { - //debugger; + //debugger; - var ActualTermNo = $scope.getActualTermNumber(value); - if (ActualTermNo != null) { - var TermList = $scope.getTermNumberList(ActualTermNo); - if (TermList != null) { - for (var i = 0; i < TermList.length; i++) { + var ActualTermNo = $scope.getActualTermNumber(value); + if (ActualTermNo != null) { + var TermList = $scope.getTermNumberList(ActualTermNo); + if (TermList != null) { + for (var i = 0; i < TermList.length; i++) { - multiTermList.push(TermList[i]); - } + multiTermList.push(TermList[i]); } } - - }); - - - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); - } ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 - - } } -<<<<<<< HEAD - // - } - }) + }); + + $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); + } } + } - else { - // This code will execute when user will select normal Mode but this time isHighlight will be false - angular.forEach($scope.ColoredImageSRC, function (value, key) { - var id; - if (value.haveMirror == 'true') { - id = 'imageCanvas' + value.bodyRegionId + '_MR'; - } - else { - id = 'imageCanvas' + value.bodyRegionId; - } + else { + // This code will execute when user will select normal Mode but this time isHighlight will be false - var imageCanvas = document.getElementById(id); + angular.forEach($scope.ColoredImageSRC, function (value, key) { + var id; + if (value.haveMirror == 'true') { + id = 'imageCanvas' + value.bodyRegionId + '_MR'; + } + else { + id = 'imageCanvas' + value.bodyRegionId; + } - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; - //var coloredCanvas = document.getElementById(coloredCanvasID); + var imageCanvas = document.getElementById(id); - var width = value.Width; - var ht = value.Height; + //var coloredCanvasID = 'imageCanvas' + bodyRegionId; + //var coloredCanvas = document.getElementById(coloredCanvasID); - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; + var width = value.Width; + var ht = value.Height; + var coloredCanvasContext = imageCanvas.getContext("2d"); + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); + var coloredImageDataVar = coloredImageData; - if (value.haveMirror == 'true') { - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; - } - else { - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; + if (value.haveMirror == 'true') { + $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; + } + else { - } + $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; + } - var context = imageCanvas.getContext('2d'); + var context = imageCanvas.getContext('2d'); - var dataURL = imageCanvas.toDataURL(); + var dataURL = imageCanvas.toDataURL(); - var img = new Image(); - img.src = dataURL; + var img = new Image(); + img.src = dataURL; - img.onload = function () { - //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); - DAData.draw(img); + img.onload = function () { + //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) - var colorMode; + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); + DAData.draw(img); - if ($scope.isExtract == true) { - colorMode = $scope.applyWhiteMatrix(img, context); - } + var colorMode; - var zeroPoint = new Point(); + if ($scope.isExtract == true) { + colorMode = $scope.applyWhiteMatrix(img, context); + } - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); + var zeroPoint = new Point(); - context.putImageData(DAData.data, 0, 0) + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - var grayImageData = context.getImageData(0, 0, width, ht); - var grayImageImageDataVar = grayImageData.data; + context.putImageData(DAData.data, 0, 0) - if ($scope.isExtract == true) { - if (value.haveMirror == 'true') { - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { + var grayImageData = context.getImageData(0, 0, width, ht); + var grayImageImageDataVar = grayImageData.data; - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } + if ($scope.isExtract == true) { + if (value.haveMirror == 'true') { + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; } else { - if (value.haveMirror == 'true') { - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { - - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; } } - - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); - }) - - if ($rootScope.isExtract == true) { - if ($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined || $rootScope.previousHighlightList.length > 0) { - - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - - // to do - -======= - } - } - }) - - } - - else { - // This code will execute when user will select normal Mode but this time isHighlight will be false - - angular.forEach($scope.ColoredImageSRC, function (value, key) { - var id; - if (value.haveMirror == 'true') { - id = 'imageCanvas' + value.bodyRegionId + '_MR'; - } - else { - id = 'imageCanvas' + value.bodyRegionId; - } - - var imageCanvas = document.getElementById(id); - - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; - //var coloredCanvas = document.getElementById(coloredCanvasID); - - var width = value.Width; - var ht = value.Height; - - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; - - - if (value.haveMirror == 'true') { - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; - } - else { - - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; - - } - - - var context = imageCanvas.getContext('2d'); - - - var dataURL = imageCanvas.toDataURL(); - - - var img = new Image(); - - img.src = dataURL; - - - - img.onload = function () { - //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) - - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); - DAData.draw(img); - - var colorMode; - - if ($scope.isExtract == true) { - colorMode = $scope.applyWhiteMatrix(img, context); - } - - var zeroPoint = new Point(); - - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - - context.putImageData(DAData.data, 0, 0) - - var grayImageData = context.getImageData(0, 0, width, ht); - var grayImageImageDataVar = grayImageData.data; - - if ($scope.isExtract == true) { - if (value.haveMirror == 'true') { - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } else { - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } - } - else { - - if (value.haveMirror == 'true') { - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { + if (value.haveMirror == 'true') { + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + } + else { - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } } } -<<<<<<< HEAD - } - } - } -======= - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); - }) + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); + }) - if ($rootScope.isExtract == true) { - if ($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined || $rootScope.previousHighlightList.length > 0) { + if ($rootScope.isExtract == true) { + if ($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined || $rootScope.previousHighlightList.length > 0) { - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - // to do + // to do + } } - } + } } } ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 } @@ -5472,6 +5127,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.OnGenderChange = function (event) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $rootScope.isGenderChnage = true; var viewname = localStorage.getItem("currentViewTitle") @@ -5490,6 +5148,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Female', 'Male'); + + localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Female', 'Male')); + + $rootScope.isLoading = true; } @@ -5507,9 +5169,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //3. $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female'); + localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Male', 'Female')); + + $rootScope.isLoading = true; } + + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "body-views": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); + var target = angular.element(event.currentTarget); var title_male_female = target.attr('title'); @@ -5597,7 +5270,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.OnViewChange = function (event) { - + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); $rootScope.isViewChange = true; $scope.layerNumber = 0; @@ -5737,76 +5411,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //console.log('reloadDABodyViewEvent'); $scope.ReloadBodyViewId = data.reloadDABodyViewId; - // $scope.layerNumber = 0; + // $scope.layerNumber = 0; // debugger; $scope.loadSelectedBodyView($scope.ReloadBodyViewId); $scope.loadSelectedBodyViewNavigator($scope.ReloadBodyViewId); - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value; - localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value); - - var viewtarget = angular.element(event.currentTarget); - var title_drop_view = viewtarget.attr('title'); - - if (title_drop_view == "Anterior") { - - $scope.AnteriorView = "active"; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - - } - else if (title_drop_view == "Lateral") { - - $scope.AnteriorView = ""; - $scope.LateralView = "active"; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Medial") { - - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = "active"; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Posterior") { - - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = "active"; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Lateral Arm") { - - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = "active"; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Medial Arm") { - - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = "active"; - } - - }) @@ -6221,9 +5832,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo case "Pin": $rootScope.resetPin = $rootScope.ObjectIndex++; - + $rootScope.resetPinArc = $rootScope.Object1Index++; - + var radial = $('canvas').createGradient({ x1: 50, y1: 50, x2: 50, y2: 50, @@ -6248,22 +5859,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // strokeWidth: 2, // radius: 3 //}, - - - + + + click: function (layer) { - // debugger; - PinLineName = layer.name; - _lineNameSplit = PinLineName.split("_"); - - storeLine = "ArcPin_" + _lineNameSplit[1]; - - $rootScope.shapeTypePin = "Pin"; - + // debugger; + PinLineName = layer.name; + _lineNameSplit = PinLineName.split("_"); + + storeLine = "ArcPin_" + _lineNameSplit[1]; + + $rootScope.shapeTypePin = "Pin"; + $rootScope.canvasLayerNameCollection1 = []; - + $rootScope.canvasLayerNameCollection1.push({ a: storeLine }, { b: PinLineName }); - + $('#canvas').setLayer(layer.name, { handle: { type: 'arc', @@ -6274,17 +5885,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo radius: 2 } }).drawLayers(); - + }, mouseout: function (layer) { - // $rootScope.resetPinArc = ""; - // ax = ""; + // $rootScope.resetPinArc = ""; + // ax = ""; $rootScope.shapeTypePin = ""; - - PinLineName = ''; - _lineNameSplit = ''; - storeLine = ''; + + PinLineName = ''; + _lineNameSplit = ''; + storeLine = ''; $rootScope.canvasLayerNameCollection1 = []; $('#canvas').setLayer(layer.name, { handle: { @@ -6317,7 +5928,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }).drawArc({ draggable: true, name: "ArcPin_" + $rootScope.resetPinArc, - // name: "Pin_" + $rootScope.resetPin, + // name: "Pin_" + $rootScope.resetPin, layer: true, groups: ['shapes'], dragGroups: ['shapes'], @@ -6334,13 +5945,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // radius: 3 //}, add: function (layer) { - // alert("add"); + // alert("add"); $rootScope.resetPinArc = layer.name; - // $scope.arr = []; + // $scope.arr = []; + - }, - + }).drawLayers(); $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); @@ -6383,22 +5994,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (event.which == 46) { - debugger; + if ($rootScope.shapeTypePin == "Pin") { // alert($rootScope.canvasLayerNameCollection[0].a); // alert($rootScope.canvasLayerNameCollection[1].b); for (var i = 0; i < $rootScope.canvasLayerNameCollection1.length; i++) { $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[i].b).drawLayers(); $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[i].a).drawLayers(); - + } - // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[0].a).drawLayers(); - // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[1].b).drawLayers(); + // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[0].a).drawLayers(); + // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[1].b).drawLayers(); } - // else { - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers(); - // } + // else { + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers(); + // } } @@ -6848,7 +6459,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } // }) - + //.error(function (data, status, headers, config) { // console.log(data);