Commit 3145ac5b9d4d1b64a972f7bd093cca19665c75a0

Authored by Amrita Vishnoi
2 parents 7e6d4d67 463d0f2a

Merge branch 'Bug#12159_2' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -49,6 +49,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
49 49 $rootScope.updatedGrayMRDataList = [];
50 50 $scope.isEligibleForHighlight = false;
51 51 $scope.doHighlightOrExtract = false;
  52 + $scope.isClickedOnBodyForHighlight;
52 53 $scope.isEligibleForHighlightBodyByTermList = false;
53 54  
54 55 // $scope.AnteriorView = "active";
... ... @@ -1426,7 +1427,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1426 1427 }
1427 1428  
1428 1429 // $rootScope.previousHighlightList.push(RGBColor);
1429   -
  1430 + $scope.isClickedOnBodyForHighlight = true;
1430 1431 $scope.highLightBodyBasedOnIcolor(RGBColor);
1431 1432 }
1432 1433  
... ... @@ -1804,6 +1805,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1804 1805 if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { }
1805 1806 else
1806 1807 {
  1808 + $scope.isClickedOnBodyForHighlight = true;
1807 1809 $scope.highLightBodyBasedOnIcolor(RGBColor);
1808 1810 }
1809 1811  
... ... @@ -2308,7 +2310,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2308 2310  
2309 2311 console.log('HighlightBodyByTermList is called');
2310 2312  
2311   - // $scope.highlightedBR = null;
2312 2313 $scope.highlightedBR = [];
2313 2314  
2314 2315 $scope.terminateCurrentlyRunningWPs();
... ... @@ -2426,10 +2427,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2426 2427 //push workers in array to further used the refernece to delete the workers
2427 2428 $scope.runningWorkers.push({ 'workerName': worker })
2428 2429  
2429   - // console.log('for bodyRegionId = ' + bodyRegionId+ ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
2430 2430 console.log('before worker call BRID: ' + bodyRegionId)
2431 2431  
2432   - if (grayImageDataVar != null && coloredImageDataVar != null && maskData != null) {
  2432 + if (grayImageDataVar != null && coloredImageDataVar != null && maskData != null && TermList != undefined && TermList.length > 0) {
2433 2433 worker.postMessage({
2434 2434  
2435 2435 'termList': TermList,
... ... @@ -2441,7 +2441,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2441 2441  
2442 2442 });
2443 2443 }
2444   -
  2444 + else {
  2445 + $('#spinner').css('visibility', 'hidden')
  2446 + $rootScope.isLoading = false;
  2447 + }
2445 2448  
2446 2449  
2447 2450 worker.onmessage = function (e) {
... ... @@ -2452,18 +2455,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2452 2455 var bodyRegionId = e.data.bodyRegionId;
2453 2456 var canvasId = (e.data.canvasId).replace('_mci', '');
2454 2457  
2455   - //for (var i = 1; i <= updatedData.length; i++) {
2456 2458 var grayCanvasID = canvasId;
2457 2459  
2458   - //to do
  2460 +
2459 2461 var grayCanvas = document.getElementById(grayCanvasID);
2460 2462 if (grayCanvas != null) {
2461 2463 var grayCanvasContext = grayCanvas.getContext("2d");
2462 2464  
2463   - //Niki remove previous data from canvas
2464 2465 var canvasHeight = grayCanvas.height + 'px';
2465 2466 var canvasWidth = grayCanvas.width + 'px';
2466   - //alert('height= ' + canvasHeight + ', width= ' + canvasWidth)
2467 2467 grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth)
2468 2468  
2469 2469 grayCanvasContext.putImageData(updatedData, 0, 0);
... ... @@ -2476,14 +2476,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2476 2476 if (canvasId.match('_MR')) {
2477 2477 $rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData;
2478 2478  
2479   - //alert('HighlightBodyByTermList, is mutiAnnotation on= ' + $rootScope.multiAnnotationIsON);
2480   -
2481   - //$rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData;
2482 2479 }
2483 2480 else
2484 2481 $rootScope.updatedGrayDataList[bodyRegionId - 1] = updatedData;
2485 2482  
2486   - //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
2487 2483  
2488 2484 console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
2489 2485  
... ... @@ -2503,34 +2499,48 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2503 2499 }
2504 2500 if ($scope.doAligneCanvasWithTerm == true) {
2505 2501  
2506   - if ($rootScope.isListManagerSelected == true)
  2502 + if ($rootScope.isListManagerSelected == true) {
2507 2503 $scope.aligneCanvasWithTerm();
  2504 + }
  2505 + else if ($rootScope.previousHighlightList != undefined && $rootScope.previousHighlightList.length > 0 && ($scope.isGenderChnage == true || $scope.isViewChange == true)) {
  2506 + var canvasDiv = document.getElementById('canvasDiv');
  2507 + if ($rootScope.viewOrientationId == '1' || $rootScope.viewOrientationId == '4') {
2508 2508  
2509   - else if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) {
  2509 + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
  2510 + var canvasDiv = document.getElementById('canvasDiv');
  2511 + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition);
  2512 + }
  2513 + else {
  2514 + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition);
  2515 + $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition);
  2516 + $rootScope.isLoading = false;
  2517 + }
  2518 + $('#spinner').css('visibility', 'hidden');
  2519 + }
  2520 + else if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true || $scope.isClickedOnBodyForHighlight
  2521 + ) {
2510 2522  
2511 2523 $rootScope.isLoading = false;
2512 2524  
2513 2525 $('#spinner').css('visibility', 'hidden');
2514 2526 }
  2527 +
