Commit 78891bc8814f06b090b0a1dec997660df52b1acf
commit after LArmBlackIssue merge
Showing
2 changed files
with
425 additions
and
806 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -4741,11 +4741,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4741 | 4741 | |
4742 | 4742 | } |
4743 | 4743 | |
4744 | - var context_gray = imageCanvas.getContext('2d'); | |
4745 | 4744 | |
4746 | - var dataURL = imageCanvas.toDataURL(); | |
4747 | - var img = new Image(); | |
4748 | - img.src = dataURL; | |
4745 | + var context_gray = imageCanvas.getContext('2d'); | |
4746 | + | |
4747 | + var dataURL = imageCanvas.toDataURL(); | |
4748 | + | |
4749 | + | |
4750 | + var img = new Image(); | |
4751 | + | |
4752 | + img.src = dataURL; | |
4749 | 4753 | |
4750 | 4754 | img.onload = function () { |
4751 | 4755 | console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' |
... | ... | @@ -4768,9 +4772,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4768 | 4772 | DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); |
4769 | 4773 | |
4770 | 4774 | |
4771 | - context_gray.putImageData(DAData.data, 0, 0) | |
4775 | + context_gray.putImageData(DAData.data, 0, 0) | |
4772 | 4776 | |
4773 | - $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); | |
4777 | + //NIKI- to resolve lateral arm black issue in highlight mode | |
4774 | 4778 | |
4775 | 4779 | if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) { |
4776 | 4780 | |
... | ... | @@ -4791,6 +4795,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4791 | 4795 | |
4792 | 4796 | |
4793 | 4797 | |
4798 | + //push BRID into array | |
4799 | + $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); | |
4794 | 4800 | |
4795 | 4801 | var grayImageData = context_gray.getImageData(0, 0, width, ht); |
4796 | 4802 | var grayImageImageDataVar = grayImageData.data; |
... | ... | @@ -6303,7 +6309,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6303 | 6309 | $("#canvasDiv").scrollTop(scrolly); |
6304 | 6310 | $("#canvasDiv").scrollLeft(scrollx); |
6305 | 6311 | |
6306 | - $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); | |
6312 | + if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { | |
6313 | + $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); | |
6314 | + } | |
6307 | 6315 | |
6308 | 6316 | } |
6309 | 6317 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js.orig
... | ... | @@ -211,8 +211,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
211 | 211 | if ($scope.selectedGenderBodyViewData != null || $scope.selectedGenderBodyViewData != undefined) { |
212 | 212 | angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { |
213 | 213 | |
214 | - var userEthnicity = $rootScope.globalSetting.ethnicity; | |
215 | - var userModestysettings = $rootScope.globalSetting.modesty; | |
214 | + | |
215 | + var userEthnicity; | |
216 | + var userModestysettings; | |
217 | + var curentEthnicity = localStorage.getItem("globalEthnicity"); | |
218 | + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { | |
219 | + userEthnicity = curentEthnicity; | |
220 | + } | |
221 | + else { | |
222 | + userEthnicity = $rootScope.globalSetting.ethnicity; | |
223 | + } | |
224 | + | |
225 | + var curentmodesty = localStorage.getItem("globalmodesty"); | |
226 | + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { | |
227 | + userModestysettings = curentmodesty | |
228 | + } | |
229 | + else { | |
230 | + userModestysettings = $rootScope.globalSetting.modesty; | |
231 | + } | |
232 | + | |
233 | + | |
234 | + | |
216 | 235 | //var userSelectedSkintone = 'W'; |
217 | 236 | //$scope.userModestySetting = 'Y' |
218 | 237 | var thumbnailImage; |
... | ... | @@ -246,6 +265,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
246 | 265 | |
247 | 266 | $scope.openView = function ($event) { |
248 | 267 | // debugger; |
268 | + $rootScope.isLoading = true; | |
269 | + $('#spinner').css('visibility', 'visible'); | |
270 | + | |
249 | 271 | $rootScope.currentBodyViewId = $event.currentTarget.id; |
250 | 272 | $rootScope.ViewTitle = $event.currentTarget.textContent; |
251 | 273 | |
... | ... | @@ -325,6 +347,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
325 | 347 | |
326 | 348 | //0. we will initially append container to load body |
327 | 349 | |
350 | + //check if localstorage has any settings | |
351 | + var curentEthnicity = localStorage.getItem("globalEthnicity"); | |
352 | + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { | |
353 | + $rootScope.globalSetting.ethnicity = curentEthnicity; | |
354 | + } | |
355 | + | |
356 | + var curentmodesty = localStorage.getItem("globalmodesty"); | |
357 | + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { | |
358 | + $rootScope.globalSetting.modesty = curentmodesty | |
359 | + } | |
360 | + | |
328 | 361 | //0.1 |
329 | 362 | var currentBodyViewId = localStorage.getItem("currentBodyViewId"); |
330 | 363 | |
... | ... | @@ -498,7 +531,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
498 | 531 | }); |
499 | 532 | |
500 | 533 | bodyViewWorker.onmessage = function (e) { |
501 | - console.log('callback in extr'); | |
534 | + //console.log('callback in extr'); | |
502 | 535 | |
503 | 536 | $rootScope.BodyRegionData = e.data.bodyRegionData; |
504 | 537 | $rootScope.bgartData = e.data.bodyArtData; |
... | ... | @@ -869,6 +902,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
869 | 902 | |
870 | 903 | |
871 | 904 | }); |
905 | + | |
906 | + $rootScope.isLoading = false; | |
907 | + $('#spinner').css('visibility', 'hidden'); | |
872 | 908 | } |
873 | 909 | |
874 | 910 | if (($rootScope.globalSetting.modesty == 'Y')) { |
... | ... | @@ -1131,6 +1167,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1131 | 1167 | $rootScope.multiAnnotationIsON = true; |
1132 | 1168 | } |
1133 | 1169 | else { |
1170 | + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { | |
1171 | + $rootScope.previousHighlightList = []; | |
1172 | + } | |
1173 | + | |
1134 | 1174 | $rootScope.multiAnnotationIsON = false; |
1135 | 1175 | } |
1136 | 1176 | |
... | ... | @@ -1331,52 +1371,47 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1331 | 1371 | } |
1332 | 1372 | ); |
1333 | 1373 | |
1334 | - // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) | |
1374 | + // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) | |
1335 | 1375 | |
1336 | - if (($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { | |
1337 | 1376 | |
1338 | - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
1339 | - | |
1340 | - if((($rootScope.viewOrientationId=='1') || ($rootScope.viewOrientationId=='4')) && ($scope.ColoredImageSRC.length == 9)) | |
1341 | - { | |
1377 | + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
1378 | + | |
1379 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
1342 | 1380 | $scope.isEligibleForHighlight = true; |
1343 | 1381 | } |
1344 | - else if((($rootScope.viewOrientationId=='2') || ($rootScope.viewOrientationId=='3')) && ($scope.ColoredImageSRC.length == 5)) | |
1345 | - { | |
1382 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
1346 | 1383 | $scope.isEligibleForHighlight = true; |
1347 | 1384 | } |
1348 | - else if(($rootScope.viewOrientationId=='5') && ($scope.ColoredImageSRC.length == 4)) | |
1349 | - { | |
1385 | + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { | |
1350 | 1386 | $scope.isEligibleForHighlight = true; |
1351 | 1387 | } |
1352 | - else if(($rootScope.viewOrientationId=='6') && ($scope.ColoredImageSRC.length == 1)) | |
1353 | - { | |
1388 | + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { | |
1354 | 1389 | $scope.isEligibleForHighlight = true; |
1355 | 1390 | } |
1356 | 1391 | else { |
1357 | 1392 | $scope.isEligibleForHighlight = false; |
1358 | 1393 | } |
1359 | - | |
1360 | - if($scope.isEligibleForHighlight == true) | |
1361 | - { | |
1394 | + | |
1395 | + if ($scope.isEligibleForHighlight == true) { | |
1396 | + if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { | |
1362 | 1397 | |
1363 | 1398 | $rootScope.isLoading = false; |
1364 | 1399 | $('#spinner').css('visibility', 'hidden'); |
1365 | 1400 | |
1366 | - | |
1367 | - $rootScope.isLoading = true; | |
1368 | - $('#spinner').css('visibility', 'visible'); | |
1369 | - $timeout(function () { | |
1370 | - console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1371 | - $rootScope.isHighLight = true; | |
1372 | 1401 | |
1373 | - $scope.highLightBody() | |
1374 | - }, 500); | |
1375 | - } | |
1376 | - } | |
1402 | + $rootScope.isLoading = true; | |
1403 | + $('#spinner').css('visibility', 'visible'); | |
1404 | + $timeout(function () { | |
1405 | + console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1406 | + $rootScope.isHighLight = true; | |
1407 | + | |
1408 | + $scope.highLightBody() | |
1409 | + }, 500); | |
1410 | + } | |
1411 | + } | |
1377 | 1412 | } |
1378 | 1413 | |
1379 | - // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); | |
1414 | + // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); | |
1380 | 1415 | } |
1381 | 1416 | |
1382 | 1417 | if (FlipedImgCanvas.id.match('_mci')) { |
... | ... | @@ -1402,7 +1437,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1402 | 1437 | } |
1403 | 1438 | |
1404 | 1439 | $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { |
1405 | - | |
1440 | + | |
1406 | 1441 | var imgCanvas = document.createElement('canvas'); |
1407 | 1442 | // imgCanvas.style.backgroundColor = 'red'; |
1408 | 1443 | imgCanvas.height = h; |
... | ... | @@ -1459,6 +1494,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1459 | 1494 | $rootScope.multiAnnotationIsON = true; |
1460 | 1495 | } |
1461 | 1496 | else { |
1497 | + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { | |
1498 | + $rootScope.previousHighlightList = []; | |
1499 | + } | |
1462 | 1500 | $rootScope.multiAnnotationIsON = false; |
1463 | 1501 | } |
1464 | 1502 | |
... | ... | @@ -1650,8 +1688,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1650 | 1688 | if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') { |
1651 | 1689 | //do nothing |
1652 | 1690 | } |
1653 | - else | |
1654 | - { | |
1691 | + else { | |
1655 | 1692 | $scope.ColoredImageSRC.push( |
1656 | 1693 | { |
1657 | 1694 | "bodyRegionId": bodyRegionId, "SRC": src, |
... | ... | @@ -1664,28 +1701,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1664 | 1701 | |
1665 | 1702 | ); |
1666 | 1703 | |
1667 | - console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) | |
1668 | - if (($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { | |
1704 | + //console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) | |
1669 | 1705 | |
1670 | - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
1706 | + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
1671 | 1707 | |
1672 | - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
1673 | - $scope.isEligibleForHighlight = true; | |
1674 | - } | |
1675 | - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
1676 | - $scope.isEligibleForHighlight = true; | |
1677 | - } | |
1678 | - else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { | |
1679 | - $scope.isEligibleForHighlight = true; | |
1680 | - } | |
1681 | - else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { | |
1682 | - $scope.isEligibleForHighlight = true; | |
1683 | - } | |
1684 | - else { | |
1685 | - $scope.isEligibleForHighlight = false; | |
1686 | - } | |
1708 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
1709 | + $scope.isEligibleForHighlight = true; | |
1710 | + } | |
1711 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
1712 | + $scope.isEligibleForHighlight = true; | |
1713 | + } | |
1714 | + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { | |
1715 | + $scope.isEligibleForHighlight = true; | |
1716 | + } | |
1717 | + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { | |
1718 | + $scope.isEligibleForHighlight = true; | |
1719 | + } | |
1720 | + else { | |
1721 | + $scope.isEligibleForHighlight = false; | |
1722 | + } | |
1687 | 1723 | |
1688 | - if ($scope.isEligibleForHighlight == true) { | |
1724 | + if ($scope.isEligibleForHighlight == true) { | |
1725 | + if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { | |
1689 | 1726 | |
1690 | 1727 | $rootScope.isLoading = false; |
1691 | 1728 | $('#spinner').css('visibility', 'hidden'); |
... | ... | @@ -1707,37 +1744,37 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1707 | 1744 | } |
1708 | 1745 | } |
1709 | 1746 | |
1710 | - // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && ($scope.ColoredImageSRC.length == 9)) { | |
1711 | - // console.log('after check= ' + $scope.ColoredImageSRC.length) | |
1712 | - // $rootScope.isLoading = false; | |
1713 | - // $('#spinner').css('visibility', 'hidden'); | |
1714 | - | |
1715 | - // if ($rootScope.isListManagerSelected == true || $rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { | |
1716 | - // $rootScope.isLoading = true; | |
1717 | - // $('#spinner').css('visibility', 'visible'); | |
1718 | - // $timeout(function () { | |
1719 | - // console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1720 | - // $rootScope.isHighLight = true; | |
1721 | - | |
1722 | - // $scope.highLightBody() | |
1723 | - // }, 500); | |
1724 | - // } | |
1725 | - // } | |
1726 | - // } | |
1747 | + // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && ($scope.ColoredImageSRC.length == 9)) { | |
1748 | + // console.log('after check= ' + $scope.ColoredImageSRC.length) | |
1749 | + // $rootScope.isLoading = false; | |
1750 | + // $('#spinner').css('visibility', 'hidden'); | |
1751 | + | |
1752 | + // if ($rootScope.isListManagerSelected == true || $rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { | |
1753 | + // $rootScope.isLoading = true; | |
1754 | + // $('#spinner').css('visibility', 'visible'); | |
1755 | + // $timeout(function () { | |
1756 | + // console.log('$scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1757 | + // $rootScope.isHighLight = true; | |
1758 | + | |
1759 | + // $scope.highLightBody() | |
1760 | + // }, 500); | |
1761 | + // } | |
1762 | + // } | |
1763 | + // } | |
1764 | + | |
1765 | + //} | |
1766 | + if (imgCanvas.id.match('_mci')) { | |
1767 | + var maskImgData = context.getImageData(0, 0, w, h); | |
1768 | + $rootScope.MaskCanvasData.push( | |
1769 | + { | |
1770 | + "bodyRegionId": bodyRegionId, | |
1771 | + "canvasId": imgCanvas.id, | |
1772 | + "maskData": maskImgData, | |
1773 | + | |
1774 | + } | |
1775 | + ); | |
1776 | + } | |
1727 | 1777 | |
1728 | - //} | |
1729 | - if (imgCanvas.id.match('_mci')) { | |
1730 | - var maskImgData = context.getImageData(0, 0, w, h); | |
1731 | - $rootScope.MaskCanvasData.push( | |
1732 | - { | |
1733 | - "bodyRegionId": bodyRegionId, | |
1734 | - "canvasId": imgCanvas.id, | |
1735 | - "maskData": maskImgData, | |
1736 | - | |
1737 | - } | |
1738 | - ); | |
1739 | - } | |
1740 | - | |
1741 | 1778 | }; |
1742 | 1779 | |
1743 | 1780 | if (document.getElementById('canvasDiv') != null) |
... | ... | @@ -1761,7 +1798,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1761 | 1798 | if (TermList != null) { |
1762 | 1799 | |
1763 | 1800 | //4. |
1764 | - | |
1765 | 1801 | $scope.HighlightBodyByTermList(TermList); |
1766 | 1802 | } |
1767 | 1803 | } |
... | ... | @@ -1873,27 +1909,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1873 | 1909 | var bodyRegionId = e.data.bodyRegionId; |
1874 | 1910 | |
1875 | 1911 | |
1876 | - //if ((CallBackBodyRegion != null || CallBackBodyRegion != undefined)) | |
1877 | - //{ | |
1878 | - // if (CallBackBodyRegion.length > 0) { | |
1879 | - // for (var i = 1; i <= CallBackBodyRegion.length; i++) { | |
1880 | - // if (CallBackBodyRegion[i].match(bodyRegionId)) { | |
1881 | - // console.log("already have body region id: " + bodyRegionId); | |
1882 | - // } | |
1883 | - // else { | |
1884 | - // CallBackBodyRegion.push(bodyRegionId); | |
1885 | - | |
1886 | - // console.log("pushed body region id: " + bodyRegionId); | |
1887 | - // } | |
1888 | - // } | |
1889 | - // } | |
1890 | - // else | |
1891 | - | |
1892 | - // { | |
1893 | - // CallBackBodyRegion.push(bodyRegionId); | |
1894 | - // } | |
1895 | - //} | |
1896 | - | |
1897 | 1912 | var canvasId = (e.data.canvasId).replace('_mci', ''); |
1898 | 1913 | //debugger; |
1899 | 1914 | //for (var i = 1; i <= updatedData.length; i++) { |
... | ... | @@ -1952,7 +1967,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1952 | 1967 | |
1953 | 1968 | console.log('HighlightBodyByTermList is called'); |
1954 | 1969 | |
1955 | - $scope.highlightedBR = null; | |
1970 | + // $scope.highlightedBR = null; | |
1956 | 1971 | $scope.highlightedBR = []; |
1957 | 1972 | |
1958 | 1973 | $scope.terminateCurrentlyRunningWPs(); |
... | ... | @@ -2244,6 +2259,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2244 | 2259 | //layer change function |
2245 | 2260 | $scope.LayerChange = function () { |
2246 | 2261 | |
2262 | + $rootScope.isLoading = true; | |
2263 | + $('#spinner').css('visibility', 'visible'); | |
2264 | + | |
2247 | 2265 | //1. |
2248 | 2266 | $scope.terminateCurrentlyRunningWPs(); |
2249 | 2267 | |
... | ... | @@ -2351,17 +2369,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2351 | 2369 | $timeout(function () { $scope.DisableProgressBar() }, 1000); |
2352 | 2370 | } |
2353 | 2371 | |
2354 | - //if ($rootScope.isHighLight) { | |
2355 | - // //alert('isHighlight: ' + $scope.isHighLight); | |
2356 | - | |
2357 | - // $('#btnHighLight').removeClass('btn btn-black'); | |
2358 | - // $('#btnHighLight').addClass('btn-primary'); | |
2359 | - | |
2360 | - // $timeout(function () { $scope.highLightBody() }, 350); | |
2361 | - | |
2362 | - | |
2363 | - | |
2364 | - //} | |
2365 | 2372 | $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber)); |
2366 | 2373 | } |
2367 | 2374 | |
... | ... | @@ -4300,10 +4307,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4300 | 4307 | |
4301 | 4308 | var tBox = document.getElementById('transparencyCanvas'); |
4302 | 4309 | |
4303 | -<<<<<<< HEAD | |
4304 | - | |
4305 | -======= | |
4306 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4310 | + | |
4307 | 4311 | if (tBox != null) { |
4308 | 4312 | tBox.parentNode.removeChild(tBox) |
4309 | 4313 | var elements = document.getElementsByClassName('ui-icon ui-icon-gripsmall-diagonal-se'); |
... | ... | @@ -4582,9 +4586,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4582 | 4586 | |
4583 | 4587 | |
4584 | 4588 | } |
4585 | - | |
4586 | - | |
4587 | - $timeout(function () { $scope.highLightBody() }, 50); | |
4589 | + else { | |
4590 | + $timeout(function () { $scope.highLightBody() }, 50); | |
4591 | + } | |
4588 | 4592 | |
4589 | 4593 | } |
4590 | 4594 | |
... | ... | @@ -4682,355 +4686,197 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4682 | 4686 | |
4683 | 4687 | $scope.terminateCurrentlyRunningWPs(); |
4684 | 4688 | |
4685 | -<<<<<<< HEAD | |
4686 | 4689 | //different body views have different count of bodyegions so the length of ColoredImageSRC will be different |
4687 | - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
4690 | + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
4688 | 4691 | |
4689 | - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
4690 | - $scope.doHighlightOrExtract = true; | |
4691 | - } | |
4692 | - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
4693 | - $scope.doHighlightOrExtract = true; | |
4694 | - } | |
4695 | - else if ((($rootScope.viewOrientationId == '5')) && ($scope.ColoredImageSRC.length == 4)) { | |
4696 | - $scope.doHighlightOrExtract = true; | |
4697 | - } | |
4698 | - else if ((($rootScope.viewOrientationId == '6')) && ($scope.ColoredImageSRC.length == 1)) { | |
4699 | - $scope.doHighlightOrExtract = true; | |
4700 | - } | |
4701 | - else { | |
4702 | - $scope.doHighlightOrExtract = false; | |
4703 | - } | |
4692 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
4693 | + $scope.doHighlightOrExtract = true; | |
4694 | + } | |
4695 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
4696 | + $scope.doHighlightOrExtract = true; | |
4697 | + } | |
4698 | + else if ((($rootScope.viewOrientationId == '5')) && ($scope.ColoredImageSRC.length == 4)) { | |
4699 | + $scope.doHighlightOrExtract = true; | |
4700 | + } | |
4701 | + else if ((($rootScope.viewOrientationId == '6')) && ($scope.ColoredImageSRC.length == 1)) { | |
4702 | + $scope.doHighlightOrExtract = true; | |
4703 | + } | |
4704 | + else { | |
4705 | + $scope.doHighlightOrExtract = false; | |
4706 | + } | |
4704 | 4707 | |
4705 | 4708 | |
4706 | - if ($scope.doHighlightOrExtract == true) { | |
4707 | - if ($rootScope.isHighLight == true) { | |
4709 | + if ($scope.doHighlightOrExtract == true) { | |
4710 | + if ($rootScope.isHighLight == true) { | |
4708 | 4711 | |
4709 | - $scope.grayeddBR = []; | |
4712 | + $scope.grayedBR = []; | |
4710 | 4713 | |
4711 | - angular.forEach($scope.ColoredImageSRC, function (value, key) { | |
4712 | - console.log('$scope.ColoredImageSRC length begore gray= ' + $scope.ColoredImageSRC.length) | |
4713 | - var id; | |
4714 | - if (value.haveMirror == 'true') { | |
4715 | - id = 'imageCanvas' + value.bodyRegionId + '_MR'; | |
4716 | - } | |
4717 | - else { | |
4718 | - id = 'imageCanvas' + value.bodyRegionId; | |
4719 | - } | |
4714 | + angular.forEach($scope.ColoredImageSRC, function (value, key) { | |
4715 | + console.log('$scope.ColoredImageSRC length before gray= ' + $scope.ColoredImageSRC.length) | |
4716 | + var id; | |
4717 | + if (value.haveMirror == 'true') { | |
4718 | + id = 'imageCanvas' + value.bodyRegionId + '_MR'; | |
4719 | + } | |
4720 | + else { | |
4721 | + id = 'imageCanvas' + value.bodyRegionId; | |
4722 | + } | |
4720 | 4723 | |
4721 | - //alert(value.bodyRegionId) | |
4724 | + var imageCanvas = document.getElementById(id); | |
4722 | 4725 | |
4723 | - var imageCanvas = document.getElementById(id); | |
4724 | -======= | |
4725 | - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length == 9) { | |
4726 | + var width = value.Width; | |
4727 | + var ht = value.Height; | |
4726 | 4728 | |
4727 | - if ($rootScope.isHighLight == true) { | |
4729 | + var coloredCanvasContext = imageCanvas.getContext("2d"); | |
4730 | + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); | |
4731 | + var coloredImageDataVar = coloredImageData; | |
4728 | 4732 | |
4729 | - $scope.grayeddBR = []; | |
4730 | 4733 | |
4731 | - angular.forEach($scope.ColoredImageSRC, function (value, key) { | |
4732 | - var id; | |
4733 | - if (value.haveMirror == 'true') { | |
4734 | - id = 'imageCanvas' + value.bodyRegionId + '_MR'; | |
4735 | - } | |
4736 | - else { | |
4737 | - id = 'imageCanvas' + value.bodyRegionId; | |
4738 | - } | |
4734 | + if (value.haveMirror == 'true') { | |
4735 | + $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; | |
4736 | + } | |
4737 | + else { | |
4739 | 4738 | |
4740 | - var imageCanvas = document.getElementById(id); | |
4741 | 4739 | |
4742 | - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; | |
4743 | - //var coloredCanvas = document.getElementById(coloredCanvasID); | |
4740 | + $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; | |
4744 | 4741 | |
4745 | - var width = value.Width; | |
4746 | - var ht = value.Height; | |
4742 | + } | |
4747 | 4743 | |
4748 | - var coloredCanvasContext = imageCanvas.getContext("2d"); | |
4749 | - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); | |
4750 | - var coloredImageDataVar = coloredImageData; | |
4751 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4744 | + var context_gray = imageCanvas.getContext('2d'); | |
4752 | 4745 | |
4753 | - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; | |
4754 | - //var coloredCanvas = document.getElementById(coloredCanvasID); | |
4746 | + var dataURL = imageCanvas.toDataURL(); | |
4747 | + var img = new Image(); | |
4748 | + img.src = dataURL; | |
4755 | 4749 | |
4756 | -<<<<<<< HEAD | |
4757 | - var width = value.Width; | |
4758 | - var ht = value.Height; | |
4759 | -======= | |
4760 | - if (value.haveMirror == 'true') { | |
4761 | - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; | |
4762 | - } | |
4763 | - else { | |
4764 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4750 | + img.onload = function () { | |
4751 | + console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' | |
4752 | + + value.bodyRegionId) | |
4765 | 4753 | |
4766 | - var coloredCanvasContext = imageCanvas.getContext("2d"); | |
4767 | - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); | |
4768 | - var coloredImageDataVar = coloredImageData; | |
4754 | +<<<<<<< HEAD | |
4755 | + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); | |
4756 | + DAData.draw(img); | |
4769 | 4757 | |
4770 | -<<<<<<< HEAD | |
4758 | + var colorMode; | |
4771 | 4759 | |
4772 | - if (value.haveMirror == 'true') { | |
4773 | - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; | |
4760 | + if ($scope.isExtract == true) { | |
4761 | + colorMode = $scope.applyWhiteMatrix(img, context_gray); | |
4774 | 4762 | } |
4775 | 4763 | else { |
4776 | - | |
4777 | - | |
4778 | - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; | |
4779 | - | |
4764 | + colorMode = $scope.applyGrayMatrix(img, context_gray); | |
4780 | 4765 | } |
4781 | - | |
4782 | - | |
4783 | - var context_gray = imageCanvas.getContext('2d'); | |
4784 | - | |
4785 | - | |
4786 | - //NIKI- for lateral arm highlight issue | |
4787 | - | |
4788 | - if ($rootScope.viewOrientationId && value.bodyRegionId == 6) { | |
4789 | - var imgData = context_gray.getImageData(0, 0, width, ht); | |
4790 | - var data = imgData.data; | |
4791 | - for (var i = 0; i < data.length; i += 4) { | |
4792 | - // if (data[i + 3] < 255) { | |
4793 | - // data[i] = 255 - data[i]; | |
4794 | - // data[i + 1] = 255 - data[i + 1]; | |
4795 | - // data[i + 2] = 255 - data[i + 2]; | |
4796 | - data[i + 3] = 255//255 - data[i + 3]; | |
4797 | - // } | |
4798 | - } | |
4799 | - context_gray.putImageData(imgData, 0, 0); | |
4800 | - } | |
4801 | - //NIKI | |
4802 | - | |
4803 | - | |
4804 | - | |
4805 | - | |
4766 | +======= | |
4806 | 4767 | var dataURL = imageCanvas.toDataURL(); |
4807 | 4768 | |
4808 | 4769 | |
4809 | 4770 | var img = new Image(); |
4810 | 4771 | |
4811 | 4772 | img.src = dataURL; |
4773 | +>>>>>>> a080a6b1b96bcd2459bfec5e3fa4b17b26766772 | |
4812 | 4774 | |
4775 | + var zeroPoint = new Point(); | |
4813 | 4776 | |
4777 | + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
4814 | 4778 | |
4779 | +<<<<<<< HEAD | |
4780 | + context_gray.putImageData(DAData.data, 0, 0) | |
4781 | +======= | |
4815 | 4782 | img.onload = function () { |
4816 | - console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' | |
4817 | - + value.bodyRegionId) | |
4783 | + // console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= ' | |
4784 | + // + value.bodyRegionId) | |
4785 | +>>>>>>> a080a6b1b96bcd2459bfec5e3fa4b17b26766772 | |
4818 | 4786 | |
4819 | - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); | |
4820 | - DAData.draw(img); | |
4787 | + $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); | |
4821 | 4788 | |
4822 | - var colorMode; | |
4789 | + var grayImageData = context_gray.getImageData(0, 0, width, ht); | |
4790 | + var grayImageImageDataVar = grayImageData.data; | |
4823 | 4791 | |
4824 | - if ($scope.isExtract == true) { | |
4825 | - colorMode = $scope.applyWhiteMatrix(img, context_gray); | |
4792 | + if ($scope.isExtract == true) { | |
4793 | + if (value.haveMirror == 'true') { | |
4794 | + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
4826 | 4795 | } |
4827 | 4796 | else { |
4828 | - colorMode = $scope.applyGrayMatrix(img, context_gray); | |
4829 | - } | |
4830 | - | |
4831 | - var zeroPoint = new Point(); | |
4832 | - | |
4833 | - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
4834 | - | |
4835 | - context_gray.putImageData(DAData.data, 0, 0) | |
4836 | 4797 | |
4837 | - //push BRID into array | |
4838 | - $scope.grayeddBR.push({ 'BRID': value.bodyRegionId }); | |
4839 | - | |
4840 | - var grayImageData = context_gray.getImageData(0, 0, width, ht); | |
4841 | - var grayImageImageDataVar = grayImageData.data; | |
4842 | - | |
4843 | - if ($scope.isExtract == true) { | |
4844 | - if (value.haveMirror == 'true') { | |
4845 | - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
4846 | - } | |
4847 | - else { | |
4798 | + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
4799 | + } | |
4800 | + } | |
4801 | + else { | |
4848 | 4802 | |
4849 | - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
4850 | - } | |
4803 | +<<<<<<< HEAD | |
4804 | + if (value.haveMirror == 'true') { | |
4805 | + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
4851 | 4806 | } |
4852 | 4807 | else { |
4853 | - | |
4854 | - if (value.haveMirror == 'true') { | |
4855 | - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
4808 | +======= | |
4809 | + | |
4810 | + context_gray.putImageData(DAData.data, 0, 0) | |
4811 | + | |
4812 | + //NIKI- to resolve lateral arm black issue in highlight mode | |
4813 | + | |
4814 | + if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) { | |
4815 | + | |
4816 | + var imgData = context_gray.getImageData(0, 0, width, ht); | |
4817 | + var data = imgData.data; | |
4818 | + var c=0; | |
4819 | + for (var i = 0; i < data.length; i += 4) { | |
4820 | + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { | |
4821 | + data[i + 3] = 0; | |
4822 | + } | |
4823 | + | |
4856 | 4824 | } |
4857 | - else { | |
4858 | -======= | |
4859 | - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; | |
4860 | - | |
4861 | - } | |
4862 | - | |
4863 | - | |
4864 | - var context_gray = imageCanvas.getContext('2d'); | |
4865 | - | |
4866 | - | |
4867 | - var dataURL = imageCanvas.toDataURL(); | |
4868 | - | |
4869 | - | |
4870 | - var img = new Image(); | |
4871 | - | |
4872 | - img.src = dataURL; | |
4873 | - | |
4874 | - | |
4875 | - | |
4876 | - img.onload = function () { | |
4877 | - console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height)) | |
4878 | - | |
4879 | - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); | |
4880 | - DAData.draw(img); | |
4881 | - | |
4882 | - var colorMode; | |
4883 | - | |
4884 | - if ($scope.isExtract == true) { | |
4885 | - colorMode = $scope.applyWhiteMatrix(img, context_gray); | |
4886 | - } | |
4887 | - else { | |
4888 | - colorMode = $scope.applyGrayMatrix(img, context_gray); | |
4889 | - } | |
4890 | - | |
4891 | - var zeroPoint = new Point(); | |
4892 | - | |
4893 | - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
4894 | - | |
4895 | - context_gray.putImageData(DAData.data, 0, 0) | |
4896 | - | |
4897 | - //push BRID into array | |
4898 | - $scope.grayeddBR.push({ 'BRID': value.bodyRegionId }); | |
4899 | - | |
4900 | - if ($scope.grayeddBR.length == 9) { | |
4901 | - | |
4902 | - if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { | |
4903 | - | |
4904 | - $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); | |
4905 | - } | |
4906 | - else if ($scope.isHighlightByListManager == true) { | |
4907 | - | |
4908 | - console.log('$scope.grayeddBR.length is ' + $scope.grayeddBR.length); | |
4909 | - $timeout(function () { | |
4825 | + context_gray.putImageData(imgData, 0, 0); | |
4826 | + } | |
4827 | + | |
4910 | 4828 | |
4911 | - // $rootScope.isHighLight = false; | |
4912 | - //align | |
4913 | - // $scope.aligneCanvasWithTerm(); | |
4829 | + //NIKI | |
4914 | 4830 | |
4915 | - $scope.HighlightBodyByTermList($scope.AllTerms) | |
4916 | - }, 800); | |
4831 | + | |
4832 | +>>>>>>> a080a6b1b96bcd2459bfec5e3fa4b17b26766772 | |
4917 | 4833 | |
4834 | + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
4835 | + } | |
4918 | 4836 | } |
4919 | 4837 | |
4920 | - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
4921 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4922 | 4838 | |
4923 | - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
4924 | - } | |
4839 | + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { | |
4840 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { | |
4841 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4842 | + $scope.doHighlightOrExtract = false; | |
4843 | + } | |
4844 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { | |
4845 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4846 | + $scope.doHighlightOrExtract = false; | |
4847 | + } | |
4848 | + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { | |
4849 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4850 | + $scope.doHighlightOrExtract = false; | |
4851 | + } | |
4852 | + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { | |
4853 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4854 | + $scope.doHighlightOrExtract = false; | |
4925 | 4855 | } |
4856 | + else { | |
4926 | 4857 | |
4927 | -<<<<<<< HEAD | |
4858 | + $scope.isEligibleForHighlightBodyByTermList = false; | |
4859 | + } | |
4928 | 4860 | |
4861 | + if ($scope.isEligibleForHighlightBodyByTermList == true) { | |
4862 | + //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE | |
4863 | + if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { | |
4864 | + $scope.isLoading = false; | |
4929 | 4865 | |
4930 | - if ($scope.grayeddBR != null || $scope.grayeddBR != undefined) { | |
4931 | - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayeddBR.length == 9)) { | |
4932 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
4933 | - $scope.doHighlightOrExtract = false; | |
4934 | - } | |
4935 | - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayeddBR.length == 5)) { | |
4936 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
4937 | - $scope.doHighlightOrExtract = false; | |
4938 | - } | |
4939 | - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayeddBR.length == 4)) { | |
4940 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
4941 | - $scope.doHighlightOrExtract = false; | |
4866 | + $('#spinner').css('visibility', 'hidden'); | |
4942 | 4867 | } |
4943 | - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayeddBR.length == 1)) { | |
4944 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
4945 | - $scope.doHighlightOrExtract = false; | |
4946 | - } | |
4947 | - else { | |
4948 | - | |
4949 | - $scope.isEligibleForHighlightBodyByTermList = false; | |
4950 | - } | |
4951 | - | |
4952 | - if ($scope.isEligibleForHighlightBodyByTermList == true) { | |
4953 | - //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE | |
4954 | - if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { | |
4955 | - $scope.isLoading = false; | |
4956 | - | |
4957 | - $('#spinner').css('visibility', 'hidden'); | |
4958 | -======= | |
4959 | - console.log('inside highlight body'); | |
4960 | - | |
4961 | - var multiTermList = []; | |
4962 | - angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
4963 | - | |
4964 | - //debugger; | |
4965 | 4868 | |
4966 | - var ActualTermNo = $scope.getActualTermNumber(value); | |
4967 | - if (ActualTermNo != null) { | |
4968 | - var TermList = $scope.getTermNumberList(ActualTermNo); | |
4969 | - if (TermList != null) { | |
4970 | - for (var i = 0; i < TermList.length; i++) { | |
4869 | + if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { | |
4971 | 4870 | |
4972 | - multiTermList.push(TermList[i]); | |
4973 | - } | |
4974 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4975 | - } | |
4871 | + $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); | |
4976 | 4872 | } |
4873 | + else if ($scope.isHighlightByListManager == true) { | |
4977 | 4874 | |
4978 | -<<<<<<< HEAD | |
4979 | - if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { | |
4980 | -======= | |
4981 | - }); | |
4982 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4983 | - | |
4984 | - $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); | |
4985 | - } | |
4986 | - else if ($scope.isHighlightByListManager == true) { | |
4987 | - | |
4988 | -<<<<<<< HEAD | |
4989 | - // console.log('$scope.grayeddBR.length is ' + $scope.grayeddBR.length); | |
4990 | - $timeout(function () { | |
4991 | -======= | |
4992 | - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); | |
4993 | - } | |
4994 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
4995 | - | |
4996 | - // $rootScope.isHighLight = false; | |
4997 | - //align | |
4998 | - // $scope.aligneCanvasWithTerm(); | |
4999 | - | |
5000 | -<<<<<<< HEAD | |
5001 | - $scope.HighlightBodyByTermList($scope.AllTerms) | |
5002 | - }, 800); | |
5003 | - | |
5004 | - } | |
5005 | - | |
5006 | - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
5007 | - | |
5008 | - | |
5009 | - //console.log('inside highlight body'); | |
5010 | - | |
5011 | - var multiTermList = []; | |
5012 | - angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
5013 | - | |
5014 | - //debugger; | |
5015 | - | |
5016 | - var ActualTermNo = $scope.getActualTermNumber(value); | |
5017 | - if (ActualTermNo != null) { | |
5018 | - var TermList = $scope.getTermNumberList(ActualTermNo); | |
5019 | - if (TermList != null) { | |
5020 | - for (var i = 0; i < TermList.length; i++) { | |
5021 | - | |
5022 | - multiTermList.push(TermList[i]); | |
5023 | - } | |
5024 | - } | |
5025 | - } | |
5026 | - | |
5027 | - }); | |
5028 | - | |
5029 | - | |
5030 | - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); | |
5031 | - } | |
5032 | - | |
4875 | + // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length); | |
4876 | + $timeout(function () { | |
5033 | 4877 | |
4878 | + $scope.HighlightBodyByTermList($scope.AllTerms) | |
4879 | + }, 800); | |
5034 | 4880 | |
5035 | 4881 | } |
5036 | 4882 | |
... | ... | @@ -5038,366 +4884,175 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5038 | 4884 | |
5039 | 4885 | } |
5040 | 4886 | |
5041 | - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
5042 | - | |
5043 | - | |
5044 | - // console.log('the value of isHighlightByListManager ' + $scope.isHighlightByListManager); | |
5045 | - | |
5046 | - // console.log('$scope.grayeddBR.length: ' + $scope.grayeddBR.length) | |
5047 | -======= | |
5048 | - | |
5049 | 4887 | } |
5050 | 4888 | |
4889 | + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
5051 | 4890 | |
5052 | - var grayImageData = context_gray.getImageData(0, 0, width, ht); | |
5053 | - var grayImageImageDataVar = grayImageData.data; | |
5054 | 4891 | |
5055 | - if ($scope.isExtract == true) { | |
5056 | - if (value.haveMirror == 'true') { | |
5057 | - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5058 | - } | |
5059 | - else { | |
4892 | + if ($rootScope.isExtract == true) { | |
4893 | + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
5060 | 4894 | |
5061 | - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
4895 | + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
5062 | 4896 | } |
5063 | 4897 | } |
5064 | 4898 | else { |
5065 | - | |
5066 | - if (value.haveMirror == 'true') { | |
5067 | - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5068 | - } | |
5069 | - else { | |
5070 | - | |
5071 | - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5072 | - } | |
5073 | - } | |
5074 | - } | |
5075 | - | |
5076 | - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
5077 | - | |
5078 | - | |
5079 | - console.log('the value of isHighlightByListManager ' + $scope.isHighlightByListManager); | |
5080 | - | |
5081 | - console.log('$scope.grayeddBR.length: ' + $scope.grayeddBR.length) | |
5082 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
5083 | - | |
5084 | - | |
5085 | - | |
5086 | - | |
5087 | -<<<<<<< HEAD | |
5088 | - if ($rootScope.isExtract == true) { | |
5089 | - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
5090 | - | |
5091 | - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
4899 | + // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode | |
4900 | + //and then highlight the previously selected body regions at the time of normal mode. | |
4901 | + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { | |
4902 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { | |
4903 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4904 | + } | |
4905 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { | |
4906 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4907 | + } | |
4908 | + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { | |
4909 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
4910 | + } | |
4911 | + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { | |
4912 | + $scope.isEligibleForHighlightBodyByTermList = true; | |
5092 | 4913 | } |
5093 | - } | |
5094 | - else { | |
5095 | - // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode | |
5096 | - //and then highlight the previously selected body regions at the time of normal mode. | |
5097 | - if ($scope.grayeddBR != null || $scope.grayeddBR != undefined) { | |
5098 | - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayeddBR.length == 9)) { | |
5099 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
5100 | - } | |
5101 | - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayeddBR.length == 5)) { | |
5102 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
5103 | - } | |
5104 | - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayeddBR.length == 4)) { | |
5105 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
5106 | - } | |
5107 | - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayeddBR.length == 1)) { | |
5108 | - $scope.isEligibleForHighlightBodyByTermList = true; | |
5109 | - } | |
5110 | - | |
5111 | - if ($scope.isEligibleForHighlightBodyByTermList == true) { | |
5112 | - | |
5113 | - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
5114 | - | |
5115 | - var multiTermList = []; | |
5116 | - angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
5117 | - | |
5118 | - //debugger; | |
5119 | - | |
5120 | - var ActualTermNo = $scope.getActualTermNumber(value); | |
5121 | - if (ActualTermNo != null) { | |
5122 | - var TermList = $scope.getTermNumberList(ActualTermNo); | |
5123 | - if (TermList != null) { | |
5124 | - for (var i = 0; i < TermList.length; i++) { | |
5125 | - | |
5126 | - multiTermList.push(TermList[i]); | |
5127 | - } | |
5128 | - } | |
5129 | - } | |
5130 | - | |
5131 | - }); | |
5132 | 4914 | |
5133 | 4915 | |
5134 | - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); | |
5135 | - } | |
5136 | -======= | |
5137 | - if ($rootScope.isExtract == true) { | |
5138 | - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
4916 | + } | |
5139 | 4917 | |
5140 | - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
4918 | + // | |
5141 | 4919 | } |
5142 | - } | |
5143 | - else { | |
5144 | - // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode | |
5145 | - //and then highlight the previously selected body regions at the time of normal mode. | |
5146 | - | |
5147 | - if ($scope.grayeddBR.length == 9) { | |
4920 | + }) | |
5148 | 4921 | |
5149 | - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
4922 | + if ($scope.isEligibleForHighlightBodyByTermList == true) { | |
4923 | + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { | |
5150 | 4924 | |
5151 | - var multiTermList = []; | |
5152 | - angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
4925 | + var multiTermList = []; | |
4926 | + angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
5153 | 4927 | |
5154 | - //debugger; | |
4928 | + //debugger; | |
5155 | 4929 | |
5156 | - var ActualTermNo = $scope.getActualTermNumber(value); | |
5157 | - if (ActualTermNo != null) { | |
5158 | - var TermList = $scope.getTermNumberList(ActualTermNo); | |
5159 | - if (TermList != null) { | |
5160 | - for (var i = 0; i < TermList.length; i++) { | |
4930 | + var ActualTermNo = $scope.getActualTermNumber(value); | |
4931 | + if (ActualTermNo != null) { | |
4932 | + var TermList = $scope.getTermNumberList(ActualTermNo); | |
4933 | + if (TermList != null) { | |
4934 | + for (var i = 0; i < TermList.length; i++) { | |
5161 | 4935 | |
5162 | - multiTermList.push(TermList[i]); | |
5163 | - } | |
4936 | + multiTermList.push(TermList[i]); | |
5164 | 4937 | } |
5165 | 4938 | } |
5166 | - | |
5167 | - }); | |
5168 | - | |
5169 | - | |
5170 | - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); | |
5171 | - } | |
5172 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
5173 | - | |
5174 | - } | |
5175 | 4939 | } |
5176 | 4940 | |
5177 | -<<<<<<< HEAD | |
5178 | - // | |
5179 | - } | |
5180 | - }) | |
4941 | + }); | |
4942 | + | |
5181 | 4943 | |
4944 | + $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); | |
4945 | + } | |
5182 | 4946 | } |
5183 | 4947 | |
4948 | + } | |
5184 | 4949 | |
5185 | - else { | |
5186 | - // This code will execute when user will select normal Mode but this time isHighlight will be false | |
5187 | 4950 | |
5188 | - angular.forEach($scope.ColoredImageSRC, function (value, key) { | |
5189 | - var id; | |
5190 | - if (value.haveMirror == 'true') { | |
5191 | - id = 'imageCanvas' + value.bodyRegionId + '_MR'; | |
5192 | - } | |
5193 | - else { | |
5194 | - id = 'imageCanvas' + value.bodyRegionId; | |
5195 | - } | |
4951 | + else { | |
4952 | + // This code will execute when user will select normal Mode but this time isHighlight will be false | |
5196 | 4953 | |
5197 | - var imageCanvas = document.getElementById(id); | |
4954 | + angular.forEach($scope.ColoredImageSRC, function (value, key) { | |
4955 | + var id; | |
4956 | + if (value.haveMirror == 'true') { | |
4957 | + id = 'imageCanvas' + value.bodyRegionId + '_MR'; | |
4958 | + } | |
4959 | + else { | |
4960 | + id = 'imageCanvas' + value.bodyRegionId; | |
4961 | + } | |
5198 | 4962 | |
5199 | - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; | |
5200 | - //var coloredCanvas = document.getElementById(coloredCanvasID); | |
4963 | + var imageCanvas = document.getElementById(id); | |
5201 | 4964 | |
5202 | - var width = value.Width; | |
5203 | - var ht = value.Height; | |
4965 | + //var coloredCanvasID = 'imageCanvas' + bodyRegionId; | |
4966 | + //var coloredCanvas = document.getElementById(coloredCanvasID); | |
5204 | 4967 | |
5205 | - var coloredCanvasContext = imageCanvas.getContext("2d"); | |
5206 | - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); | |
5207 | - var coloredImageDataVar = coloredImageData; | |
4968 | + var width = value.Width; | |
4969 | + var ht = value.Height; | |
5208 | 4970 | |
4971 | + var coloredCanvasContext = imageCanvas.getContext("2d"); | |
4972 | + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); | |
4973 | + var coloredImageDataVar = coloredImageData; | |
5209 | 4974 | |
5210 | - if (value.haveMirror == 'true') { | |
5211 | - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; | |
5212 | - } | |
5213 | - else { | |
5214 | 4975 | |
5215 | - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; | |
4976 | + if (value.haveMirror == 'true') { | |
4977 | + $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; | |
4978 | + } | |
4979 | + else { | |
5216 | 4980 | |
5217 | - } | |
4981 | + $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; | |
5218 | 4982 | |
4983 | + } | |
5219 | 4984 | |
5220 | - var context = imageCanvas.getContext('2d'); | |
5221 | 4985 | |
4986 | + var context = imageCanvas.getContext('2d'); | |
5222 | 4987 | |
5223 | - var dataURL = imageCanvas.toDataURL(); | |
5224 | 4988 | |
4989 | + var dataURL = imageCanvas.toDataURL(); | |
5225 | 4990 | |
5226 | - var img = new Image(); | |
5227 | 4991 | |
5228 | - img.src = dataURL; | |
4992 | + var img = new Image(); | |
5229 | 4993 | |
4994 | + img.src = dataURL; | |
5230 | 4995 | |
5231 | 4996 | |
5232 | - img.onload = function () { | |
5233 | - //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) | |
5234 | 4997 | |
5235 | - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); | |
5236 | - DAData.draw(img); | |
4998 | + img.onload = function () { | |
4999 | + //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) | |
5237 | 5000 | |
5238 | - var colorMode; | |
5001 | + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); | |
5002 | + DAData.draw(img); | |
5239 | 5003 | |
5240 | - if ($scope.isExtract == true) { | |
5241 | - colorMode = $scope.applyWhiteMatrix(img, context); | |
5242 | - } | |
5004 | + var colorMode; | |
5243 | 5005 | |
5244 | - var zeroPoint = new Point(); | |
5006 | + if ($scope.isExtract == true) { | |
5007 | + colorMode = $scope.applyWhiteMatrix(img, context); | |
5008 | + } | |
5245 | 5009 | |
5246 | - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
5010 | + var zeroPoint = new Point(); | |
5247 | 5011 | |
5248 | - context.putImageData(DAData.data, 0, 0) | |
5012 | + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
5249 | 5013 | |
5250 | - var grayImageData = context.getImageData(0, 0, width, ht); | |
5251 | - var grayImageImageDataVar = grayImageData.data; | |
5014 | + context.putImageData(DAData.data, 0, 0) | |
5252 | 5015 | |
5253 | - if ($scope.isExtract == true) { | |
5254 | - if (value.haveMirror == 'true') { | |
5255 | - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5256 | - } | |
5257 | - else { | |
5016 | + var grayImageData = context.getImageData(0, 0, width, ht); | |
5017 | + var grayImageImageDataVar = grayImageData.data; | |
5258 | 5018 | |
5259 | - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5260 | - } | |
5019 | + if ($scope.isExtract == true) { | |
5020 | + if (value.haveMirror == 'true') { | |
5021 | + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5261 | 5022 | } |
5262 | 5023 | else { |
5263 | 5024 | |
5264 | - if (value.haveMirror == 'true') { | |
5265 | - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5266 | - } | |
5267 | - else { | |
5268 | - | |
5269 | - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5270 | - } | |
5025 | + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5271 | 5026 | } |
5272 | 5027 | } |
5273 | - | |
5274 | - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
5275 | - }) | |
5276 | - | |
5277 | - if ($rootScope.isExtract == true) { | |
5278 | - if ($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined || $rootScope.previousHighlightList.length > 0) { | |
5279 | - | |
5280 | - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
5281 | - | |
5282 | - // to do | |
5283 | - | |
5284 | -======= | |
5285 | - } | |
5286 | - } | |
5287 | - }) | |
5288 | - | |
5289 | - } | |
5290 | - | |
5291 | - else { | |
5292 | - // This code will execute when user will select normal Mode but this time isHighlight will be false | |
5293 | - | |
5294 | - angular.forEach($scope.ColoredImageSRC, function (value, key) { | |
5295 | - var id; | |
5296 | - if (value.haveMirror == 'true') { | |
5297 | - id = 'imageCanvas' + value.bodyRegionId + '_MR'; | |
5298 | - } | |
5299 | - else { | |
5300 | - id = 'imageCanvas' + value.bodyRegionId; | |
5301 | - } | |
5302 | - | |
5303 | - var imageCanvas = document.getElementById(id); | |
5304 | - | |
5305 | - //var coloredCanvasID = 'imageCanvas' + bodyRegionId; | |
5306 | - //var coloredCanvas = document.getElementById(coloredCanvasID); | |
5307 | - | |
5308 | - var width = value.Width; | |
5309 | - var ht = value.Height; | |
5310 | - | |
5311 | - var coloredCanvasContext = imageCanvas.getContext("2d"); | |
5312 | - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); | |
5313 | - var coloredImageDataVar = coloredImageData; | |
5314 | - | |
5315 | - | |
5316 | - if (value.haveMirror == 'true') { | |
5317 | - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar; | |
5318 | - } | |
5319 | - else { | |
5320 | - | |
5321 | - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar; | |
5322 | - | |
5323 | - } | |
5324 | - | |
5325 | - | |
5326 | - var context = imageCanvas.getContext('2d'); | |
5327 | - | |
5328 | - | |
5329 | - var dataURL = imageCanvas.toDataURL(); | |
5330 | - | |
5331 | - | |
5332 | - var img = new Image(); | |
5333 | - | |
5334 | - img.src = dataURL; | |
5335 | - | |
5336 | - | |
5337 | - | |
5338 | - img.onload = function () { | |
5339 | - //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) | |
5340 | - | |
5341 | - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); | |
5342 | - DAData.draw(img); | |
5343 | - | |
5344 | - var colorMode; | |
5345 | - | |
5346 | - if ($scope.isExtract == true) { | |
5347 | - colorMode = $scope.applyWhiteMatrix(img, context); | |
5348 | - } | |
5349 | - | |
5350 | - var zeroPoint = new Point(); | |
5351 | - | |
5352 | - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
5353 | - | |
5354 | - context.putImageData(DAData.data, 0, 0) | |
5355 | - | |
5356 | - var grayImageData = context.getImageData(0, 0, width, ht); | |
5357 | - var grayImageImageDataVar = grayImageData.data; | |
5358 | - | |
5359 | - if ($scope.isExtract == true) { | |
5360 | - if (value.haveMirror == 'true') { | |
5361 | - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5362 | - } | |
5363 | 5028 | else { |
5364 | 5029 | |
5365 | - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5366 | - } | |
5367 | - } | |
5368 | - else { | |
5369 | - | |
5370 | - if (value.haveMirror == 'true') { | |
5371 | - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5372 | - } | |
5373 | - else { | |
5030 | + if (value.haveMirror == 'true') { | |
5031 | + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; | |
5032 | + } | |
5033 | + else { | |
5374 | 5034 | |
5375 | - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5376 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
5035 | + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; | |
5036 | + } | |
5377 | 5037 | } |
5378 | 5038 | } |
5379 | 5039 | |
5380 | -<<<<<<< HEAD | |
5381 | - } | |
5382 | - } | |
5383 | - } | |
5384 | -======= | |
5385 | - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
5386 | - }) | |
5040 | + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
5041 | + }) | |
5387 | 5042 | |
5388 | - if ($rootScope.isExtract == true) { | |
5389 | - if ($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined || $rootScope.previousHighlightList.length > 0) { | |
5043 | + if ($rootScope.isExtract == true) { | |
5044 | + if ($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined || $rootScope.previousHighlightList.length > 0) { | |
5390 | 5045 | |
5391 | - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
5046 | + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
5392 | 5047 | |
5393 | - // to do | |
5048 | + // to do | |
5394 | 5049 | |
5050 | + } | |
5395 | 5051 | } |
5396 | - } | |
5397 | 5052 | |
5053 | + } | |
5398 | 5054 | } |
5399 | 5055 | } |
5400 | ->>>>>>> 3fa5d8d29f67537a7582e828edd6bed7c1fd9701 | |
5401 | 5056 | } |
5402 | 5057 | |
5403 | 5058 | |
... | ... | @@ -5472,6 +5127,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5472 | 5127 | |
5473 | 5128 | $scope.OnGenderChange = function (event) { |
5474 | 5129 | |
5130 | + $rootScope.isLoading = true; | |
5131 | + $('#spinner').css('visibility', 'visible'); | |
5132 | + | |
5475 | 5133 | $rootScope.isGenderChnage = true; |
5476 | 5134 | |
5477 | 5135 | var viewname = localStorage.getItem("currentViewTitle") |
... | ... | @@ -5490,6 +5148,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5490 | 5148 | |
5491 | 5149 | |
5492 | 5150 | $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Female', 'Male'); |
5151 | + | |
5152 | + localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Female', 'Male')); | |
5153 | + | |
5154 | + | |
5493 | 5155 | $rootScope.isLoading = true; |
5494 | 5156 | |
5495 | 5157 | } |
... | ... | @@ -5507,9 +5169,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5507 | 5169 | //3. |
5508 | 5170 | $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female'); |
5509 | 5171 | |
5172 | + localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Male', 'Female')); | |
5173 | + | |
5174 | + | |
5510 | 5175 | $rootScope.isLoading = true; |
5511 | 5176 | |
5512 | 5177 | } |
5178 | + | |
5179 | + $rootScope.openViews.push( | |
5180 | + { | |
5181 | + "module": $rootScope.currentActiveModuleTitle, "body-views": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": currentBodyViewId, | |
5182 | + "slug": $rootScope.currentSlug | |
5183 | + } | |
5184 | + ); | |
5185 | + | |
5513 | 5186 | var target = angular.element(event.currentTarget); |
5514 | 5187 | var title_male_female = target.attr('title'); |
5515 | 5188 | |
... | ... | @@ -5597,7 +5270,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5597 | 5270 | |
5598 | 5271 | $scope.OnViewChange = function (event) { |
5599 | 5272 | |
5600 | - | |
5273 | + $rootScope.isLoading = true; | |
5274 | + $('#spinner').css('visibility', 'visible'); | |
5601 | 5275 | |
5602 | 5276 | $rootScope.isViewChange = true; |
5603 | 5277 | $scope.layerNumber = 0; |
... | ... | @@ -5737,76 +5411,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5737 | 5411 | //console.log('reloadDABodyViewEvent'); |
5738 | 5412 | |
5739 | 5413 | $scope.ReloadBodyViewId = data.reloadDABodyViewId; |
5740 | - // $scope.layerNumber = 0; | |
5414 | + // $scope.layerNumber = 0; | |
5741 | 5415 | // debugger; |
5742 | 5416 | |
5743 | 5417 | $scope.loadSelectedBodyView($scope.ReloadBodyViewId); |
5744 | 5418 | |
5745 | 5419 | $scope.loadSelectedBodyViewNavigator($scope.ReloadBodyViewId); |
5746 | 5420 | |
5747 | - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value; | |
5748 | - localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value); | |
5749 | - | |
5750 | - var viewtarget = angular.element(event.currentTarget); | |
5751 | - var title_drop_view = viewtarget.attr('title'); | |
5752 | - | |
5753 | - if (title_drop_view == "Anterior") { | |
5754 | - | |
5755 | - $scope.AnteriorView = "active"; | |
5756 | - $scope.LateralView = ""; | |
5757 | - $scope.MedialView = ""; | |
5758 | - $scope.PosteriorView = ""; | |
5759 | - $scope.LateralArmView = ""; | |
5760 | - $scope.MedialArmView = ""; | |
5761 | - | |
5762 | - } | |
5763 | - else if (title_drop_view == "Lateral") { | |
5764 | - | |
5765 | - $scope.AnteriorView = ""; | |
5766 | - $scope.LateralView = "active"; | |
5767 | - $scope.MedialView = ""; | |
5768 | - $scope.PosteriorView = ""; | |
5769 | - $scope.LateralArmView = ""; | |
5770 | - $scope.MedialArmView = ""; | |
5771 | - } | |
5772 | - else if (title_drop_view == "Medial") { | |
5773 | - | |
5774 | - $scope.AnteriorView = ""; | |
5775 | - $scope.LateralView = ""; | |
5776 | - $scope.MedialView = "active"; | |
5777 | - $scope.PosteriorView = ""; | |
5778 | - $scope.LateralArmView = ""; | |
5779 | - $scope.MedialArmView = ""; | |
5780 | - } | |
5781 | - else if (title_drop_view == "Posterior") { | |
5782 | - | |
5783 | - $scope.AnteriorView = ""; | |
5784 | - $scope.LateralView = ""; | |
5785 | - $scope.MedialView = ""; | |
5786 | - $scope.PosteriorView = "active"; | |
5787 | - $scope.LateralArmView = ""; | |
5788 | - $scope.MedialArmView = ""; | |
5789 | - } | |
5790 | - else if (title_drop_view == "Lateral Arm") { | |
5791 | - | |
5792 | - $scope.AnteriorView = ""; | |
5793 | - $scope.LateralView = ""; | |
5794 | - $scope.MedialView = ""; | |
5795 | - $scope.PosteriorView = ""; | |
5796 | - $scope.LateralArmView = "active"; | |
5797 | - $scope.MedialArmView = ""; | |
5798 | - } | |
5799 | - else if (title_drop_view == "Medial Arm") { | |
5800 | - | |
5801 | - $scope.AnteriorView = ""; | |
5802 | - $scope.LateralView = ""; | |
5803 | - $scope.MedialView = ""; | |
5804 | - $scope.PosteriorView = ""; | |
5805 | - $scope.LateralArmView = ""; | |
5806 | - $scope.MedialArmView = "active"; | |
5807 | - } | |
5808 | - | |
5809 | - | |
5810 | 5421 | |
5811 | 5422 | }) |
5812 | 5423 | |
... | ... | @@ -6221,9 +5832,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6221 | 5832 | case "Pin": |
6222 | 5833 | |
6223 | 5834 | $rootScope.resetPin = $rootScope.ObjectIndex++; |
6224 | - | |
5835 | + | |
6225 | 5836 | $rootScope.resetPinArc = $rootScope.Object1Index++; |
6226 | - | |
5837 | + | |
6227 | 5838 | var radial = $('canvas').createGradient({ |
6228 | 5839 | x1: 50, y1: 50, |
6229 | 5840 | x2: 50, y2: 50, |
... | ... | @@ -6248,22 +5859,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6248 | 5859 | // strokeWidth: 2, |
6249 | 5860 | // radius: 3 |
6250 | 5861 | //}, |
6251 | - | |
6252 | - | |
6253 | - | |
5862 | + | |
5863 | + | |
5864 | + | |
6254 | 5865 | click: function (layer) { |
6255 | - // debugger; | |
6256 | - PinLineName = layer.name; | |
6257 | - _lineNameSplit = PinLineName.split("_"); | |
6258 | - | |
6259 | - storeLine = "ArcPin_" + _lineNameSplit[1]; | |
6260 | - | |
6261 | - $rootScope.shapeTypePin = "Pin"; | |
6262 | - | |
5866 | + // debugger; | |
5867 | + PinLineName = layer.name; | |
5868 | + _lineNameSplit = PinLineName.split("_"); | |
5869 | + | |
5870 | + storeLine = "ArcPin_" + _lineNameSplit[1]; | |
5871 | + | |
5872 | + $rootScope.shapeTypePin = "Pin"; | |
5873 | + | |
6263 | 5874 | $rootScope.canvasLayerNameCollection1 = []; |
6264 | - | |
5875 | + | |
6265 | 5876 | $rootScope.canvasLayerNameCollection1.push({ a: storeLine }, { b: PinLineName }); |
6266 | - | |
5877 | + | |
6267 | 5878 | $('#canvas').setLayer(layer.name, { |
6268 | 5879 | handle: { |
6269 | 5880 | type: 'arc', |
... | ... | @@ -6274,17 +5885,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6274 | 5885 | radius: 2 |
6275 | 5886 | } |
6276 | 5887 | }).drawLayers(); |
6277 | - | |
5888 | + | |
6278 | 5889 | |
6279 | 5890 | }, |
6280 | 5891 | mouseout: function (layer) { |
6281 | - // $rootScope.resetPinArc = ""; | |
6282 | - // ax = ""; | |
5892 | + // $rootScope.resetPinArc = ""; | |
5893 | + // ax = ""; | |
6283 | 5894 | $rootScope.shapeTypePin = ""; |
6284 | - | |
6285 | - PinLineName = ''; | |
6286 | - _lineNameSplit = ''; | |
6287 | - storeLine = ''; | |
5895 | + | |
5896 | + PinLineName = ''; | |
5897 | + _lineNameSplit = ''; | |
5898 | + storeLine = ''; | |
6288 | 5899 | $rootScope.canvasLayerNameCollection1 = []; |
6289 | 5900 | $('#canvas').setLayer(layer.name, { |
6290 | 5901 | handle: { |
... | ... | @@ -6317,7 +5928,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6317 | 5928 | }).drawArc({ |
6318 | 5929 | draggable: true, |
6319 | 5930 | name: "ArcPin_" + $rootScope.resetPinArc, |
6320 | - // name: "Pin_" + $rootScope.resetPin, | |
5931 | + // name: "Pin_" + $rootScope.resetPin, | |
6321 | 5932 | layer: true, |
6322 | 5933 | groups: ['shapes'], |
6323 | 5934 | dragGroups: ['shapes'], |
... | ... | @@ -6334,13 +5945,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6334 | 5945 | // radius: 3 |
6335 | 5946 | //}, |
6336 | 5947 | add: function (layer) { |
6337 | - // alert("add"); | |
5948 | + // alert("add"); | |
6338 | 5949 | $rootScope.resetPinArc = layer.name; |
6339 | - // $scope.arr = []; | |
5950 | + // $scope.arr = []; | |
5951 | + | |
6340 | 5952 | |
6341 | - | |
6342 | 5953 | }, |
6343 | - | |
5954 | + | |
6344 | 5955 | }).drawLayers(); |
6345 | 5956 | $('.btnCursor').trigger('click'); |
6346 | 5957 | $(".btn-annotation").removeClass("activebtncolor"); |
... | ... | @@ -6383,22 +5994,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6383 | 5994 | |
6384 | 5995 | |
6385 | 5996 | if (event.which == 46) { |
6386 | - debugger; | |
5997 | + | |
6387 | 5998 | if ($rootScope.shapeTypePin == "Pin") { |
6388 | 5999 | // alert($rootScope.canvasLayerNameCollection[0].a); |
6389 | 6000 | // alert($rootScope.canvasLayerNameCollection[1].b); |
6390 | 6001 | for (var i = 0; i < $rootScope.canvasLayerNameCollection1.length; i++) { |
6391 | 6002 | $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[i].b).drawLayers(); |
6392 | 6003 | $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[i].a).drawLayers(); |
6393 | - | |
6004 | + | |
6394 | 6005 | } |
6395 | - // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[0].a).drawLayers(); | |
6396 | - // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[1].b).drawLayers(); | |
6006 | + // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[0].a).drawLayers(); | |
6007 | + // $("#canvas").removeLayer($rootScope.canvasLayerNameCollection1[1].b).drawLayers(); | |
6397 | 6008 | |
6398 | 6009 | } |
6399 | - // else { | |
6400 | - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers(); | |
6401 | - // } | |
6010 | + // else { | |
6011 | + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers(); | |
6012 | + // } | |
6402 | 6013 | |
6403 | 6014 | |
6404 | 6015 | } |
... | ... | @@ -6848,7 +6459,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6848 | 6459 | } |
6849 | 6460 | // }) |
6850 | 6461 | |
6851 | - | |
6462 | + | |
6852 | 6463 | //.error(function (data, status, headers, config) { |
6853 | 6464 | |
6854 | 6465 | // console.log(data); | ... | ... |