Commit febfaab668d711d6a3e9bdc02d01640d6d254f7c

Authored by Nikita Kulshreshtha
1 parent 4f7608c2

21866,21863 fix

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -2892,7 +2892,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
2892 2892 var canvasHeight = grayCanvas.height;
2893 2893 var canvasWidth = grayCanvas.width;
2894 2894 grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth)
2895   - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0);
  2895 + if ($rootScope.isExtract) {
  2896 + grayCanvasContext.putImageData($rootScope.whiteImageDataList[parseInt(i)], 0, 0);
  2897 +
  2898 + }
  2899 + else {
  2900 + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0);
  2901 + }
2896 2902 }
2897 2903 }
2898 2904 for (var i = 4; i <= $rootScope.grayImageMRDataList.length; i++) {
... ... @@ -2905,7 +2911,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2905 2911 var canvasHeight = grayCanvasMR.height;
2906 2912 var canvasWidth = grayCanvasMR.width;
2907 2913 grayCanvasContextMR.clearRect(0, 0, canvasHeight, canvasWidth)
2908   - grayCanvasContextMR.putImageData($rootScope.grayImageMRDataList[parseInt(i)], 0, 0);
  2914 + if ($rootScope.isExtract) {
  2915 + grayCanvasContext.putImageData($rootScope.whiteImageMRDataList[parseInt(i)], 0, 0);
  2916 +
  2917 + }
  2918 + else {
  2919 + grayCanvasContextMR.putImageData($rootScope.grayImageMRDataList[parseInt(i)], 0, 0);
  2920 + }
2909 2921 }
2910 2922 }
2911 2923  
... ... @@ -2932,7 +2944,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2932 2944  
2933 2945  
2934 2946 grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth)
2935   - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0);
  2947 + if ($scope.isExtract) {
  2948 + grayCanvasContext.putImageData($rootScope.whiteImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0);
  2949 +
  2950 + }
  2951 + else {
  2952 + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0);
  2953 + }
2936 2954  
2937 2955 var gData = grayCanvasContext.getImageData(0, 0, canvasWidth, canvasHeight);
2938 2956  
... ... @@ -6707,9 +6725,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6707 6725 //to do should not call every time
6708 6726 $rootScope.CloseListManager();
6709 6727  
6710   -
6711   - $rootScope.isHighlightBodyByBodySystem = false;
6712   -
  6728 + if ($rootScope.isHighlightBodyByBodySystem) {
  6729 + $rootScope.isHighlightBodyByBodySystem = false;
  6730 + //to make the system highlight if the body systme highlighted than Normal and again highlight
  6731 + $scope.isbodySystemHighlight = true;
  6732 + }
6713 6733  
6714 6734 if ($rootScope.isNormalMode == true) {
6715 6735  
... ... @@ -6790,7 +6810,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6790 6810  
6791 6811 console.log('isCalledFromButton= ' + isCalledFromButton);
6792 6812  
6793   - $rootScope.isHighlightBodyByBodySystem = false;
  6813 + //$rootScope.isHighlightBodyByBodySystem = false;
6794 6814  
6795 6815  
6796 6816 $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
... ... @@ -7000,7 +7020,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7000 7020  
7001 7021 if ($scope.isExtract == true) {
7002 7022  
7003   - if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) {
  7023 + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true || ($rootScope.isHighlightBodyByBodySystem == true || $scope.isbodySystemHighlight == true)) {
7004 7024  
7005 7025 colorMode = $scope.applyWhiteMatrix(img, context_gray);
7006 7026 }
... ... @@ -7110,7 +7130,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7110 7130  
7111 7131 if ($scope.isEligibleForHighlightBodyByTermList == true) {
7112 7132  
7113   - if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
  7133 + if ((($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined))||( $scope.isbodySystemHighlight == true && $rootScope.isHighLight == true)) {
7114 7134  
7115 7135  
7116 7136 $scope.isLoading = true;
... ... @@ -7159,6 +7179,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7159 7179 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
7160 7180  
7161 7181 }
  7182 + else if ($rootScope.isHighlightBodyByBodySystem == true || $scope.isbodySystemHighlight == true) {
  7183 + $scope.HighlightBodyByTermListForBodySystem();
  7184 + }
7162 7185 }
7163 7186 }
7164 7187 })
... ... @@ -7211,7 +7234,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7211 7234 var colorMode;
7212 7235  
7213 7236 if ($scope.isExtract == true) {
7214   - if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) {
  7237 + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true || $rootScope.isHighlightBodyByBodySystem==true || $scope.isbodySystemHighlight==true) {
7215 7238  
7216 7239 colorMode = $scope.applyWhiteMatrix(img, context);
7217 7240 }
... ... @@ -7290,6 +7313,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7290 7313 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
7291 7314  
7292 7315 }
  7316 + else if ($rootScope.isHighlightBodyByBodySystem == true || $scope.isbodySystemHighlight == true) {
  7317 + $scope.HighlightBodyByTermListForBodySystem();
  7318 + }
