diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 200f1f8..eb1e6ac 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -3012,7 +3012,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.highlightedBR = []; - // if ($scope.layerNumber == 224) { var matchedTermListPath = '~/../content/data/json/da/body-views/1/BodySystem_' + $rootScope.systemNumber + '.json'; var grayImageDataVar = null; @@ -3029,19 +3028,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'hidden'); //remove existing data and draw fresh data - for (var i = 0; i < $rootScope.grayImageDataList.length; i++) { - var grayCanvasID = 'imageCanvas' + parseInt(i + 1); - var grayCanvas = document.getElementById(grayCanvasID); + $scope.removeCurrentHighlightedBodySystem(); - if (grayCanvas != null) { - var grayCanvasContext = grayCanvas.getContext("2d"); - - var canvasHeight = grayCanvas.height; - var canvasWidth = grayCanvas.width; - grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); - } - } $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; @@ -4920,10 +4908,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //0. get current layer number - if (isResized) { + if (isResized || isLayerChanged) { //do nothing - } - else if (isLayerChanged) { + $scope.transNumber = 100; + $(".slider").slider('value', 100); } else { @@ -5439,8 +5427,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.DrawOnTBWithSelectedTransparency = function (tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, isLayerChanged, isResized) { - - var transNumber = $scope.transNumber;//txtTransparencyChange.value; //this changes the transparency when transparency is already activated and user resizes or chage the layer @@ -5465,12 +5451,17 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l tempCtx.putImageData(imageD, 0, 0); //} } + + + // set every fourth value to the desired number of transparency var imageD1 = tempCtx.getImageData(0, 0, Width, Height); var imageData1 = imageD1.data; var length = imageData.length; for (var i = 3; i < length; i += 4) { + + if ($scope.voId == "9" || $scope.voId == "11") { if (imageData1[i] == 0) { @@ -8492,84 +8483,101 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.systemNumber = event.currentTarget.id; + if ($rootScope.systemNumber == 0) { - //NIKITA - $rootScope.isHighlightBodyByBodySystem = true; - $scope.systemMatchedTermList = new jinqJs() - .from($rootScope.BodySystemData.BodySystem.BodySystemTerm) - .where('_SystemNumber == ' + event.currentTarget.id) - .select(); - - if ($rootScope.isHighLight == false) { - //color the body gray - $rootScope.isHighLight = true - console.log('highLightBody from HighlightBodyByBodySystem') - $scope.highLightBody(); + console.log("inside HighlightBodyByBodySystem ..came inside current structure"); + //clear highlighted system + $scope.removeCurrentHighlightedBodySystem(); + $scope.EnableUI(); } + else { - //This else is when user seraced anything then change the view and clicked on highlight options - //in this case body is already highlihted(gray) so no need to - if ($scope.grayedBR != null || $scope.grayedBR != undefined) { - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { - $scope.isAlreadyHighlighted = true; - } - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { - $scope.isAlreadyHighlighted = true; - } - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { - $scope.isAlreadyHighlighted = true; - } - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { - $scope.isAlreadyHighlighted = true; - } - if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) { + //NIKITA + $rootScope.isHighlightBodyByBodySystem = true; + $scope.systemMatchedTermList = new jinqJs() + .from($rootScope.BodySystemData.BodySystem.BodySystemTerm) + .where('_SystemNumber == ' + event.currentTarget.id) + .select(); - $scope.isLoading = true; + if ($rootScope.isHighLight == false) { + //color the body gray + $rootScope.isHighLight = true + console.log('highLightBody from HighlightBodyByBodySystem') + $scope.highLightBody(); + } + else { + //This else is when user seraced anything then change the view and clicked on highlight options + //in this case body is already highlihted(gray) so no need to + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { + $scope.isAlreadyHighlighted = true; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { + $scope.isAlreadyHighlighted = true; + } + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { + $scope.isAlreadyHighlighted = true; + } + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { + $scope.isAlreadyHighlighted = true; + } + if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) { - $('#spinner').css('visibility', 'visible'); - $timeout(function () { $scope.HighlightBodyByTermListForBodySystem($scope.systemMatchedTermList) }, 100); + $scope.isLoading = true; + + $('#spinner').css('visibility', 'visible'); + $timeout(function () { $scope.HighlightBodyByTermListForBodySystem($scope.systemMatchedTermList) }, 100); + } } } - } - - //$rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); - //NIKITA - // $rootScope.isHighlightBodyByBodySystem = true; + //$rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); - //if (systemMatchedTermList != null || systemMatchedTermList != undefined) { + + var viewtarget_highlightbody = angular.element(event.currentTarget); + var title_highlightbody = viewtarget_highlightbody.attr('title'); - // $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); - //} + $scope.removeBodySyetemSelectionClass(title_highlightbody); + //Highlight button should be active + $("#btnHighLight").addClass("btn-primary"); + $("#btnHighLight").removeClass("btn-black"); - var viewtarget_highlightbody = angular.element(event.currentTarget); - var title_highlightbody = viewtarget_highlightbody.attr('title'); + if (!$("#btnNormalMode").hasClass("btn-black")) { + $("#btnNormalMode").addClass("btn-black"); + } - $scope.removeBodySyetemSelectionClass(title_highlightbody); + if (!$("#btnExtract").hasClass("btn-black")) { + $("#btnExtract").addClass("btn-black"); + } - //Highlight button should be active - $("#btnHighLight").addClass("btn-primary"); - $("#btnHighLight").removeClass("btn-black"); + if ($("#btnExtract").hasClass("btn-primary")) { + $("#btnExtract").removeClass("btn-primary"); + } - if (!$("#btnNormalMode").hasClass("btn-black")) { - $("#btnNormalMode").addClass("btn-black"); + if ($("#btnNormalMode").hasClass("btn-primary")) { + $("#btnNormalMode").removeClass("btn-primary"); + } } + } - if (!$("#btnExtract").hasClass("btn-black")) { - $("#btnExtract").addClass("btn-black"); - } + $scope.removeCurrentHighlightedBodySystem = function(){ - if ($("#btnExtract").hasClass("btn-primary")) { - $("#btnExtract").removeClass("btn-primary"); - } + for (var i = 0; i < $rootScope.grayImageDataList.length; i++) { + var grayCanvasID = 'imageCanvas' + parseInt(i + 1); + var grayCanvas = document.getElementById(grayCanvasID); - if ($("#btnNormalMode").hasClass("btn-primary")) { - $("#btnNormalMode").removeClass("btn-primary"); - } + if (grayCanvas != null) { + var grayCanvasContext = grayCanvas.getContext("2d"); + var canvasHeight = grayCanvas.height; + var canvasWidth = grayCanvas.width; + grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); + } + } } $scope.removeBodySyetemSelectionClass = function (title_highlightbody) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index aa523ce..86c970c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -168,7 +168,7 @@