Commit 7033990569431783399c5828bacb79368a99422f

Authored by unknown
2 parents e73fcf99 7b06aac1

Merge branch 'Develop-IPAD-MAC' of http://52.6.196.163/ADAM/AIAHTML5 into CALandscapeIssue

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -3012,7 +3012,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l @@ -3012,7 +3012,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
3012 3012
3013 $scope.highlightedBR = []; 3013 $scope.highlightedBR = [];
3014 3014
3015 - // if ($scope.layerNumber == 224) {  
3016 3015
3017 var matchedTermListPath = '~/../content/data/json/da/body-views/1/BodySystem_' + $rootScope.systemNumber + '.json'; 3016 var matchedTermListPath = '~/../content/data/json/da/body-views/1/BodySystem_' + $rootScope.systemNumber + '.json';
3018 var grayImageDataVar = null; 3017 var grayImageDataVar = null;
@@ -3029,19 +3028,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l @@ -3029,19 +3028,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
3029 $('#spinner').css('visibility', 'hidden'); 3028 $('#spinner').css('visibility', 'hidden');
3030 3029
3031 //remove existing data and draw fresh data 3030 //remove existing data and draw fresh data
3032 - for (var i = 0; i < $rootScope.grayImageDataList.length; i++) {  
3033 - var grayCanvasID = 'imageCanvas' + parseInt(i + 1);  
3034 - var grayCanvas = document.getElementById(grayCanvasID); 3031 + $scope.removeCurrentHighlightedBodySystem();
3035 3032
3036 - if (grayCanvas != null) {  
3037 - var grayCanvasContext = grayCanvas.getContext("2d");  
3038 -  
3039 - var canvasHeight = grayCanvas.height;  
3040 - var canvasWidth = grayCanvas.width;  
3041 - grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth)  
3042 - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0);  
3043 - }  
3044 - }  
3045 3033
3046 3034
3047 $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; 3035 $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE;
@@ -4920,10 +4908,10 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l @@ -4920,10 +4908,10 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
4920 4908
4921 4909
4922 //0. get current layer number 4910 //0. get current layer number
4923 - if (isResized) { 4911 + if (isResized || isLayerChanged) {
4924 //do nothing 4912 //do nothing
4925 - }  
4926 - else if (isLayerChanged) { 4913 + $scope.transNumber = 100;
  4914 + $(".slider").slider('value', 100);
4927 4915
4928 } 4916 }
4929 else { 4917 else {
@@ -5439,8 +5427,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l @@ -5439,8 +5427,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5439 5427
5440 $scope.DrawOnTBWithSelectedTransparency = function (tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, isLayerChanged, isResized) { 5428 $scope.DrawOnTBWithSelectedTransparency = function (tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, isLayerChanged, isResized) {
5441 5429
5442 -  
5443 -  
5444 var transNumber = $scope.transNumber;//txtTransparencyChange.value; 5430 var transNumber = $scope.transNumber;//txtTransparencyChange.value;
5445 //this changes the transparency when transparency is already activated and user resizes or chage the layer 5431 //this changes the transparency when transparency is already activated and user resizes or chage the layer
5446 5432
@@ -5465,12 +5451,17 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l @@ -5465,12 +5451,17 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5465 tempCtx.putImageData(imageD, 0, 0); 5451 tempCtx.putImageData(imageD, 0, 0);
5466 //} 5452 //}
5467 } 5453 }
  5454 +
  5455 +
  5456 +
5468 // set every fourth value to the desired number of transparency 5457 // set every fourth value to the desired number of transparency
5469 var imageD1 = tempCtx.getImageData(0, 0, Width, Height); 5458 var imageD1 = tempCtx.getImageData(0, 0, Width, Height);
5470 var imageData1 = imageD1.data; 5459 var imageData1 = imageD1.data;
5471 var length = imageData.length; 5460 var length = imageData.length;
5472 5461
5473 for (var i = 3; i < length; i += 4) { 5462 for (var i = 3; i < length; i += 4) {
  5463 +
  5464 +
5474 if ($scope.voId == "9" || $scope.voId == "11") { 5465 if ($scope.voId == "9" || $scope.voId == "11") {
5475 5466
5476 if (imageData1[i] == 0) { 5467 if (imageData1[i] == 0) {
@@ -8492,84 +8483,101 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l @@ -8492,84 +8483,101 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8492 8483
8493 $rootScope.systemNumber = event.currentTarget.id; 8484 $rootScope.systemNumber = event.currentTarget.id;
8494 8485
  8486 + if ($rootScope.systemNumber == 0) {
8495 8487
8496 - //NIKITA  
8497 - $rootScope.isHighlightBodyByBodySystem = true;  
8498 - $scope.systemMatchedTermList = new jinqJs()  
8499 - .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)  
8500 - .where('_SystemNumber == ' + event.currentTarget.id)  
8501 - .select();  
8502 -  
8503 - if ($rootScope.isHighLight == false) {  
8504 - //color the body gray  
8505 - $rootScope.isHighLight = true  
8506 - console.log('highLightBody from HighlightBodyByBodySystem')  
8507 - $scope.highLightBody(); 8488 + console.log("inside HighlightBodyByBodySystem ..came inside current structure");
  8489 + //clear highlighted system
  8490 + $scope.removeCurrentHighlightedBodySystem();
  8491 + $scope.EnableUI();
8508 } 8492 }
  8493 +
8509 else { 8494 else {
8510 - //This else is when user seraced anything then change the view and clicked on highlight options  
8511 - //in this case body is already highlihted(gray) so no need to  
8512 - if ($scope.grayedBR != null || $scope.grayedBR != undefined) {  
8513 - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {  
8514 - $scope.isAlreadyHighlighted = true;  
8515 - }  
8516 - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {  
8517 - $scope.isAlreadyHighlighted = true;  
8518 - }  
8519 - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {  
8520 - $scope.isAlreadyHighlighted = true;  
8521 - }  
8522 - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {  
8523 - $scope.isAlreadyHighlighted = true;  
8524 - }  
8525 - if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) { 8495 + //NIKITA
  8496 + $rootScope.isHighlightBodyByBodySystem = true;
  8497 + $scope.systemMatchedTermList = new jinqJs()
  8498 + .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
  8499 + .where('_SystemNumber == ' + event.currentTarget.id)
  8500 + .select();
8526 8501
8527 - $scope.isLoading = true; 8502 + if ($rootScope.isHighLight == false) {
  8503 + //color the body gray
  8504 + $rootScope.isHighLight = true
  8505 + console.log('highLightBody from HighlightBodyByBodySystem')
  8506 + $scope.highLightBody();
  8507 + }
  8508 + else {
  8509 + //This else is when user seraced anything then change the view and clicked on highlight options
  8510 + //in this case body is already highlihted(gray) so no need to
  8511 + if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
  8512 + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
  8513 + $scope.isAlreadyHighlighted = true;
  8514 + }
  8515 + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
  8516 + $scope.isAlreadyHighlighted = true;
  8517 + }
  8518 + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
  8519 + $scope.isAlreadyHighlighted = true;
  8520 + }
  8521 + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
  8522 + $scope.isAlreadyHighlighted = true;
  8523 + }
  8524 + if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) {
8528 8525
8529 - $('#spinner').css('visibility', 'visible');  
8530 - $timeout(function () { $scope.HighlightBodyByTermListForBodySystem($scope.systemMatchedTermList) }, 100); 8526 + $scope.isLoading = true;
  8527 +
  8528 + $('#spinner').css('visibility', 'visible');
  8529 + $timeout(function () { $scope.HighlightBodyByTermListForBodySystem($scope.systemMatchedTermList) }, 100);
  8530 + }
8531 } 8531 }
8532 } 8532 }
8533 - }  
8534 -  
8535 8533
8536 - //$rootScope.isLoading = true;  
8537 - $('#spinner').css('visibility', 'visible');  
8538 8534
8539 - //NIKITA  
8540 - // $rootScope.isHighlightBodyByBodySystem = true; 8535 + //$rootScope.isLoading = true;
  8536 + $('#spinner').css('visibility', 'visible');
8541 8537
8542 - //if (systemMatchedTermList != null || systemMatchedTermList != undefined) { 8538 +
  8539 + var viewtarget_highlightbody = angular.element(event.currentTarget);
  8540 + var title_highlightbody = viewtarget_highlightbody.attr('title');
8543 8541
8544 - // $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);  
8545 - //} 8542 + $scope.removeBodySyetemSelectionClass(title_highlightbody);
8546 8543
  8544 + //Highlight button should be active
  8545 + $("#btnHighLight").addClass("btn-primary");
  8546 + $("#btnHighLight").removeClass("btn-black");
8547 8547
8548 - var viewtarget_highlightbody = angular.element(event.currentTarget);  
8549 - var title_highlightbody = viewtarget_highlightbody.attr('title'); 8548 + if (!$("#btnNormalMode").hasClass("btn-black")) {
  8549 + $("#btnNormalMode").addClass("btn-black");
  8550 + }
8550 8551
8551 - $scope.removeBodySyetemSelectionClass(title_highlightbody); 8552 + if (!$("#btnExtract").hasClass("btn-black")) {
  8553 + $("#btnExtract").addClass("btn-black");
  8554 + }
8552 8555
8553 - //Highlight button should be active  
8554 - $("#btnHighLight").addClass("btn-primary");  
8555 - $("#btnHighLight").removeClass("btn-black"); 8556 + if ($("#btnExtract").hasClass("btn-primary")) {
  8557 + $("#btnExtract").removeClass("btn-primary");
  8558 + }
8556 8559
8557 - if (!$("#btnNormalMode").hasClass("btn-black")) {  
8558 - $("#btnNormalMode").addClass("btn-black"); 8560 + if ($("#btnNormalMode").hasClass("btn-primary")) {
  8561 + $("#btnNormalMode").removeClass("btn-primary");
  8562 + }
8559 } 8563 }
  8564 + }