7293 7319 }
7294 7320  
7295 7321 }
... ... @@ -8024,6 +8050,32 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8024 8050 var viewtarget_highlightbody = angular.element(event.currentTarget);
8025 8051 var title_highlightbody = viewtarget_highlightbody.attr('title');
8026 8052  
  8053 + $scope.removeBodySyetemSelectionClass(title_highlightbody);
  8054 +
  8055 + //Highlight button should be active
  8056 + $("#btnHighLight").addClass("btn-primary");
  8057 + $("#btnHighLight").removeClass("btn-black");
  8058 +
  8059 + if (!$("#btnNormalMode").hasClass("btn-black")) {
  8060 + $("#btnNormalMode").addClass("btn-black");
  8061 + }
  8062 +
  8063 + if (!$("#btnExtract").hasClass("btn-black")) {
  8064 + $("#btnExtract").addClass("btn-black");
  8065 + }
  8066 +
  8067 + if ($("#btnExtract").hasClass("btn-primary")) {
  8068 + $("#btnExtract").removeClass("btn-primary");
  8069 + }
  8070 +
  8071 + if ($("#btnNormalMode").hasClass("btn-primary")) {
  8072 + $("#btnNormalMode").removeClass("btn-primary");
  8073 + }
  8074 +
  8075 + }
  8076 +
  8077 + $scope.removeBodySyetemSelectionClass = function (title_highlightbody) {
  8078 +
8027 8079 if (title_highlightbody == "Cardiovascular") {
8028 8080 $scope.CurrentStructure = "";
8029 8081 $scope.Cardiovascular = "active";
... ... @@ -8040,7 +8092,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8040 8092 $scope.Urinary = "";
8041 8093 }
8042 8094  
8043   - if (title_highlightbody == "Digestive") {
  8095 + else if (title_highlightbody == "Digestive") {
8044 8096 $scope.CurrentStructure = "";
8045 8097 $scope.Cardiovascular = "";
8046 8098 $scope.Digestive = "active";
... ... @@ -8056,7 +8108,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8056 8108 $scope.Urinary = "";
8057 8109 }
8058 8110  
8059   - if (title_highlightbody == "Endocrine") {
  8111 + else if (title_highlightbody == "Endocrine") {
8060 8112 $scope.CurrentStructure = "";
8061 8113 $scope.Cardiovascular = "";
8062 8114 $scope.Digestive = "";
... ... @@ -8071,7 +8123,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8071 8123 $scope.Skeletal = "";
8072 8124 $scope.Urinary = "";
8073 8125 }
8074   - if (title_highlightbody == "Immune") {
  8126 + else if (title_highlightbody == "Immune") {
8075 8127  
8076 8128 $scope.CurrentStructure = "";
8077 8129 $scope.Cardiovascular = "";
... ... @@ -8087,7 +8139,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8087 8139 $scope.Skeletal = "";
8088 8140 $scope.Urinary = "";
8089 8141 }
8090   - if (title_highlightbody == "Integumentary") {
  8142 + else if (title_highlightbody == "Integumentary") {
8091 8143 $scope.CurrentStructure = "";
8092 8144 $scope.Cardiovascular = "";
8093 8145 $scope.Digestive = "";
... ... @@ -8102,7 +8154,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8102 8154 $scope.Skeletal = "";
8103 8155 $scope.Urinary = "";
8104 8156 }
8105   - if (title_highlightbody == "Lymphatic") {
  8157 + else if (title_highlightbody == "Lymphatic") {
8106 8158 $scope.CurrentStructure = "";
8107 8159 $scope.Cardiovascular = "";
8108 8160 $scope.Digestive = "";
... ... @@ -8117,7 +8169,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8117 8169 $scope.Skeletal = "";
8118 8170 $scope.Urinary = "";
8119 8171 }
8120   - if (title_highlightbody == "Muscular") {
  8172 + else if (title_highlightbody == "Muscular") {
8121 8173 $scope.CurrentStructure = "";
8122 8174 $scope.Cardiovascular = "";
8123 8175 $scope.Digestive = "";
... ... @@ -8132,7 +8184,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8132 8184 $scope.Skeletal = "";
8133 8185 $scope.Urinary = "";
8134 8186 }
8135   - if (title_highlightbody == "Nervous") {
  8187 + else if (title_highlightbody == "Nervous") {
8136 8188 $scope.CurrentStructure = "";
8137 8189 $scope.Cardiovascular = "";
8138 8190 $scope.Digestive = "";
... ... @@ -8147,7 +8199,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8147 8199 $scope.Skeletal = "";
8148 8200 $scope.Urinary = "";
8149 8201 }
8150   - if (title_highlightbody == "Reproductive") {
  8202 + else if (title_highlightbody == "Reproductive") {
8151 8203 $scope.CurrentStructure = "";
8152 8204 $scope.Cardiovascular = "";
8153 8205 $scope.Digestive = "";
... ... @@ -8162,7 +8214,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8162 8214 $scope.Skeletal = "";
8163 8215 $scope.Urinary = "";
8164 8216 }
8165   - if (title_highlightbody == "Respiratory") {
  8217 + else if (title_highlightbody == "Respiratory") {
8166 8218 $scope.CurrentStructure = "";
8167 8219 $scope.Cardiovascular = "";
8168 8220 $scope.Digestive = "";
... ... @@ -8177,7 +8229,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8177 8229 $scope.Skeletal = "";
8178 8230 $scope.Urinary = "";
8179 8231 }
8180   - if (title_highlightbody == "Skeletal") {
  8232 + else if (title_highlightbody == "Skeletal") {
8181 8233 $scope.CurrentStructure = "";
8182 8234 $scope.Cardiovascular = "";
8183 8235 $scope.Digestive = "";
... ... @@ -8192,7 +8244,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8192 8244 $scope.Skeletal = "active";
8193 8245 $scope.Urinary = "";
8194 8246 }
8195   - if (title_highlightbody == "Urinary") {
  8247 + else if (title_highlightbody == "Urinary") {
8196 8248 $scope.CurrentStructure = "";
8197 8249 $scope.Cardiovascular = "";
8198 8250 $scope.Digestive = "";
... ... @@ -8206,29 +8258,24 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8206 8258 $scope.Respiratory = "";
8207 8259 $scope.Skeletal = "";
8208 8260 $scope.Urinary = "active";
8209   - }
8210   -
8211   - //Highlight button should be active
8212   - $("#btnHighLight").addClass("btn-primary");
8213   - $("#btnHighLight").removeClass("btn-black");
8214   -
8215   - if (!$("#btnNormalMode").hasClass("btn-black")) {
8216   - $("#btnNormalMode").addClass("btn-black");
8217   - }
8218   -
8219   - if (!$("#btnExtract").hasClass("btn-black")) {
8220   - $("#btnExtract").addClass("btn-black");
8221   - }
8222   -
8223   - if ($("#btnExtract").hasClass("btn-primary")) {
8224   - $("#btnExtract").removeClass("btn-primary");
8225   - }
8226   -
8227   - if ($("#btnNormalMode").hasClass("btn-primary")) {
8228   - $("#btnNormalMode").removeClass("btn-primary");
8229   - }
8230   -
  8261 + }
  8262 + else {
  8263 + $scope.CurrentStructure = "";
  8264 + $scope.Cardiovascular = "";
  8265 + $scope.Digestive = "";
  8266 + $scope.Endocrine = "";
  8267 + $scope.Immune = "";
  8268 + $scope.Integumentary = "";
  8269 + $scope.Lymphatic = "";
  8270 + $scope.Muscular = "";
  8271 + $scope.Nervous = "";
  8272 + $scope.Reproductive = "";
  8273 + $scope.Respiratory = "";
  8274 + $scope.Skeletal = "";
  8275 + $scope.Urinary = "";
  8276 + }
8231 8277 }
  8278 +
8232 8279 $rootScope.isSearchInputClicked = true;
8233 8280 $scope.ShowSearch = function () {
8234 8281 console.log('ShowSearch is called');
... ... @@ -8514,7 +8561,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8514 8561 //---
8515 8562  
8516 8563 $rootScope.isHighlightBodyByBodySystem = false;
8517   -
  8564 + $scope.isbodySystemHighlight = false;
  8565 + $scope.removeBodySyetemSelectionClass("");
8518 8566 //1.
8519 8567 $rootScope.actualTermNumber = actualTermNumber;//attributes[0].value;
8520 8568 console.log(' $scope.actualTermNumber insde HighlightBodyOnListManagerSelection= ' + $rootScope.actualTermNumber)
... ...