Commit 45e9436c0dbf5b7ec200730f4ae3cab42027ab15

Authored by Nikita Kulshreshtha
1 parent 48024a5a

Refs: #8286

changed the location of storing colored image canavs data. Now the data is stored in respective array  on creation of canvas.
Earlier the data was saved on highlightbody due to that on clicking second time on body there was white data instead of colored data.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1380,8 +1380,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1380 1380 // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1381 1381 $scope.MultiLanguageAnnationArray = [];
1382 1382 $scope.MultiLanguageAnnationArray.push(annotationText);
1383   - if (($rootScope.isExtract == true) && ($rootScope.previousHighlightList.length > 0)) { }
1384   - else
  1383 +
1385 1384 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1386 1385 }
1387 1386 else {
... ... @@ -1398,8 +1397,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1398 1397 $scope.MultiLanguageAnnationArray = [];
1399 1398 $scope.MultiLanguageAnnationArray.push(annotationText);
1400 1399  
1401   - if (($rootScope.isExtract == true) && ($rootScope.previousHighlightList.length > 0)) { }
1402   - else
  1400 +
1403 1401 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1404 1402 }
1405 1403 else {
... ... @@ -1408,8 +1406,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1408 1406 $scope.MultiLanguageAnnationArray = [];
1409 1407 $scope.MultiLanguageAnnationArray.push(annotationText);
1410 1408  
1411   - if (($rootScope.isExtract == true) && ($rootScope.previousHighlightList.length > 0)) { }
1412   - else
  1409 +
1413 1410 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1414 1411 }
1415 1412  
... ... @@ -1469,6 +1466,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1469 1466 }
1470 1467 );
1471 1468  
  1469 + //-NIKI-for solving extarct issue 8286
  1470 +
  1471 + var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR');
  1472 +
  1473 + var width = imageCanvas.width;
  1474 + var ht = imageCanvas.height;
  1475 +
  1476 + var coloredCanvasContext = imageCanvas.getContext("2d");
  1477 + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
  1478 + var coloredImageDataVar = coloredImageData;
  1479 +
  1480 + $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)] = coloredImageDataVar;
  1481 +
  1482 +
  1483 +
  1484 + //
1472 1485  
1473 1486 // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length)
1474 1487  
... ... @@ -1725,8 +1738,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1725 1738 // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1726 1739 $scope.MultiLanguageAnnationArray = [];
1727 1740 $scope.MultiLanguageAnnationArray.push(annotationText);
1728   - if (($rootScope.isExtract == true) && ($rootScope.previousHighlightList.length > 0)) { }
1729   - else
  1741 +
1730 1742 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1731 1743 }
1732 1744 else {
... ... @@ -1751,8 +1763,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1751 1763  
1752 1764 console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
1753 1765  
1754   - if (($rootScope.isExtract == true) && ($rootScope.previousHighlightList.length > 0)) { }
1755   - else
1756 1766 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1757 1767  
1758 1768 }
... ... @@ -1765,8 +1775,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1765 1775  
1766 1776 console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
1767 1777  
1768   - if (($rootScope.isExtract == true) && ($rootScope.previousHighlightList.length > 0)) { }
1769   - else
1770 1778 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1771 1779 }
1772 1780  
... ... @@ -1812,6 +1820,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1812 1820 );
1813 1821  
1814 1822  
  1823 + //-NIKI-for solving extarct issue 8286
  1824 +
  1825 + var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId);
  1826 +
  1827 + var width = imageCanvas.width;
  1828 + var ht = imageCanvas.height;
  1829 +
  1830 + var coloredCanvasContext = imageCanvas.getContext("2d");
  1831 + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
  1832 + var coloredImageDataVar = coloredImageData;
  1833 +
  1834 +
  1835 + $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar;
  1836 + //
  1837 +
1815 1838 if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
1816 1839  
1817 1840 if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
... ... @@ -2031,8 +2054,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2031 2054  
2032 2055  
2033 2056 grayCanvasContext.putImageData(updatedData, 0, 0);
2034   -
2035   -
  2057 +
  2058 +
2036 2059 //to resolve lateral arm black issue in highlight mode
2037 2060  
2038 2061 if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) {
... ... @@ -5297,15 +5320,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5297 5320 var coloredImageDataVar = coloredImageData;
5298 5321  
5299 5322  
5300   - if (value.haveMirror == 'true') {
5301   - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
5302   - }
5303   - else {
  5323 + //if (value.haveMirror == 'true') {
  5324 + // $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
  5325 + //}
  5326 + //else {
5304 5327  
5305 5328  
5306   - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
  5329 + // $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
5307 5330  
5308   - }
  5331 + //}
5309 5332  
5310 5333  
5311 5334 var context_gray = imageCanvas.getContext('2d');
... ... @@ -5504,14 +5527,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5504 5527 var coloredImageDataVar = coloredImageData;
5505 5528  
5506 5529  
5507   - if (value.haveMirror == 'true') {
5508   - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
5509   - }
5510   - else {
  5530 + //if (value.haveMirror == 'true') {
  5531 + // $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
  5532 + //}
  5533 + //else {
5511 5534  
5512   - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
  5535 + // $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
5513 5536  
5514   - }
  5537 + //}
5515 5538  
5516 5539  
5517 5540 var context = imageCanvas.getContext('2d');
... ...