Commit 258c14ee0dfe732e9cc77d7b47d9d0374c42f676
1 parent
9d658a7b
Update extract worker and clean code in DA
Showing
3 changed files
with
147 additions
and
376 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
1 | 1 | 'use strict'; |
2 | 2 | |
3 | 3 | AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", "DataService", "TermService", "AIAConstants", "ModuleService","$interval","$q", |
4 | - function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, DataService, TermService, AIAConstants, ModuleService,$interval,$q) { | |
5 | - | |
6 | - | |
4 | + function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, DataService, TermService, AIAConstants, ModuleService,$interval,$q) { | |
7 | 5 | |
8 | 6 | $scope.ScopeVariablesDeclare = function () { |
9 | 7 | |
... | ... | @@ -51,102 +49,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
51 | 49 | |
52 | 50 | //common field data |
53 | 51 | |
54 | - // $scope.genderId = ""; | |
55 | - // $scope.selectedGenderBodyViewData; | |
56 | - // $scope.imagePath = ""; | |
57 | - // $rootScope.BodyRegionData; | |
58 | - // $rootScope.BodyRegionCordinatesData; | |
59 | - // $rootScope.isTransparencyActivated = false; | |
60 | - // $scope.isTransparencyBtnClicked = false; | |
61 | - // $rootScope.BodyLayerData; | |
62 | - //$rootScope.VocabTermData; | |
63 | - //$scope.ColoredImageSRC = []; | |
64 | - | |
65 | - | |
66 | - //for modesty image layers | |
67 | - // $scope.lowerlayerNumberForModesty; | |
68 | - // $scope.HigherlayerNumberForModesty; | |
69 | - // $scope.layerInfoForModesty; | |
70 | - | |
71 | - // $scope.VocabTermTxt; | |
72 | - | |
73 | - // $rootScope.TermNumberData = null; | |
74 | - // $rootScope.BodySystemData | |
75 | - // $scope.bodyViewId = 0; | |
76 | - // $rootScope.bgartData; | |
77 | - | |
78 | - //view specific constants | |
79 | - | |
80 | - // $scope.bagartDetails; | |
81 | - // $scope.transNumber = 100; | |
82 | - | |
83 | - | |
84 | - | |
85 | - // $scope.isTBDrawnOnBodyRegion; | |
86 | - | |
87 | - // $rootScope.isHighLight = false; | |
88 | - | |
89 | - // $rootScope.grayImageDataList = []; | |
90 | - // $rootScope.grayImageMRDataList = []; | |
91 | - | |
92 | - | |
93 | - // $rootScope.updatedGrayDataList = []; | |
94 | - // $rootScope.updatedGrayMRDataList = []; | |
95 | - //$scope.isEligibleForHighlight = false; | |
96 | - // $scope.doHighlightOrExtract = false; | |
97 | - // $scope.isClickedOnBodyForHighlight; | |
98 | - // $scope.isSearchClicked = false; | |
99 | - // $scope.isEligibleForHighlightBodyByTermList = false; | |
100 | - | |
101 | - // $scope.AnteriorView = "active"; | |
102 | - | |
103 | - // $rootScope.zoomInOut = 75; | |
104 | - //$scope.speechBubbleCounter = 0; | |
105 | - // $scope.j = 0; | |
106 | - | |
107 | - // $scope.speachBubbleArrayAnnotation = []; | |
108 | - //$rootScope.multiAnnotationIsON = false; | |
109 | - | |
110 | - | |
111 | - | |
112 | - | |
113 | - // $rootScope.MaskCanvasData = []; | |
114 | - | |
115 | - //extract | |
116 | - // $rootScope.isExtract = false; | |
117 | - //$rootScope.UIWrapperZIndex = 12000; | |
118 | - | |
119 | - //$rootScope.whiteImageDataList = []; | |
120 | - //$rootScope.whiteImageMRDataList = []; | |
121 | - | |
122 | - | |
123 | - // $rootScope.isViewChange = false; | |
124 | - // $rootScope.isGenderChnage = false; | |
125 | - | |
126 | - // to do it is setting but not using. need to check | |
127 | - // $rootScope.updatedWhiteImageDataList = []; | |
128 | - // $rootScope.updatedWhiteImageMRDataList = []; | |
129 | - | |
130 | - //normal mode | |
131 | - // $scope.SetwindowStoreData(windowviewid,'isNormalMode',true); | |
132 | - // $rootScope.isZoomed = false; | |
133 | - | |
134 | - //navigator man functionality | |
135 | - // $scope.navigatorImage; | |
136 | - // $rootScope.NavigatorData; | |
137 | - | |
138 | - // $scope.dragdivleft; | |
139 | - // $scope.dragdivtop = 0; | |
140 | - | |
141 | - // $rootScope.systemNumber = 0; | |
142 | - | |
143 | - | |
144 | - | |
145 | - //currentTitleFromJson shows the current BodyView Title | |
146 | - // $scope.currentTitleFromJson; | |
147 | - | |
148 | - | |
149 | - | |
150 | 52 | } |
151 | 53 | |
152 | 54 | $scope.initializeWindowData = function(windowviewid,isfirsttimecall,cbwindowid){ |
... | ... | @@ -685,34 +587,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
685 | 587 | }, 100); |
686 | 588 | |
687 | 589 | |
688 | - // let promise = $timeout(); | |
689 | - // var timeint=null; | |
690 | - // angular.forEach($scope.DAModuleData, function (value, key) { | |
691 | - // $scope.settime=100000; | |
692 | - // promise= promise.then(function () { | |
693 | - // $scope.counter=0; | |
694 | - // $scope.openBodyView(value); | |
695 | - // timeint = $interval(function() { | |
696 | - // $scope.counter = $scope.counter + 1; | |
697 | - // if($scope.counter>=10) | |
698 | - // { | |
699 | - // $timeout.cancel(promise); | |
700 | - // $scope.stopInterval(); | |
701 | - | |
702 | - // } | |
703 | - // // if($rootScope.CBWindowLoadComplete==true) | |
704 | - // // { | |
705 | - // // $scope.stopInterval(promise); | |
706 | - // // $timeout.cancel(promise); | |
707 | - // // } | |
708 | - // }, 1000); | |
709 | - | |
710 | - // return $timeout($scope.settime); | |
711 | - | |
712 | - // }); | |
713 | - | |
714 | - // }); | |
715 | - | |
716 | 590 | $scope.stopInterval = function() { |
717 | 591 | if (angular.isDefined(timeint)) { |
718 | 592 | $interval.cancel(timeint); |
... | ... | @@ -742,9 +616,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
742 | 616 | $scope.initializeWindowData($rootScope.MULTI_VIEW_ID,false,$scope.daOpenInOtherModules.currentWindowId); |
743 | 617 | |
744 | 618 | } |
745 | - | |
746 | - // alert($rootScope.MULTI_VIEW_ID); | |
747 | - | |
619 | + | |
748 | 620 | if ($rootScope.isCallFromOtherModule) { |
749 | 621 | //$scope.daOpenInOtherModules = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); |
750 | 622 | |
... | ... | @@ -829,8 +701,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
829 | 701 | $scope.jsPanelID = 'daImagePanel' + '_' + $rootScope.MULTI_VIEW_ID; |
830 | 702 | $scope.viewID = 'daViewDA' + '_' + $rootScope.MULTI_VIEW_ID; |
831 | 703 | $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'parentSlugName','da-view-list'); |
832 | - // $rootScope.DaWindowData.find(v => v.multiwinid == $rootScope.MULTI_VIEW_ID).parentSlugName = 'da-view-list'; | |
833 | - | |
704 | + | |
834 | 705 | $scope.loadBodyView($rootScope.MULTI_VIEW_ID); |
835 | 706 | } |
836 | 707 | |
... | ... | @@ -1112,8 +983,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1112 | 983 | |
1113 | 984 | var layerNum = $scope.GetwindowStoreData(windviewid,'totalLayers'); |
1114 | 985 | |
1115 | - // var daViewScope = angular.element(document.getElementsByClassName("daBodyView")).scope(); | |
1116 | - //layerNum = parseInt(daViewScope.totalLayers) //- parseInt(scope.layerNumber); | |
1117 | 986 | var sliderVal = layerNum - ui.value; |
1118 | 987 | $("#txtLayerNumberDA_" + windviewid).val(sliderVal); |
1119 | 988 | }, |
... | ... | @@ -1166,7 +1035,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1166 | 1035 | // } |
1167 | 1036 | // , |
1168 | 1037 | stop: function (event, ui) { |
1169 | - //alert('trans changed') | |
1170 | 1038 | var targetid = event.target.id; |
1171 | 1039 | var windviewid = targetid.split('_')[1]; |
1172 | 1040 | var scope = angular.element(document.getElementById("daViewDA_" + windviewid)).scope(); |
... | ... | @@ -1523,15 +1391,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1523 | 1391 | searchWorker.onmessage = function (e) { |
1524 | 1392 | |
1525 | 1393 | console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); |
1526 | - //$rootScope.TermNumberData = e.data.TermNumberData; | |
1394 | + | |
1527 | 1395 | $scope.SetwindowStoreData(windowviewid,'TermNumberData',e.data.TermNumberData); |
1528 | 1396 | |
1529 | 1397 | console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length); |
1530 | - // $rootScope.VocabTermData = e.data.VocabTermData,//same | |
1531 | - // $scope.vocabTermTxt = e.data.vocabTermTxt, | |
1532 | - // $scope.vocabLanguage = e.data.language, | |
1533 | - //$scope.BodyViewIDs = e.data.bodyViewID; | |
1534 | - | |
1398 | + | |
1535 | 1399 | console.log("$scope.BodyViewIDs" + e.data.bodyViewID); |
1536 | 1400 | $scope.vocabTempTermArray = []; |
1537 | 1401 | if ($rootScope.isOpenResourceBtnClicked) { |
... | ... | @@ -1654,10 +1518,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1654 | 1518 | bodyViewWorker.onmessage = function (e) { |
1655 | 1519 | //console.log('callback in extr'); |
1656 | 1520 | $scope.SetwindowStoreData(windowviewid,'BodyRegionData',e.data.bodyRegionData); |
1657 | - // $rootScope.BodyRegionData = e.data.bodyRegionData; | |
1521 | + | |
1658 | 1522 | $scope.SetwindowStoreData(windowviewid,'bgartData',e.data.bodyArtData); |
1659 | - // $rootScope.bgartData = e.data.bodyArtData; | |
1660 | - //$rootScope.BodyLayerData = e.data.bodyLayerData; | |
1523 | + | |
1661 | 1524 | $scope.SetwindowStoreData(windowviewid,'BodyLayerData',e.data.bodyLayerData); |
1662 | 1525 | |
1663 | 1526 | var totalLayer = e.data.bodyLayerData.Layers.DataLayer.length-1; |
... | ... | @@ -1856,14 +1719,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1856 | 1719 | |
1857 | 1720 | } |
1858 | 1721 | |
1859 | - // var isFound = jQuery.inArray(serachTerm, fullTermlist) | |
1860 | - // if (isFound == -1) { | |
1861 | - // fullTermlist.push(serachTerm); | |
1862 | - | |
1863 | - // AllTerms.push({ '_TermNumber': serachTerm }) | |
1864 | - | |
1865 | - // } | |
1866 | - | |
1867 | 1722 | } |
1868 | 1723 | var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); |
1869 | 1724 | var nlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber'); |
... | ... | @@ -1926,14 +1781,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1926 | 1781 | $scope.terminateCurrentlyRunningWPs(); |
1927 | 1782 | $rootScope.isLoading = true; |
1928 | 1783 | $('#spinner').css('visibility', 'visible'); |
1929 | - | |
1930 | - // $scope.layerInfoForModesty = []; | |
1784 | + | |
1931 | 1785 | $scope.SetwindowStoreData(windowviewid,'layerInfoForModesty',[]); |
1932 | 1786 | |
1933 | - //$scope.modestyImageInfo = []; | |
1934 | 1787 | $scope.SetwindowStoreData(windowviewid,'modestyImageInfo',[]); |
1935 | - | |
1936 | - // store colorimagecanvaslist | |
1788 | + | |
1937 | 1789 | $scope.coloredImageCanvasList = []; |
1938 | 1790 | $scope.SetwindowStoreData(windowviewid,'coloredImageCanvasList',[]); |
1939 | 1791 | |
... | ... | @@ -1941,7 +1793,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1941 | 1793 | $scope.coloredImageMRCanvasList = []; |
1942 | 1794 | $scope.SetwindowStoreData(windowviewid,'coloredImageMRCanvasList',[]); |
1943 | 1795 | |
1944 | - //$scope.MaskCanvasData = []; | |
1945 | 1796 | $scope.SetwindowStoreData(windowviewid,'MaskCanvasData',[]); |
1946 | 1797 | |
1947 | 1798 | //set height of canvas div and left tool bar as per window size |
... | ... | @@ -1998,19 +1849,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1998 | 1849 | |
1999 | 1850 | $scope.SetwindowStoreData(windowviewid,'updatedGrayDataList',[]); |
2000 | 1851 | $scope.SetwindowStoreData(windowviewid,'updatedGrayMRDataList',[]); |
2001 | - | |
2002 | - // if ($rootScope.updatedGrayDataList != null && $rootScope.updatedGrayDataList != undefined) { | |
2003 | - // $rootScope.updatedGrayDataList = []; | |
2004 | - // } | |
2005 | - // if ($rootScope.updatedGrayMRDataList != null && $rootScope.updatedGrayMRDataList != undefined) { | |
2006 | - // $rootScope.updatedGrayMRDataList = []; | |
2007 | - // } | |
2008 | - // if ($rootScope.grayImageDataList != null && $rootScope.grayImageDataList != undefined) { | |
2009 | - // $rootScope.grayImageDataList = []; | |
2010 | - // } | |
2011 | - // if ($rootScope.grayImageMRDataList != null && $rootScope.grayImageMRDataList != undefined) { | |
2012 | - // $rootScope.grayImageMRDataList = []; | |
2013 | - // } | |
1852 | + | |
2014 | 1853 | //history code |
2015 | 1854 | |
2016 | 1855 | if ($("#canvasDivDA_" + windowviewid).find("canvas[id='canvasPaint']").length == 0) { |
... | ... | @@ -2501,6 +2340,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
2501 | 2340 | if ($scope.isLayerChange == true) { |
2502 | 2341 | $scope.isLayerChange = false; |
2503 | 2342 | } |
2343 | + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); | |
2344 | + $('#typedTermName_' + windowviewid).val(''); | |
2504 | 2345 | |
2505 | 2346 | if (evt.ctrlKey) { |
2506 | 2347 | $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); |
... | ... | @@ -2992,7 +2833,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
2992 | 2833 | if ($scope.isLayerChange == true) { |
2993 | 2834 | $scope.isLayerChange = false; |
2994 | 2835 | } |
2995 | - | |
2836 | + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); | |
2837 | + $('#typedTermName_' + windowviewid).val(''); | |
2996 | 2838 | if (evt.ctrlKey) { |
2997 | 2839 | $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); |
2998 | 2840 | |
... | ... | @@ -3557,7 +3399,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
3557 | 3399 | } |
3558 | 3400 | |
3559 | 3401 | } |
3560 | - | |
3561 | 3402 | else { |
3562 | 3403 | var coloredImageCanvasList=$scope.GetwindowStoreData(windowviewid,'coloredImageCanvasList'); |
3563 | 3404 | |
... | ... | @@ -3571,7 +3412,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
3571 | 3412 | } |
3572 | 3413 | } |
3573 | 3414 | |
3574 | - | |
3575 | 3415 | var worker = new Worker('extract-wp.js'); |
3576 | 3416 | |
3577 | 3417 | //push workers in array to further used the refernece to delete the workers |
... | ... | @@ -3601,10 +3441,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
3601 | 3441 | |
3602 | 3442 | var bodyRegionId = e.data.bodyRegionId; |
3603 | 3443 | |
3604 | - | |
3605 | 3444 | var canvasId = (e.data.canvasId).replace('_mci', ''); |
3606 | 3445 | |
3607 | - //for (var i = 1; i <= updatedData.length; i++) { | |
3608 | 3446 | var grayCanvasID = canvasId; |
3609 | 3447 | |
3610 | 3448 | var grayCanvas = document.getElementById(grayCanvasID); |
... | ... | @@ -3682,6 +3520,19 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
3682 | 3520 | $scope.aligneCanvasWithTerm(windowviewid); |
3683 | 3521 | |
3684 | 3522 | $scope.EnableUI(); |
3523 | + | |
3524 | + if ($scope.runningWorkers != null || $scope.runningWorkers != undefined) { | |
3525 | + | |
3526 | + var workerCount = $scope.runningWorkers.length; | |
3527 | + if (workerCount > 0) { | |
3528 | + for (var i = workerCount - 1; i >= 0; i--) { | |
3529 | + | |
3530 | + var runningWorker = $scope.runningWorkers[i].workerName; | |
3531 | + runningWorker.terminate(); | |
3532 | + $scope.runningWorkers.splice(i, 1); | |
3533 | + } | |
3534 | + } | |
3535 | + } | |
3685 | 3536 | } |
3686 | 3537 | |
3687 | 3538 | }; |
... | ... | @@ -4434,11 +4285,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
4434 | 4285 | .where('_TermNumber == ' + termNumber) |
4435 | 4286 | .select(); |
4436 | 4287 | |
4437 | - //$scope.matchedTermNoData = new jinqJs() | |
4438 | - // .from($rootScope.TermNumberData.TermData.Term) | |
4439 | - // .where('_TermNumber == ' + termNumber) | |
4440 | - // .select(); | |
4441 | - | |
4442 | 4288 | if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) { |
4443 | 4289 | //1. |
4444 | 4290 | var actualTermNo = 0; |
... | ... | @@ -4467,7 +4313,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
4467 | 4313 | .then( |
4468 | 4314 | function (result) { |
4469 | 4315 | $scope.SetwindowStoreData(windowviewid,'TermNumberData',result); |
4470 | - //$rootScope.TermNumberData = result; | |
4316 | + | |
4471 | 4317 | $scope.GetAnnotationText(termNumber,windowviewid); |
4472 | 4318 | }) |
4473 | 4319 | } |
... | ... | @@ -4848,11 +4694,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
4848 | 4694 | if (isClickedOnSamePoint == 0) { |
4849 | 4695 | console.log('not clicked on same point') |
4850 | 4696 | $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id, tipx, tipy,windowviewid,speechBubbleCounter); |
4851 | - | |
4852 | - | |
4853 | - // $scope.speechList=[]; | |
4697 | + | |
4854 | 4698 | $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id }); |
4855 | - // $scope.SetwindowStoreData(windowviewid,'speechbubbleList',$scope.speechList); | |
4856 | 4699 | } |
4857 | 4700 | $('.appendDragg').draggable({ |
4858 | 4701 | drag: function (evt) { |
... | ... | @@ -4863,7 +4706,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
4863 | 4706 | var canvasDiv = document.getElementById('canvasDivDA_' + windid); |
4864 | 4707 | var verticalScrollPosition = canvasDiv.scrollTop; |
4865 | 4708 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
4866 | - // var speechbubbleList=$scope.GetwindowStoreData(windid,'speechbubbleList'); | |
4867 | 4709 | if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { |
4868 | 4710 | for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { |
4869 | 4711 | if ( $scope.speechbubbleList[m].ids == sub_id1) { |
... | ... | @@ -4932,7 +4774,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
4932 | 4774 | var pointClicked_annotation = parseInt(x) + parseInt(y); |
4933 | 4775 | var Exists_annotation = $('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked_annotation + "]").length; |
4934 | 4776 | $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation,windowviewid,TPspeechBubbleCounter); |
4935 | - // $scope.speechList1=[]; | |
4936 | 4777 | $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: sub_id_annotation }); |
4937 | 4778 | $scope.SetwindowStoreData(windowviewid,'speachBubbleArrayAnnotation',$scope.speechList1); |
4938 | 4779 | $('.appendDragg_annotation').draggable({ |
... | ... | @@ -4944,7 +4785,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
4944 | 4785 | var canvasDiv = document.getElementById('canvasDivDA_' + windid); |
4945 | 4786 | var verticalScrollPosition = canvasDiv.scrollTop; |
4946 | 4787 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
4947 | - //var speachBubbleArrayAnnotation=$scope.GetwindowStoreData(windid,'speachBubbleArrayAnnotation'); | |
4948 | 4788 | if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { |
4949 | 4789 | for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { |
4950 | 4790 | if ( $scope.speechbubbleList[m].ids == sub_id1_anno) { |
... | ... | @@ -5687,7 +5527,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5687 | 5527 | $scope.TransparencyBoxEndY = TransparencyBoxEndY; |
5688 | 5528 | |
5689 | 5529 | if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) { |
5690 | - // $('#transparencyScale').css('visibility', 'hidden'); | |
5530 | + | |
5691 | 5531 | } else { |
5692 | 5532 | |
5693 | 5533 | if (previewRectangleWidth == 0 && previewRectangleHeight == 0) { |
... | ... | @@ -5698,8 +5538,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5698 | 5538 | $scope.DisableUI(); |
5699 | 5539 | |
5700 | 5540 | $scope.SetwindowStoreData(windowviewid,'layerNumberBeforeTBDraw',parseInt($('#txtLayerNumberDA_' + windowviewid).val())); |
5701 | - // $scope.layerNumberBeforeTBDraw = parseInt($('#txtLayerNumberDA_' + windowviewid).val()); | |
5702 | - | |
5541 | + | |
5703 | 5542 | //draw temp box to store the canvas data with original transparecy |
5704 | 5543 | if (document.getElementById('tempCanvas_' + windowviewid) != null) { |
5705 | 5544 | $('#tempCanvas_' + windowviewid).remove(); |
... | ... | @@ -5719,10 +5558,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5719 | 5558 | } |
5720 | 5559 | |
5721 | 5560 | $scope.SetwindowStoreData(windowviewid,'isTransparencyActivated',true); |
5722 | - // $rootScope.isTransparencyActivated = true; | |
5723 | 5561 | $scope.SetwindowStoreData(windowviewid,'isTransparencyBtnClicked',false); |
5724 | 5562 | |
5725 | - // var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
5726 | 5563 | var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData'); |
5727 | 5564 | |
5728 | 5565 | $scope.IncludedBodyRegions = []; |
... | ... | @@ -6220,7 +6057,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
6220 | 6057 | tempCtx.drawImage(tempImg, 0, 0); |
6221 | 6058 | |
6222 | 6059 | if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true) { |
6223 | - // var tempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId; | |
6224 | 6060 | $scope.highlightTempTransparencyCanvas(tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, |
6225 | 6061 | XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, windowviewid); |
6226 | 6062 | } |
... | ... | @@ -6893,7 +6729,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
6893 | 6729 | |
6894 | 6730 | |
6895 | 6731 | $rootScope.setSelectedBodyRegionData = function (windowviewid) { |
6896 | - // var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
6897 | 6732 | var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData'); |
6898 | 6733 | var bodyVid= $scope.GetwindowStoreData(windowviewid,'voId') |
6899 | 6734 | $.each(BodyRegionDictionary, function (index, value) { |
... | ... | @@ -7018,7 +6853,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7018 | 6853 | document.getElementById('canvasDivDA_' + windowviewid).appendChild(tempCanvas); |
7019 | 6854 | |
7020 | 6855 | |
7021 | - //var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
7022 | 6856 | var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData'); |
7023 | 6857 | |
7024 | 6858 | $scope.IncludedBodyRegions = []; |
... | ... | @@ -7406,9 +7240,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7406 | 7240 | |
7407 | 7241 | } |
7408 | 7242 | |
7409 | - // if ($('#sppeachBubble_'+windowviewid).length > 0) | |
7410 | - // $('#sppeachBubble_'+windowviewid).remove(); | |
7411 | - | |
7412 | 7243 | var tCanvasTopPos = $(".ui-wrapper").css("top"); |
7413 | 7244 | var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p"); |
7414 | 7245 | var tCanvasHeight = $(".ui-wrapper").css("height"); |
... | ... | @@ -7451,10 +7282,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7451 | 7282 | // console.log('at the time' + pixelData.data[0]) |
7452 | 7283 | |
7453 | 7284 | var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope,windowviewid); |
7454 | - // if ($('#sppeachBubble_'+windowviewid).length > 0) | |
7455 | - // $('#sppeachBubble_'+windowviewid).remove(); | |
7456 | - | |
7457 | - | |
7285 | + | |
7458 | 7286 | $scope.annotationTextArrayT1 = []; |
7459 | 7287 | $scope.annotationTextArrayT2 = []; |
7460 | 7288 | for (var i = 0; i <= $rootScope.annotationTextForTrans1.length - 1; i++) { |
... | ... | @@ -7654,8 +7482,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7654 | 7482 | $("#OnIdentify").addClass('annotationtoolbartab'); |
7655 | 7483 | $("#DrawMode").removeClass('annotationtoolbartab'); |
7656 | 7484 | } |
7657 | - | |
7658 | - // $rootScope.switchCanvas(); | |
7659 | 7485 | //To enable extract button |
7660 | 7486 | $scope.SetwindowStoreData(windowviewid,'isTransparencyActivated',false); |
7661 | 7487 | // $rootScope.isTransparencyActivated = false; |
... | ... | @@ -8244,7 +8070,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
8244 | 8070 | } |
8245 | 8071 | |
8246 | 8072 | //// #7972 Mozilla Firefox> Incorrect navigation |
8247 | - // $("#" + $scope.canvasDivID).scroll(function (event) { | |
8073 | + | |
8248 | 8074 | $("#canvasDiv").scroll(function (event) { |
8249 | 8075 | var windowviewid = (event.currentTarget.id).split("_")[1]; |
8250 | 8076 | |
... | ... | @@ -9149,11 +8975,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
9149 | 8975 | $rootScope.isLoading = false; |
9150 | 8976 | $('#spinner').css('visibility', 'hidden'); |
9151 | 8977 | |
9152 | - //To fix issue of gray maintained in after closing jspanel after listmanager selection | |
9153 | - // $rootScope.isListManagerSelected = false; | |
9154 | - // $rootScope.isHighLight = false; | |
9155 | - //$rootScope.isNormalMode = false; | |
9156 | - // $rootScope.isHighlightBodyByBodySystem = false; | |
9157 | 8978 | $rootScope.CloseListManager(); |
9158 | 8979 | }) |
9159 | 8980 | |
... | ... | @@ -9568,41 +9389,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
9568 | 9389 | |
9569 | 9390 | } |
9570 | 9391 | |
9571 | - | |
9572 | - // //body highlight options functinality | |
9573 | - // $scope.LoadBodySystemData = function (event) { | |
9574 | - // var windowviewid = (event.currentTarget.id).split("_")[1]; | |
9575 | - // event.stopPropagation(); | |
9576 | - // $("#structureDropdownDA_" + windowviewid).toggle(); | |
9577 | - // $("#genderChangeIdDA_" + windowviewid).css("display", "none"); | |
9578 | - // $("#viewChangeIDDA_" + windowviewid).css("display", "none"); | |
9579 | - // var $ua = navigator.userAgent; | |
9580 | - // if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { | |
9581 | - // $(".custom-tooltip").toggle(); | |
9582 | - // } | |
9583 | - // // var currentBodyViewId = $scope.GetwindowStoreData(windowviewid,'voId') ; | |
9584 | - // // var systemListHtml = '<ul class="dropdown-menu" aria-labelledby="dropdownMenu2"><li><a href="#" title="Current Structure">Current Structure</a></li> <li role="separator" class="divider"></li>' | |
9585 | - // // var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item; | |
9586 | - | |
9587 | - // // angular.forEach(systemList, function (value, key) { | |
9588 | - | |
9589 | - // // systemListHtml = systemListHtml + '<li><a href="#" id="' + value._BodySystemId + '" title="' + value._Name + '">' + value._Name + '</a></li>' | |
9590 | - // // }) | |
9591 | - | |
9592 | - // // systemListHtml = systemListHtml + '</ul>'; | |
9593 | - // // $('#bodySystem').append(systemListHtml); | |
9594 | - | |
9595 | - | |
9596 | - // } | |
9597 | - | |
9598 | 9392 | $scope.GetBodySystemData = function (currentBodyViewId,windowviewid) { |
9599 | 9393 | var bodySystemDataPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_body_system_term_' + currentBodyViewId + '.json'; |
9600 | 9394 | DataService.getJson(bodySystemDataPath) |
9601 | 9395 | .then( |
9602 | 9396 | function (result) { |
9603 | 9397 | $scope.SetwindowStoreData(windowviewid,'BodySystemData',result); |
9604 | - // $rootScope.BodySystemData = result; | |
9605 | - | |
9398 | + | |
9606 | 9399 | }, |
9607 | 9400 | function (error) { |
9608 | 9401 | console.log(error.statusText) |
... | ... | @@ -9656,11 +9449,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
9656 | 9449 | $scope.SetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem',true); |
9657 | 9450 | // no $scope.systemMatchedTermList using ,getting from service // birendra |
9658 | 9451 | |
9659 | - // var BodySystemData=$scope.GetwindowStoreData(windowviewid,'BodySystemData'); | |
9660 | - // $scope.systemMatchedTermList = new jinqJs() | |
9661 | - // .from(BodySystemData.BodySystem.BodySystemTerm) | |
9662 | - // .where('_SystemNumber == ' + event.currentTarget.id) | |
9663 | - // .select(); | |
9452 | + // var BodySystemData=$scope.GetwindowStoreData(windowviewid,'BodySystemData'); | |
9453 | + // $scope.systemMatchedTermList = new jinqJs() | |
9454 | + // .from(BodySystemData.BodySystem.BodySystemTerm) | |
9455 | + // .where('_SystemNumber == ' + event.currentTarget.id) | |
9456 | + // .select(); | |
9664 | 9457 | |
9665 | 9458 | if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == false) { |
9666 | 9459 | //color the body gray |
... | ... | @@ -9979,7 +9772,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
9979 | 9772 | //this check is for log only because we are writing length so need to check if its not null or undefined |
9980 | 9773 | if (vocabTermDataArray[primaryLexiconIndx].vocabTermTxt != null || vocabTermDataArray[primaryLexiconIndx].vocabTermTxt != undefined) |
9981 | 9774 | console.log('$scope.VocabTermTxt.length= ' + vocabTermDataArray[primaryLexiconIndx].vocabTermTxt.length) |
9982 | - // $scope.SetwindowStoreData(windowviewid,'IsSearchVisible',true); | |
9775 | + | |
9983 | 9776 | $scope.IsSearchVisible = true; |
9984 | 9777 | $timeout(function () { |
9985 | 9778 | var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); |
... | ... | @@ -10669,7 +10462,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
10669 | 10462 | $("#bodySystems").find("option[id=" + bodysystemId + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); |
10670 | 10463 | |
10671 | 10464 | $('#termList').empty(); |
10672 | - // $('#termList').innerHTML = ''; | |
10673 | 10465 | |
10674 | 10466 | if (bodysystemId == 0) { |
10675 | 10467 | $scope.loadListManger(windowviewid); |
... | ... | @@ -10680,7 +10472,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
10680 | 10472 | .then( |
10681 | 10473 | function (result) { |
10682 | 10474 | $scope.SetwindowStoreData(windowviewid,'BodySystemData',result); |
10683 | - // $rootScope.BodySystemData = result; | |
10684 | 10475 | var systemMatchedTermList = new jinqJs() |
10685 | 10476 | .from(result.BodySystem.BodySystemTerm) |
10686 | 10477 | .where('_SystemNumber == ' + bodysystemId) |
... | ... | @@ -10761,8 +10552,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
10761 | 10552 | |
10762 | 10553 | var termsTotal = '<span class="pull-left marginTop5">' + VocabTermTxtfilter.length + ' Structures</span>'; |
10763 | 10554 | $("#totalTerms").empty(); |
10764 | - //$('#totalTerms').innerHTML = ''; | |
10765 | - | |
10555 | + | |
10766 | 10556 | $('#totalTerms').append(termsTotal); |
10767 | 10557 | $rootScope.isLoading = false; |
10768 | 10558 | $('#spinner').css('visibility', 'hidden'); |
... | ... | @@ -10870,7 +10660,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
10870 | 10660 | |
10871 | 10661 | $scope.resetSearchListView = function () { |
10872 | 10662 | |
10873 | - // $scope.ShowSearch(); | |
10874 | 10663 | $scope.showFilteredTerms() |
10875 | 10664 | } |
10876 | 10665 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/extract-wp.js
1 | -var UpdatedGrayImageDataList = []; | |
2 | -var doneBRID = []; | |
3 | -var abc = 'hello'; | |
4 | -previousGrayImageDataList = []; | |
5 | -getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) { | |
6 | - console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) | |
7 | - console.log('imagredata= ' + grayImageData) | |
8 | - | |
9 | - var matchedRGBLocationInBodyRegion = []; | |
10 | - var matched; | |
11 | - | |
12 | - console.log(grayImageData) | |
13 | - var n = maskCanvasData.data.length; | |
14 | - var maskData = maskCanvasData.data; | |
15 | - for (var z = 0; z < termList.length; z++) { | |
16 | - | |
17 | - if (previousGrayImageDataList[parseInt(bodyRegionId - 1)] != null) { | |
18 | - grayImageData = previousGrayImageDataList[parseInt(bodyRegionId - 1)]; | |
19 | - | |
20 | - } | |
21 | - | |
22 | - if (grayImageData != null) { | |
23 | - var grayImageDataVar = grayImageData.data; | |
24 | - var coloredImageDataVar = coloredImageData.data; | |
25 | - | |
26 | - for (var i = 0; i < n; i += 4) { | |
27 | - | |
28 | - | |
29 | - var RED = maskData[i] - 9; | |
30 | - var GREEN = maskData[i + 1] - 9; | |
31 | - var BLUE = maskData[i + 2] - 9; | |
32 | - | |
33 | - var Red; | |
34 | - var Green; | |
35 | - var Blue; | |
36 | - var zero = "0"; | |
37 | - | |
38 | - if ((RED).toString().length != 2) { | |
39 | - Red = zero.concat((RED).toString()) | |
40 | - } | |
41 | - else { | |
42 | - Red = (RED).toString() | |
43 | - } | |
44 | - if ((GREEN).toString().length != 2) { | |
45 | - Green = zero.concat((GREEN).toString()) | |
46 | - } | |
47 | - else { | |
48 | - Green = (GREEN).toString() | |
49 | - | |
50 | - } | |
51 | - if ((BLUE).toString().length != 2) { | |
52 | - Blue = zero.concat((BLUE).toString()) | |
53 | - } | |
54 | - else { | |
55 | - Blue = (BLUE).toString() | |
56 | - | |
57 | - } | |
58 | - | |
59 | - var Icolor = (Red + Green + Blue); | |
60 | - // alert('Icolor: ' + Icolor) | |
61 | - | |
62 | - if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) { | |
63 | - | |
64 | - // debugger; | |
65 | - | |
66 | - | |
67 | - // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i }); | |
68 | - | |
69 | - | |
70 | - // matched = true; | |
71 | - | |
72 | - var RED_coloredImage = coloredImageDataVar[i]; | |
73 | - | |
74 | - grayImageDataVar[i] = RED_coloredImage; | |
75 | - | |
76 | - | |
77 | - var GREEN_coloredImage = coloredImageDataVar[i + 1]; | |
78 | - grayImageDataVar[i + 1] = GREEN_coloredImage; | |
79 | - | |
80 | - var BLUE_coloredImage = coloredImageDataVar[i + 2]; | |
81 | - grayImageDataVar[i + 2] = BLUE_coloredImage; | |
82 | - | |
83 | - | |
84 | - var ALPHA_coloredImage = coloredImageDataVar[i + 3]; | |
85 | - grayImageDataVar[i + 3] = ALPHA_coloredImage; | |
86 | - | |
87 | - } | |
88 | - | |
89 | - | |
90 | - } | |
91 | - // debugger; | |
92 | - previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData; | |
93 | - | |
94 | - } | |
95 | - } | |
96 | - | |
97 | - self.postMessage({ | |
98 | - 'bodyRegionId': bodyRegionId, | |
99 | - 'value': grayImageData, | |
100 | - 'canvasId': canvasId | |
101 | - | |
102 | - }); | |
103 | -} | |
104 | - | |
105 | -self.onmessage = function (e) { | |
106 | - getLocationForMatchedTermsInWholeBody(e.data.termList, e.data.maskCanvasData, e.data.coloredImageData, | |
107 | - e.data.grayImageData, e.data.bodyRegionId, e.data.canvasId); | |
108 | - | |
109 | -} | |
1 | +previousGrayImageDataList = []; | |
2 | +getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) { | |
3 | + console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) | |
4 | + | |
5 | + var masklen = maskCanvasData.data.length; | |
6 | + var maskData = maskCanvasData.data; | |
7 | + var nextStep=4; | |
8 | + var zero = "0"; | |
9 | + for (var z = 0; z < termList.length; z++) { | |
10 | + var termnumber=termList[z]._TermNumber; | |
11 | + if(termnumber.length<6) | |
12 | + { | |
13 | + continue; | |
14 | + } | |
15 | + if (previousGrayImageDataList[parseInt(bodyRegionId - 1)] != null) { | |
16 | + grayImageData = previousGrayImageDataList[parseInt(bodyRegionId - 1)]; | |
17 | + | |
18 | + } | |
19 | + | |
20 | + if (grayImageData != null) { | |
21 | + var grayImageDataVar = grayImageData.data; | |
22 | + var coloredImageDataVar = coloredImageData.data; | |
23 | + | |
24 | + for (var i = 0; i < masklen; i += nextStep) { | |
25 | + | |
26 | + var RED = maskData[i] - 9; | |
27 | + if (RED <0) { continue; } | |
28 | + | |
29 | + var GREEN = maskData[i + 1] - 9; | |
30 | + if (GREEN <0) { continue; } | |
31 | + | |
32 | + var BLUE = maskData[i + 2] - 9; | |
33 | + if (BLUE <0) { continue; } | |
34 | + | |
35 | + BLUE=BLUE.toString(); | |
36 | + if (BLUE.length !=2) | |
37 | + { | |
38 | + BLUE = zero.concat(BLUE); | |
39 | + } | |
40 | + if(termnumber.startsWith(BLUE,4)) { | |
41 | + GREEN=GREEN.toString(); | |
42 | + if (GREEN.length !=2) | |
43 | + { | |
44 | + GREEN = zero.concat(GREEN); | |
45 | + } | |
46 | + | |
47 | + if(termnumber.startsWith(GREEN,2)) { | |
48 | + RED=RED.toString(); | |
49 | + if (RED.length !=2) | |
50 | + { | |
51 | + RED = zero.concat(RED); | |
52 | + } | |
53 | + if(termnumber.startsWith(RED,0)) { | |
54 | + | |
55 | + var Icolor = (RED + GREEN + BLUE); | |
56 | + | |
57 | + if (termnumber == Icolor) { | |
58 | + | |
59 | + for (var index = i; index < i+nextStep; index += 1) { | |
60 | + | |
61 | + grayImageDataVar[index]=coloredImageDataVar[index]; | |
62 | + | |
63 | + } | |
64 | + } | |
65 | + } | |
66 | + else{continue;} | |
67 | + | |
68 | + } | |
69 | + else{continue;} | |
70 | + | |
71 | + } | |
72 | + else{continue;} | |
73 | + } | |
74 | + // debugger; | |
75 | + previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData; | |
76 | + | |
77 | + } | |
78 | + } | |
79 | + | |
80 | + self.postMessage({ | |
81 | + 'bodyRegionId': bodyRegionId, | |
82 | + 'value': grayImageData, | |
83 | + 'canvasId': canvasId | |
84 | + | |
85 | + }); | |
86 | +} | |
87 | + | |
88 | +self.onmessage = function (e) { | |
89 | + getLocationForMatchedTermsInWholeBody(e.data.termList, e.data.maskCanvasData, e.data.coloredImageData, | |
90 | + e.data.grayImageData, e.data.bodyRegionId, e.data.canvasId); | |
91 | + | |
92 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.Web/term-number-wp.js
... | ... | @@ -5,7 +5,7 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo |
5 | 5 | |
6 | 6 | var masklen = maskCanvasData.data.length; |
7 | 7 | var maskData = maskCanvasData.data; |
8 | - var nextStep=4; | |
8 | + var nextStep=8; | |
9 | 9 | var zero = "0"; |
10 | 10 | for (var z = 0; z < termList.length; z++) { |
11 | 11 | |
... | ... | @@ -31,14 +31,13 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo |
31 | 31 | |
32 | 32 | var BLUE = maskData[i + 2] - 9; |
33 | 33 | if (BLUE <0) { continue; } |
34 | - | |
35 | - RED=RED.toString(); | |
36 | - if (RED.length !=2) | |
34 | + | |
35 | + BLUE=BLUE.toString(); | |
36 | + if (BLUE.length !=2) | |
37 | 37 | { |
38 | - RED = zero.concat(RED); | |
38 | + BLUE = zero.concat(BLUE); | |
39 | 39 | } |
40 | - | |
41 | - if(termnumber.startsWith(RED,0)) { | |
40 | + if(termnumber.startsWith(BLUE,4)) { | |
42 | 41 | GREEN=GREEN.toString(); |
43 | 42 | if (GREEN.length !=2) |
44 | 43 | { |
... | ... | @@ -46,20 +45,20 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo |
46 | 45 | } |
47 | 46 | |
48 | 47 | if(termnumber.startsWith(GREEN,2)) { |
49 | - BLUE=BLUE.toString(); | |
50 | - if (BLUE.length !=2) | |
51 | - { | |
52 | - BLUE = zero.concat(BLUE); | |
53 | - } | |
54 | - if(termnumber.startsWith(BLUE,4)) { | |
48 | + RED=RED.toString(); | |
49 | + if (RED.length !=2) | |
50 | + { | |
51 | + RED = zero.concat(RED); | |
52 | + } | |
53 | + if(termnumber.startsWith(RED,0)) { | |
55 | 54 | |
56 | 55 | var Icolor = (RED + GREEN + BLUE); |
57 | 56 | |
58 | 57 | if (termnumber == Icolor) { |
59 | 58 | |
60 | - for (var range = i; range < i+nextStep; range += 1) { | |
59 | + for (var index = i; index < i+nextStep; index += 1) { | |
61 | 60 | |
62 | - grayImageDataVar[range]=coloredImageDataVar[range]; | |
61 | + grayImageDataVar[index]=coloredImageDataVar[index]; | |
63 | 62 | |
64 | 63 | } |
65 | 64 | } | ... | ... |