diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index dbc4793..6b90bad 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -2892,7 +2892,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasHeight = grayCanvas.height; var canvasWidth = grayCanvas.width; grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); + if ($rootScope.isExtract) { + grayCanvasContext.putImageData($rootScope.whiteImageDataList[parseInt(i)], 0, 0); + + } + else { + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); + } } } for (var i = 4; i <= $rootScope.grayImageMRDataList.length; i++) { @@ -2905,7 +2911,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasHeight = grayCanvasMR.height; var canvasWidth = grayCanvasMR.width; grayCanvasContextMR.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContextMR.putImageData($rootScope.grayImageMRDataList[parseInt(i)], 0, 0); + if ($rootScope.isExtract) { + grayCanvasContext.putImageData($rootScope.whiteImageMRDataList[parseInt(i)], 0, 0); + + } + else { + grayCanvasContextMR.putImageData($rootScope.grayImageMRDataList[parseInt(i)], 0, 0); + } } } @@ -2932,7 +2944,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0); + if ($scope.isExtract) { + grayCanvasContext.putImageData($rootScope.whiteImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0); + + } + else { + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0); + } var gData = grayCanvasContext.getImageData(0, 0, canvasWidth, canvasHeight); @@ -6707,9 +6725,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //to do should not call every time $rootScope.CloseListManager(); - - $rootScope.isHighlightBodyByBodySystem = false; - + if ($rootScope.isHighlightBodyByBodySystem) { + $rootScope.isHighlightBodyByBodySystem = false; + //to make the system highlight if the body systme highlighted than Normal and again highlight + $scope.isbodySystemHighlight = true; + } if ($rootScope.isNormalMode == true) { @@ -6790,7 +6810,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('isCalledFromButton= ' + isCalledFromButton); - $rootScope.isHighlightBodyByBodySystem = false; + //$rootScope.isHighlightBodyByBodySystem = false; $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop(); @@ -7000,7 +7020,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isExtract == true) { - if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) { + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true || ($rootScope.isHighlightBodyByBodySystem == true || $scope.isbodySystemHighlight == true)) { colorMode = $scope.applyWhiteMatrix(img, context_gray); } @@ -7110,7 +7130,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isEligibleForHighlightBodyByTermList == true) { - if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { + if ((($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined))||( $scope.isbodySystemHighlight == true && $rootScope.isHighLight == true)) { $scope.isLoading = true; @@ -7159,6 +7179,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); } + else if ($rootScope.isHighlightBodyByBodySystem == true || $scope.isbodySystemHighlight == true) { + $scope.HighlightBodyByTermListForBodySystem(); + } } } }) @@ -7211,7 +7234,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var colorMode; if ($scope.isExtract == true) { - if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) { + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true || $rootScope.isHighlightBodyByBodySystem==true || $scope.isbodySystemHighlight==true) { colorMode = $scope.applyWhiteMatrix(img, context); } @@ -7290,6 +7313,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); } + else if ($rootScope.isHighlightBodyByBodySystem == true || $scope.isbodySystemHighlight == true) { + $scope.HighlightBodyByTermListForBodySystem(); + } } } @@ -8024,6 +8050,32 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var viewtarget_highlightbody = angular.element(event.currentTarget); var title_highlightbody = viewtarget_highlightbody.attr('title'); + $scope.removeBodySyetemSelectionClass(title_highlightbody); + + //Highlight button should be active + $("#btnHighLight").addClass("btn-primary"); + $("#btnHighLight").removeClass("btn-black"); + + if (!$("#btnNormalMode").hasClass("btn-black")) { + $("#btnNormalMode").addClass("btn-black"); + } + + if (!$("#btnExtract").hasClass("btn-black")) { + $("#btnExtract").addClass("btn-black"); + } + + if ($("#btnExtract").hasClass("btn-primary")) { + $("#btnExtract").removeClass("btn-primary"); + } + + if ($("#btnNormalMode").hasClass("btn-primary")) { + $("#btnNormalMode").removeClass("btn-primary"); + } + + } + + $scope.removeBodySyetemSelectionClass = function (title_highlightbody) { + if (title_highlightbody == "Cardiovascular") { $scope.CurrentStructure = ""; $scope.Cardiovascular = "active"; @@ -8040,7 +8092,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Urinary = ""; } - if (title_highlightbody == "Digestive") { + else if (title_highlightbody == "Digestive") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = "active"; @@ -8056,7 +8108,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Urinary = ""; } - if (title_highlightbody == "Endocrine") { + else if (title_highlightbody == "Endocrine") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8071,7 +8123,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Immune") { + else if (title_highlightbody == "Immune") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; @@ -8087,7 +8139,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Integumentary") { + else if (title_highlightbody == "Integumentary") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8102,7 +8154,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Lymphatic") { + else if (title_highlightbody == "Lymphatic") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8117,7 +8169,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Muscular") { + else if (title_highlightbody == "Muscular") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8132,7 +8184,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Nervous") { + else if (title_highlightbody == "Nervous") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8147,7 +8199,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Reproductive") { + else if (title_highlightbody == "Reproductive") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8162,7 +8214,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Respiratory") { + else if (title_highlightbody == "Respiratory") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8177,7 +8229,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = ""; $scope.Urinary = ""; } - if (title_highlightbody == "Skeletal") { + else if (title_highlightbody == "Skeletal") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8192,7 +8244,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Skeletal = "active"; $scope.Urinary = ""; } - if (title_highlightbody == "Urinary") { + else if (title_highlightbody == "Urinary") { $scope.CurrentStructure = ""; $scope.Cardiovascular = ""; $scope.Digestive = ""; @@ -8206,29 +8258,24 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.Respiratory = ""; $scope.Skeletal = ""; $scope.Urinary = "active"; - } - - //Highlight button should be active - $("#btnHighLight").addClass("btn-primary"); - $("#btnHighLight").removeClass("btn-black"); - - if (!$("#btnNormalMode").hasClass("btn-black")) { - $("#btnNormalMode").addClass("btn-black"); - } - - if (!$("#btnExtract").hasClass("btn-black")) { - $("#btnExtract").addClass("btn-black"); - } - - if ($("#btnExtract").hasClass("btn-primary")) { - $("#btnExtract").removeClass("btn-primary"); - } - - if ($("#btnNormalMode").hasClass("btn-primary")) { - $("#btnNormalMode").removeClass("btn-primary"); - } - + } + else { + $scope.CurrentStructure = ""; + $scope.Cardiovascular = ""; + $scope.Digestive = ""; + $scope.Endocrine = ""; + $scope.Immune = ""; + $scope.Integumentary = ""; + $scope.Lymphatic = ""; + $scope.Muscular = ""; + $scope.Nervous = ""; + $scope.Reproductive = ""; + $scope.Respiratory = ""; + $scope.Skeletal = ""; + $scope.Urinary = ""; + } } + $rootScope.isSearchInputClicked = true; $scope.ShowSearch = function () { console.log('ShowSearch is called'); @@ -8514,7 +8561,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //--- $rootScope.isHighlightBodyByBodySystem = false; - + $scope.isbodySystemHighlight = false; + $scope.removeBodySyetemSelectionClass(""); //1. $rootScope.actualTermNumber = actualTermNumber;//attributes[0].value; console.log(' $scope.actualTermNumber insde HighlightBodyOnListManagerSelection= ' + $rootScope.actualTermNumber)