2515 2528 else {
  2529 +
2516 2530 var canvasDiv = document.getElementById('canvasDiv');
2517 2531 $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition);
2518 2532 $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition);
  2533 + // }
2519 2534  
2520 2535 $rootScope.isLoading = false;
2521 2536  
2522 2537 $('#spinner').css('visibility', 'hidden');
2523   - //$('#canvasDiv').scrollLeft(newX);
2524   - //$('#canvasDiv').scrollTop(newY);
  2538 +
2525 2539 }
2526   -
2527   - // $rootScope.isHighlightBodyByBodySystem = false;
2528   -
2529   -
  2540 +
2530 2541 }
2531 2542 }
2532   - //
2533   -
  2543 +
2534 2544 };
2535 2545 worker.onerror = function (e) {
2536 2546 alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
... ... @@ -6167,18 +6177,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6167 6177 var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
6168 6178 var coloredImageDataVar = coloredImageData;
6169 6179  
6170   -
6171   - //if (value.haveMirror == 'true') {
6172   - // $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
6173   - //}
6174   - //else {
6175   -
6176   -
6177   - // $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
6178   -
6179   - //}
6180   -
6181   -
  6180 +
6182 6181 var context_gray = imageCanvas.getContext('2d');
6183 6182  
6184 6183 var dataURL = imageCanvas.toDataURL();
... ... @@ -6224,7 +6223,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6224 6223  
6225 6224 context_gray.putImageData(DAData.data, 0, 0)
6226 6225  
6227   - //NIKI- to resolve lateral arm black issue in highlight mode
  6226 + //to resolve lateral arm black issue in highlight mode
6228 6227  
6229 6228 if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) {
6230 6229  
... ... @@ -6291,13 +6290,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6291 6290 }
6292 6291  
6293 6292 if ($scope.isEligibleForHighlightBodyByTermList == true) {
6294   - //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE
6295   - // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) {
6296   - //$scope.isLoading = false;
6297   -
6298   - //$('#spinner').css('visibility', 'hidden');
6299   - //}
6300   -
  6293 +
6301 6294 if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
6302 6295  
6303 6296  
... ... @@ -6321,6 +6314,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6321 6314 else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
6322 6315 $scope.createTermListByPreviousTermsAndHighlight();
6323 6316 }
  6317 + else {
  6318 + $scope.isLoading = false;
  6319 + $('#spinner').css('visibility', 'hidden');
  6320 + }
