Commit 43d2d53f9fbd22e2488cc9bdb6309562029b7765

Authored by Amrita Vishnoi
1 parent b41e41fa

manually merged branch Bug#23948

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -5429,28 +5429,47 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
5429 5429 var imageData = imageD.data;
5430 5430 var length = imageData.length;
5431 5431  
5432   - // set every fourth value to the desired number of transparency
5433 5432  
  5433 + //to resolve lateral arm black issue in highlight mode
  5434 + if ($scope.isHighLight) {
  5435 + // if ($scope.voId == "9" || $scope.voId == "11") {
  5436 +
  5437 + var c = 0;
  5438 + for (var i = 0; i < imageData.length; i += 4) {
  5439 + if (imageData[i] == imageData[i + 1] && imageData[i + 1] == imageData[i + 2] && imageData[i + 2] === 0) {
  5440 + imageData[i + 3] = 0;
  5441 + }
  5442 +
  5443 + }
  5444 + tempCtx.putImageData(imageD, 0, 0);
  5445 + //}
  5446 + }
  5447 + // set every fourth value to the desired number of transparency
  5448 + var imageD1 = tempCtx.getImageData(0, 0, Width, Height);
  5449 + var imageData1 = imageD1.data;
  5450 + var length = imageData.length;
5434 5451  
5435 5452 for (var i = 3; i < length; i += 4) {
5436 5453 if ($scope.voId == "9" || $scope.voId == "11") {
5437 5454  
5438   - if (imageData[i] == 0) {
  5455 + if (imageData1[i] == 0) {
5439 5456  
5440 5457 }
5441 5458 else {
5442   - imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  5459 + imageData1[i] = ((255) * (parseInt(transNumber))) / 100;
5443 5460 }
5444 5461 }
5445 5462 else {
5446 5463  
5447   - imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  5464 + imageData1[i] = ((255) * (parseInt(transNumber))) / 100;
5448 5465 }
5449 5466  
5450 5467  
5451 5468 }
5452 5469  
5453   - tempCtx.putImageData(imageD, 0, 0);
  5470 +
  5471 +
  5472 + tempCtx.putImageData(imageD1, 0, 0);
5454 5473  
5455 5474  
5456 5475 $scope.widthOfImage = WidthforTransImage;
... ... @@ -5520,7 +5539,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5520 5539 $scope.EnableUI();
5521 5540 }
5522 5541  
5523   -
5524 5542 $scope.changeTransparency = function () {
5525 5543 //this changes the transparency when user click on transparency scale(we have already set the original
5526 5544 //data on tras canvas irrespective of the trans number, so we can chnage the transparnecy of original data not the manipulated)
... ... @@ -5534,31 +5552,52 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5534 5552 var modestyTemCanvas = $("canvas[id*='tempCanvasModesty_']");
5535 5553 if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
5536 5554  
  5555 + //for modesty
5537 5556 for (var j = 0; j < modestyTransCanvases.length; j++) {
5538   - var ctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d');
5539   - var imageDa = ctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height);
  5557 + var modctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d');
  5558 + var modimageDa = modctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height);
5540 5559 //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]);
5541 5560  
5542   - var imageData = imageDa.data;
5543   - var length = imageData.length;
5544   - // set every fourth value to 50
  5561 + var modimageData = modimageDa.data;
  5562 + var length = modimageData.length;
  5563 +
  5564 + if ($scope.isHighLight) {
  5565 + //if ($scope.voId == "9" || $scope.voId == "11") {
  5566 +
  5567 + var c = 0;
  5568 + for (var i = 0; i < modimageData.length; i += 4) {
  5569 + if (modimageData[i] == modimageData[i + 1] && modimageData[i + 1] == modimageData[i + 2] && modimageData[i + 2] === 0) {
  5570 + modimageData[i + 3] = 0;
  5571 + }
  5572 +
  5573 + }
  5574 + modctx.putImageData(modimageDa, 0, 0);
  5575 + // }
  5576 + }
  5577 + // set every fourth value to desired transparency
  5578 + var ctx1 = document.getElementById(modestyTransCanvases[j].id).getContext('2d');
  5579 + var imageDa1 = ctx1.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height);
  5580 + //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]);
  5581 +
  5582 + var imageData1 = imageDa1.data;
  5583 + var length = imageData1.length;
5545 5584 for (var i = 3; i < length; i += 4) {
5546   - //NIKITA
  5585 +
5547 5586 if ($scope.voId == "9" || $scope.voId == "11") {
5548 5587  
5549   - if (imageData[i] == 0) {
  5588 + if (imageData1[i] == 0) {
5550 5589  
5551 5590 }
5552 5591 else {
5553   - imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  5592 + imageData1[i] = ((255) * (parseInt(transNumber))) / 100;
5554 5593 }
5555 5594 }
5556 5595 else {
5557   - if (imageData[i] == 0) {
  5596 + if (imageData1[i] == 0) {
5558 5597  
5559 5598 }
5560 5599 else
5561   - imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  5600 + imageData1[i] = ((255) * (parseInt(transNumber))) / 100;
5562 5601 }
5563 5602  
5564 5603 // imageData[i] = ((255) * (parseInt(transNumber))) / 100;
... ... @@ -5567,7 +5606,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5567 5606 // imageDa.data = imageData;
5568 5607 // and put the imagedata back to the canvas
5569 5608 //ctx.putImageData(imageDa, XforTransImage, YforTransImage);
5570   - ctx.putImageData(imageDa, 0, 0);
  5609 + ctx1.putImageData(imageDa1, 0, 0);
5571 5610 }
5572 5611 }
5573 5612  
... ... @@ -5575,12 +5614,32 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5575 5614 var ctx = document.getElementById('transparencyCanvas').getContext('2d');
5576 5615  
5577 5616 // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage);
  5617 + var imageDa1 = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight);
  5618 +
  5619 + // get the image data values
  5620 + var imageData1 = imageDa1.data;
  5621 + var length = imageData1.length;
  5622 +
  5623 + if ($scope.isHighLight) {
  5624 + if ($scope.voId == "9" || $scope.voId == "11") {
  5625 +
  5626 + var c = 0;
  5627 + for (var i = 0; i < imageData1.length; i += 4) {
  5628 + if (imageData1[i] == imageData1[i + 1] && imageData1[i + 1] == imageData1[i + 2] && imageData1[i + 2] === 0) {
  5629 + imageData1[i + 3] = 0;
  5630 + }
  5631 +
  5632 + }
  5633 + ctx.putImageData(imageDa1, 0, 0);
  5634 + }
  5635 + }
  5636 +
  5637 + // set every fourth value to selected transparency
5578 5638 var imageDa = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight);
5579 5639  
5580 5640 // get the image data values
5581 5641 var imageData = imageDa.data;
5582 5642 var length = imageData.length;
5583   - // set every fourth value to 50
5584 5643 for (var i = 3; i < length; i += 4) {
5585 5644 //NIKITA
5586 5645 if ($scope.voId == "9" || $scope.voId == "11") {
... ... @@ -5611,7 +5670,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5611 5670  
5612 5671 //}
5613 5672 }
5614   -
5615 5673 // History Maintained Issue//
5616 5674  
5617 5675 $rootScope.getAnnotationTextBasedOnSelectedBodyRegion = function (event) {
... ...