Commit 06a6a7a9e17e4f231269da5a60d5c66676016328
1 parent
d93494bd
Refs: #4463
Multi Extract is implemented for both normal and highlighted mode. Approached is changed from previous implementation.
Showing
1 changed file
with
46 additions
and
31 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1416,15 +1416,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1416 | 1416 | } |
1417 | 1417 | |
1418 | 1418 | |
1419 | - $scope.HighlightBodyOnExtract = function (RGBColor) { | |
1419 | + $scope.HighlightBodyOnExtract = function () { | |
1420 | 1420 | |
1421 | - alert('HighlightBodyOnExtract is called'); | |
1421 | + // alert('HighlightBodyOnExtract is called'); | |
1422 | + var multiTermList = []; | |
1423 | + | |
1424 | + if ($rootScope.previousHighlightList!=null && $rootScope.previousHighlightList.length > 0) { | |
1425 | + angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
1426 | + var ActualTermNo = $scope.getActualTermNumber(value); | |
1427 | + var TermList = $scope.getTermNumberList(ActualTermNo); | |
1428 | + for (var i = 0; i < TermList.length; i++) { | |
1429 | + multiTermList.push(TermList[i]); | |
1430 | + } | |
1431 | + | |
1432 | + // to do | |
1433 | + }); | |
1434 | + } | |
1422 | 1435 | |
1423 | 1436 | //2. Find Actul Term No Based on Icolor. |
1424 | - var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1437 | + //var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1425 | 1438 | |
1426 | - //3. Find Term No List Based on ActualTermNo | |
1427 | - var TermList = $scope.getTermNumberList(ActualTermNo); | |
1439 | + ////3. Find Term No List Based on ActualTermNo | |
1440 | + //var TermList = $scope.getTermNumberList(ActualTermNo); | |
1428 | 1441 | |
1429 | 1442 | |
1430 | 1443 | //terminate previous running workers to create space for new workers |
... | ... | @@ -1463,11 +1476,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1463 | 1476 | |
1464 | 1477 | //alert('is mutiAnnotation on= ' + $rootScope.multiAnnotationIsON); |
1465 | 1478 | |
1466 | - if ($rootScope.multiAnnotationIsON == true) { | |
1479 | + //if ($rootScope.multiAnnotationIsON == true) { | |
1467 | 1480 | |
1468 | - white = $rootScope.updatedWhiteImageMRDataList[bodyRegionId] | |
1469 | - } | |
1470 | - else | |
1481 | + // white = $rootScope.updatedWhiteImageMRDataList[bodyRegionId] | |
1482 | + //} | |
1483 | + //else | |
1471 | 1484 | white = $rootScope.whiteImageMRDataList[bodyRegionId]; |
1472 | 1485 | } |
1473 | 1486 | |
... | ... | @@ -1476,34 +1489,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1476 | 1489 | coloredImageDataVar = $rootScope.coloredImageCanvasList[bodyRegionId - 1]; |
1477 | 1490 | |
1478 | 1491 | //alert('is mutiAnnotation on= ' + $rootScope.multiAnnotationIsON); |
1479 | - if ($rootScope.multiAnnotationIsON == true) { | |
1492 | + //if ($rootScope.multiAnnotationIsON == true) { | |
1480 | 1493 | |
1481 | - //if (($rootScope.updatedWhiteImageDataList[bodyRegionId - 1]) != null && ($rootScope.updatedWhiteImageDataList[bodyRegionId - 1].length>0)) { | |
1482 | - if (($rootScope.updatedWhiteImageDataList[bodyRegionId - 1]) == null) { | |
1483 | - alert('came inside for getting updated data'); | |
1484 | - white = $rootScope.whiteImageDataList[bodyRegionId - 1]; | |
1494 | + // //if (($rootScope.updatedWhiteImageDataList[bodyRegionId - 1]) != null && ($rootScope.updatedWhiteImageDataList[bodyRegionId - 1].length>0)) { | |
1495 | + // if (($rootScope.updatedWhiteImageDataList[bodyRegionId - 1]) == null) { | |
1496 | + // alert('came inside for getting updated data'); | |
1497 | + // white = $rootScope.whiteImageDataList[bodyRegionId - 1]; | |
1485 | 1498 | |
1486 | - } | |
1487 | - else | |
1488 | - { | |
1489 | - white = $rootScope.updatedWhiteImageDataList[bodyRegionId - 1] | |
1490 | - } | |
1491 | - } | |
1492 | - else | |
1493 | - { | |
1494 | - white = $rootScope.whiteImageDataList[bodyRegionId - 1]; | |
1499 | + // } | |
1500 | + // else | |
1501 | + // { | |
1502 | + white = $rootScope.whiteImageDataList[bodyRegionId - 1] | |
1503 | + // } | |
1495 | 1504 | } |
1505 | + //else | |
1506 | + //{ | |
1507 | + // white = $rootScope.whiteImageDataList[bodyRegionId - 1]; | |
1508 | + //} | |
1496 | 1509 | |
1497 | - } | |
1510 | + | |
1498 | 1511 | var worker = new Worker('extract-wp.js'); |
1499 | 1512 | |
1500 | 1513 | //push workers in array to further used the refernece to delete the workers |
1501 | 1514 | $scope.runningWorkers.push({ 'workerName': worker }) |
1502 | 1515 | |
1503 | - // console.log('for bodyRegionId = ' + bodyRegionId+ ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) | |
1516 | + // console.log('for bodyRegionId = ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) | |
1504 | 1517 | worker.postMessage({ |
1505 | 1518 | |
1506 | - 'termList': TermList, | |
1519 | + 'termList': multiTermList, | |
1507 | 1520 | 'maskCanvasData': maskData, |
1508 | 1521 | 'coloredImageData': coloredImageDataVar, |
1509 | 1522 | 'grayImageData': white, |
... | ... | @@ -3685,6 +3698,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3685 | 3698 | } |
3686 | 3699 | else { |
3687 | 3700 | $rootScope.isHighLight = true; |
3701 | + $rootScope.isNormalMode = false; | |
3688 | 3702 | $scope.highLightBody(); |
3689 | 3703 | } |
3690 | 3704 | } |
... | ... | @@ -3849,12 +3863,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3849 | 3863 | if ($rootScope.isExtract == true) { |
3850 | 3864 | if ($rootScope.previousHighlightList.length > 0) |
3851 | 3865 | { |
3852 | - angular.forEach($rootScope.previousHighlightList, function (value, key) | |
3853 | - { | |
3854 | - $timeout(function () { $scope.HighlightBodyOnExtract(value) }, 50); | |
3866 | + //angular.forEach($rootScope.previousHighlightList, function (value, key) | |
3867 | + //{ | |
3868 | + // $timeout(function () { $scope.HighlightBodyOnExtract(value) }, 50); | |
3855 | 3869 | |
3856 | - // to do | |
3857 | - }); | |
3870 | + // // to do | |
3871 | + //}); | |
3872 | + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); | |
3858 | 3873 | } |
3859 | 3874 | } |
3860 | 3875 | ... | ... |