6324 6321  
6325 6322 }
6326 6323  
... ... @@ -6713,7 +6710,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6713 6710 })
6714 6711  
6715 6712 $scope.loadSelectedBodyView = function (currentBodyViewId) {
6716   -
  6713 +
6717 6714 //remove transaprency scale
6718 6715 if ($('#transparencyScale') != null) {
6719 6716  
... ... @@ -6753,18 +6750,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6753 6750 function (result) {
6754 6751 $rootScope.TermNumberData = result;
6755 6752  
6756   - var canDiv = document.getElementById('canvasDiv');
6757   - var canDivChildCount = canDiv.childElementCount;
6758   - if (canDivChildCount > 0) {
6759   - canDiv.innerHTML = '';
6760   - }
6761 6753 //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender
6762 6754  
6763   - if ((($rootScope.isListManagerSelected == true) || ($rootScope.isHighLight == true && $rootScope.previousHighlightList != null && $rootScope.previousHighlightList.length > 0)) && (($rootScope.isGenderChnage == true) || $rootScope.isViewChange == true)) {
  6755 + if ((($rootScope.isListManagerSelected == true) ||
  6756 + ($rootScope.isHighLight == true && $rootScope.previousHighlightList != null
  6757 + && $rootScope.previousHighlightList.length > 0))
  6758 + && (($rootScope.isGenderChnage == true) || $rootScope.isViewChange == true)) {
6764 6759  
6765 6760 $scope.setLayerNumberAndHighlightByTermList();
6766 6761  
6767 6762 }
  6763 + else if ($rootScope.previousHighlightList != null && $rootScope.previousHighlightList.length > 0 &&
  6764 + ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true)) {
  6765 +
  6766 + $rootScope.isHighLight = true
  6767 + $scope.setLayerNumberAndHighlightByTermList();
  6768 + }
6768 6769  
6769 6770 else {
6770 6771  
... ... @@ -6827,11 +6828,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6827 6828 }
6828 6829  
6829 6830 $scope.layerNumber = 0;
6830   - // debugger;
6831   - //var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
6832   - var selectedViewId = $scope.bodyViews[event.currentTarget.title];
6833 6831  
  6832 + //remove existing body view
  6833 + $scope.flushCanvas();
  6834 +
  6835 +
  6836 + var selectedViewId = $scope.bodyViews[event.currentTarget.title];
6834 6837 $rootScope.viewOrientationId = selectedViewId;
  6838 +
6835 6839 if (localStorage.getItem("genderId") == 'Male') {
6836 6840 if ($rootScope.voId != selectedViewId) {
6837 6841 if (selectedViewId == 5) {
... ... @@ -6850,6 +6854,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6850 6854 //1. first update the currentbodyviewid in local storage
6851 6855 localStorage.setItem("currentBodyViewId", $rootScope.voId);
6852 6856  
  6857 +
6853 6858 //2. Load selected body view
6854 6859 $scope.loadSelectedBodyView($rootScope.voId);
6855 6860  
... ... @@ -7912,7 +7917,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7912 7917 else {
7913 7918 newX = maxHScrollPos;
7914 7919 }
7915   - //alert('newX= ' + newX + ',newY= ' + newY)
7916 7920 $('#canvasDiv').scrollLeft(newX);
7917 7921 $('#canvasDiv').scrollTop(newY);
7918 7922 $scope.isLoading = false;
... ... @@ -7922,6 +7926,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7922 7926 $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
7923 7927 $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft();
7924 7928  
  7929 + $scope.isLoading = false;
  7930 + $('#spinner').css('visibility', 'hidden');
  7931 +
7925 7932 }
7926 7933  
7927 7934  
... ...