8560 8565
8561 - if (!$("#btnExtract").hasClass("btn-black")) {  
8562 - $("#btnExtract").addClass("btn-black");  
8563 - } 8566 + $scope.removeCurrentHighlightedBodySystem = function(){
8564 8567
8565 - if ($("#btnExtract").hasClass("btn-primary")) {  
8566 - $("#btnExtract").removeClass("btn-primary");  
8567 - } 8568 + for (var i = 0; i < $rootScope.grayImageDataList.length; i++) {
  8569 + var grayCanvasID = 'imageCanvas' + parseInt(i + 1);
  8570 + var grayCanvas = document.getElementById(grayCanvasID);
8568 8571
8569 - if ($("#btnNormalMode").hasClass("btn-primary")) {  
8570 - $("#btnNormalMode").removeClass("btn-primary");  
8571 - } 8572 + if (grayCanvas != null) {
  8573 + var grayCanvasContext = grayCanvas.getContext("2d");
8572 8574
  8575 + var canvasHeight = grayCanvas.height;
  8576 + var canvasWidth = grayCanvas.width;
  8577 + grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth)
  8578 + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0);
  8579 + }
  8580 + }
8573 } 8581 }
8574 8582
8575 $scope.removeBodySyetemSelectionClass = function (title_highlightbody) { 8583 $scope.removeBodySyetemSelectionClass = function (title_highlightbody) {
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
@@ -168,7 +168,7 @@ @@ -168,7 +168,7 @@
168 <div class="custom-tooltip">Highlight Options</div> 168 <div class="custom-tooltip">Highlight Options</div>
169 <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" ng-click="LoadBodySystemData()"><img src="content/images/icon-highlight.png" alt="" title=""></button> 169 <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" ng-click="LoadBodySystemData()"><img src="content/images/icon-highlight.png" alt="" title=""></button>
170 <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> 170 <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
171 - <li ng-class="CurrentStructure"><a href="#" title="Current Structure">Current Structure</a></li> 171 + <li ng-class="CurrentStructure"><a href="#" title="Current Structure" id="0" onclick="OnBodySystemSelection(event)">Current Structure</a></li>
172 <li role="separator" class="divider"></li> 172 <li role="separator" class="divider"></li>
173 <!--<li ng-class="Cardiovascular"><a href="#" title="Cardiovascular" id="1" ng-click="HighlightBodyByBodySystem($event)">Cardiovascular</a></li> 173 <!--<li ng-class="Cardiovascular"><a href="#" title="Cardiovascular" id="1" ng-click="HighlightBodyByBodySystem($event)">Cardiovascular</a></li>
174 <li ng-class="Digestive"><a href="#" title="Digestive" id="2" ng-click="HighlightBodyByBodySystem($event)">Digestive</a></li> 174 <li ng-class="Digestive"><a href="#" title="Digestive" id="2" ng-click="HighlightBodyByBodySystem($event)">Digestive</a></li>