Commit 30a53778e5dbdd4cef0d3b713e2bf81864350657

Authored by Amrita Vishnoi
1 parent 0861fd4e

Included Body system Code and one fix for extract.

400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj
... ... @@ -73,6 +73,7 @@
73 73 </ItemGroup>
74 74 <ItemGroup>
75 75 <Content Include="Global.asax" />
  76 + <Content Include="term-number-wp%282%29.js" />
76 77 <Content Include="Web.config" />
77 78 </ItemGroup>
78 79 <ItemGroup>
... ...
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
... ... @@ -214,9 +214,6 @@
214 214 <Content Include="content\images\DA\ethnicity\body-views\9\L\thumbnails\da_tni_3343_L.jpg" />
215 215 <Content Include="content\images\DA\ethnicity\body-views\9\W\navigator_images\da_oi_99.jpg" />
216 216 <Content Include="content\images\DA\ethnicity\body-views\9\W\thumbnails\da_tni_3343_W.jpg" />
217   - <Content Include="match-pixel-wp.js" />
218   - <Content Include="term-number-wp.js" />
219   - <Content Include="term-wp.js" />
220 217 <Content Include="content\css\main.css" />
221 218 <Content Include="content\data\json\da\body-views\1\da_dat_tm_sg_1.json" />
222 219 <Content Include="content\data\json\da\body-views\10\da_dat_body_system_term_10.json" />
... ... @@ -43216,7 +43213,6 @@
43216 43213 <Content Include="libs\worker.js" />
43217 43214 <Content Include="login.html" />
43218 43215 <Content Include="app\widget\MainView.html" />
43219   - <Content Include="match-pixel-wp.js" />
43220 43216 <Content Include="extract-wp.js" />
43221 43217 <Content Include="term-number-wp.js" />
43222 43218 <Content Include="themes\default\css\bootstrap\3.3.6\bootstrap-theme.css" />
... ... @@ -43312,7 +43308,6 @@
43312 43308 </Content>
43313 43309 </ItemGroup>
43314 43310 <ItemGroup>
43315   - <Folder Include="app\worker-process\" />
43316 43311 <Folder Include="content\images\DA\75\body-views\4\layers\329\6\" />
43317 43312 <Folder Include="Properties\" />
43318 43313 </ItemGroup>
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -8,12 +8,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8 8 $scope.BodyViewData;
9 9 $scope.selectedGenderBodyViewData;
10 10 $scope.imagePath = "";
11   - $scope.BodyRegionData;
12   - $scope.BodyRegionCordinatesData;
  11 + $rootScope.BodyRegionData;
  12 + $rootScope.BodyRegionCordinatesData;
13 13 $scope.isTransparencyActivated;
14   - $scope.BodyLayerData;
  14 + $rootScope.BodyLayerData;
15 15 $scope.VocabTermData;
16   - //var vocabTermTxt = [];
  16 +
17 17 $scope.VocabTermTxt;
18 18 $scope.CommonData
19 19 $scope.TermNumberData;
... ... @@ -37,9 +37,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
37 37 $rootScope.ColoredCanvasData = [];
38 38 $rootScope.grayImageDataList = [];
39 39 $rootScope.grayImageMRDataList = [];
40   -
41   - $rootScope.grayImageDataListCurrent = [];
42   - $rootScope.grayImageMRDataListCurrent = [];
  40 + $rootScope.updatedGrayDataList = [];
  41 + $rootScope.updatedGrayMRDataList = [];
43 42  
44 43 $scope.AnteriorView = "active";
45 44  
... ... @@ -300,7 +299,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
300 299 brViewdata.then(
301 300 function (result) {
302 301 // debugger;
303   - $scope.BodyRegionData = result;
  302 + $rootScope.BodyRegionData = result;
304 303 $scope.isBodyRegionDataLoaded = true;
305 304 // alert('da_dat_brview= ' + result)
306 305  
... ... @@ -318,7 +317,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
318 317 function (result) {
319 318 //debugger;
320 319  
321   - $scope.BodyLayerData = result;
  320 + $rootScope.BodyLayerData = result;
322 321 $scope.isBodylayerdataLoaded = true;
323 322  
324 323 //load json for annotations
... ... @@ -472,13 +471,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
472 471 },
473 472 function (error) {
474 473 // handle errors here
475   - console.log(' $scope.BodyLayerData= ' + error.statusText);
  474 + console.log(' $rootScope.BodyLayerData= ' + error.statusText);
476 475 }
477 476 );
478 477 },
479 478 function (error) {
480 479 // handle errors here
481   - console.log(' $scope.BodyRegionData = ' + error.statusText);
  480 + console.log(' $rootScope.BodyRegionData = ' + error.statusText);
482 481 }
483 482 );
484 483  
... ... @@ -567,7 +566,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
567 566 }
568 567  
569 568 //set height of canvas div and left tool bar as per window size
570   - $scope.BodyRegionCordinatesData = []; // create an empty array
  569 + $rootScope.BodyRegionCordinatesData = []; // create an empty array
571 570  
572 571 $('#daBodyview').css('width', '100%');
573 572 $('#canvasDiv').css('height', $('#daImagePanel').outerHeight() - 104)
... ... @@ -577,12 +576,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
577 576  
578 577  
579 578 //calculate image coordinates and draw image
580   - var bodyRegionCoordinates = $scope.BodyRegionData.BodyRegionViews;
  579 + var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews;
581 580 // var viewOrientationId = String($scope.voId);
582 581  
583 582  
584 583 $scope.bodyRegionCoordinates = new jinqJs()
585   - .from($scope.BodyRegionData.BodyRegionViews.BodyRegionCordinates)
  584 + .from($rootScope.BodyRegionData.BodyRegionViews.BodyRegionCordinates)
586 585 .where('_ViewOrientationId == ' + viewOrientationId)
587 586 .select();
588 587  
... ... @@ -627,7 +626,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
627 626 //2.Draw mirror image
628 627 $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
629 628 // debugger;
630   - $scope.BodyRegionCordinatesData.push(
  629 + $rootScope.BodyRegionCordinatesData.push(
631 630 {
632 631 "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
633 632 "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'Yes'
... ... @@ -797,7 +796,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
797 796 }
798 797 // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
799 798 $('#canvasDiv').scrollTop(50)
800   - var abc = $scope.BodyRegionCordinatesData;
  799 + var abc = $rootScope.BodyRegionCordinatesData;
801 800 //debugger;
802 801 $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
803 802 // $('#spinner').css('visibility', 'hidden');
... ... @@ -860,7 +859,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
860 859  
861 860 $scope.GetImageSource = function (bodyRegionId) {
862 861 // debugger;
863   - var dataLength = $scope.BodyLayerData.Layers.DataLayer.length;
  862 + var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
864 863  
865 864 //set max for LayerNumber input
866 865 $scope.totalLayers = dataLength - 1;
... ... @@ -875,7 +874,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
875 874  
876 875  
877 876 var SelectedLayerData = [];
878   - SelectedLayerData = $scope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1];
  877 + SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1];
879 878 if ($scope.layerNumber == 0) {
880 879 for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) {
881 880  
... ... @@ -1217,7 +1216,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1217 1216  
1218 1217 imgCanvas.id = 'imageCanvas' + bodyRegionId;
1219 1218  
1220   -
  1219 +
1221 1220  
1222 1221 if (bodyRegionId == 3) {
1223 1222 //set z index of hip canavs to fix the issue caused by overlapping of arm canavs on hip canavs.
... ... @@ -1244,8 +1243,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1244 1243 }
1245 1244 }
1246 1245  
1247   -
1248   -
  1246 +
  1247 +
1249 1248 }
1250 1249  
1251 1250 imgCanvas.addEventListener('click', function (evt) {
... ... @@ -1631,6 +1630,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1631 1630  
1632 1631 $scope.HighlightBodyByTermList = function (TermList) {
1633 1632  
  1633 + $scope.highlightedBR = null;
  1634 + $scope.highlightedBR = [];
1634 1635  
1635 1636 //terminate previous running workers to create space for new workers
1636 1637 var workerCount = $scope.runningWorkers.length;
... ... @@ -1653,7 +1654,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1653 1654 $timeout(function () {
1654 1655 for (var x = 0; x < 9; x++) {
1655 1656 // console.log('$rootScope.MaskCanvasData.length= ' + n)
1656   - // debugger
  1657 + // debugger
1657 1658  
1658 1659 var bodyRegionId = $rootScope.MaskCanvasData[x].bodyRegionId;
1659 1660 var canvasId = $rootScope.MaskCanvasData[x].canvasId;
... ... @@ -1667,8 +1668,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1667 1668 coloredImageDataVar = $rootScope.coloredImageMRCanvasList[bodyRegionId];
1668 1669  
1669 1670 if ($rootScope.multiAnnotationIsON == true) {
  1671 + if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1].length == 0) {
1670 1672  
1671   - grayImageDataVar = $rootScope.grayImageMRDataListCurrent[bodyRegionId]
  1673 + grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
  1674 + }
  1675 + else
  1676 + grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId]
1672 1677 }
1673 1678 else
1674 1679 grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId];
... ... @@ -1685,13 +1690,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1685 1690  
1686 1691 // 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
1687 1692 //and then highlight the previously selected body regions at the time of normal mode.
1688   - if ($rootScope.grayImageDataListCurrent[bodyRegionId - 1] == null || $rootScope.grayImageDataListCurrent[bodyRegionId - 1].length > 0) {
  1693 + if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1].length == 0) {
1689 1694  
1690 1695 grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
1691 1696 }
1692 1697 else {
1693 1698 // for normal case means without interdepency button case.
1694   - grayImageDataVar = $rootScope.grayImageDataListCurrent[bodyRegionId - 1]
  1699 + grayImageDataVar = $rootScope.updatedGrayDataList[bodyRegionId - 1]
1695 1700 }
1696 1701 }
1697 1702 else
... ... @@ -1741,24 +1746,38 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1741 1746 //debugger;
1742 1747  
1743 1748 if (canvasId.match('_MR')) {
1744   - $rootScope.grayImageMRDataListCurrent[bodyRegionId] = updatedData;
  1749 + $rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData;
1745 1750  
1746 1751 //alert('HighlightBodyByTermList, is mutiAnnotation on= ' + $rootScope.multiAnnotationIsON);
1747 1752  
1748 1753 //$rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData;
1749 1754 }
1750 1755 else
1751   - $rootScope.grayImageDataListCurrent[bodyRegionId - 1] = updatedData;
1752   - //alert('HighlightBodyByTermList, is mutiAnnotation on= ' + $rootScope.multiAnnotationIsON);
  1756 + $rootScope.updatedGrayDataList[bodyRegionId - 1] = updatedData;
  1757 +
  1758 + $scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
  1759 +
  1760 + console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
  1761 +
  1762 + if ($scope.highlightedBR.length == 9) {
  1763 + //debugger;
  1764 + if ($scope.isHighlightBodysystem == true || $rootScope.isListManagerSelected == true)
  1765 +
  1766 + $rootScope.isLoading = false;
  1767 +
  1768 + $('#spinner').css('visibility', 'hidden');
1753 1769  
1754   - //$rootScope.updatedWhiteImageDataList[bodyRegionId - 1] = updatedData;
  1770 + $scope.isHighlightBodysystem = false;
  1771 + if ($rootScope.isListManagerSelected == true)
  1772 + $scope.aligneCanvasWithTerm();
  1773 + }
1755 1774  
1756 1775 };
1757 1776 worker.onerror = function (e) {
1758 1777 alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
1759 1778 };
1760 1779 }
1761   - }, 50)
  1780 + }, 100)
1762 1781 }
1763 1782  
1764 1783  
... ... @@ -1921,7 +1940,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1921 1940 var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight);
1922 1941 var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth);
1923 1942  
1924   - var BodyRegionDictionary = $scope.BodyRegionCordinatesData;
  1943 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
1925 1944  
1926 1945 $.each(BodyRegionDictionary, function (index, value) {
1927 1946 //debugger;
... ... @@ -1947,7 +1966,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1947 1966  
1948 1967 else {
1949 1968 // Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box.
1950   - var dataLength = $scope.BodyLayerData.Layers.DataLayer.length;
  1969 + var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
1951 1970 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
1952 1971 $('#txtlayerNumber').val(dataLength - 1);
1953 1972 $scope.currentLayerNumber = parseInt(dataLength - 1);
... ... @@ -2050,7 +2069,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2050 2069 var pointClicked = parseInt(x) + parseInt(y);
2051 2070 var Exists = $("#canvasDiv").find("div[id=" + pointClicked + "]").length;
2052 2071 // alert(pointClicked);
2053   - var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:10000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.i + "'></div><div data=" + $scope.i + " id=" + sub_id + " class='appendDragg' style='z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#000;text-align:left;font-size: 12px;background-color:#fff;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.i + " class='dynCross' src='/AIAHTML5/content/images/speeachBubbleClose.png'></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.i + "'></div></div>";
  2072 + var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:10000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.i + "'></div><div data=" + $scope.i + " id=" + sub_id + " class='appendDragg' style='z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#000;text-align:left;font-size: 12px;background-color:#fff;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.i + " class='dynCross' src='/AIA/content/images/speeachBubbleClose.png'></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.i + "'></div></div>";
2054 2073  
2055 2074 $("#canvasDiv").append(sppechBubbleHTML);
2056 2075  
... ... @@ -2955,7 +2974,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2955 2974 }
2956 2975  
2957 2976  
2958   - var BodyRegionDictionary = $scope.BodyRegionCordinatesData;
  2977 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
2959 2978  
2960 2979 $scope.IncludedBodyRegions = [];
2961 2980 ////debugger;
... ... @@ -3203,7 +3222,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3203 3222 else if (isLayerChanged) {
3204 3223 // debugger
3205 3224 //Dated:22-07-2016 Issue#5764:The layer number should not extend beyond its level through layer text box while using transparency box.
3206   - var dataLength = $scope.BodyLayerData.Layers.DataLayer.length;
  3225 + var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
3207 3226 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
3208 3227 $('#txtlayerNumber').val(dataLength - 1);
3209 3228 $scope.layerNumber = parseInt(dataLength - 1);
... ... @@ -3544,7 +3563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3544 3563 document.getElementById('canvasDiv').appendChild(tempCanvas);
3545 3564  
3546 3565  
3547   - var BodyRegionDictionary = $scope.BodyRegionCordinatesData;
  3566 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
3548 3567  
3549 3568 $scope.IncludedBodyRegions = [];
3550 3569 // $scope.layerNo = parseInt(document.getElementById(''))
... ... @@ -3602,7 +3621,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3602 3621 var y;
3603 3622 var isMirror;
3604 3623 var width;
3605   - var BodyRegionDictionary = $scope.BodyRegionCordinatesData;
  3624 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
3606 3625 $.each(BodyRegionDictionary, function (index, value) {
3607 3626  
3608 3627 var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
... ... @@ -3903,7 +3922,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3903 3922 ctx.putImageData(originalTransparencyData, 0, 0);
3904 3923  
3905 3924  
3906   - var BodyRegionDictionary = $scope.BodyRegionCordinatesData;
  3925 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
3907 3926  
3908 3927 $scope.IncludedBodyRegions = [];
3909 3928 var counter = 0;
... ... @@ -4117,8 +4136,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4117 4136 });
4118 4137 }
4119 4138  
4120   - $scope.enableHighlight = function ()
4121   - {
  4139 + $scope.enableHighlight = function () {
4122 4140  
4123 4141 if ($rootScope.isHighLight == true) {
4124 4142  
... ... @@ -4137,7 +4155,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4137 4155 //2.
4138 4156 $scope.CalculateImageCordinates($scope.viewOrientationId);
4139 4157  
4140   -
  4158 +
4141 4159 }
4142 4160  
4143 4161 //3.
... ... @@ -4171,8 +4189,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4171 4189  
4172 4190 //6.
4173 4191 $scope.CalculateImageCordinates($scope.viewOrientationId);
4174   -
4175   -
  4192 +
  4193 +
4176 4194 }
4177 4195  
4178 4196  
... ... @@ -4214,18 +4232,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4214 4232 }
4215 4233 }
4216 4234  
4217   - $scope.enableShowHideStructureBox = function ()
4218   - {
  4235 + $scope.enableShowHideStructureBox = function () {
4219 4236 $(".com").remove();
4220 4237 $('#dot').remove();
4221 4238 $('#sppeachBubble').remove();
4222 4239 }
4223 4240  
4224   - $scope.highLightBody = function () {
  4241 + $scope.highLightBody = function ()
  4242 + {
4225 4243  
4226 4244  
4227 4245 if ($rootScope.isHighLight == true) {
4228 4246  
  4247 + $scope.grayeddBR = [];
  4248 +
4229 4249 angular.forEach($scope.ColoredImageSRC, function (value, key) {
4230 4250 var id;
4231 4251 if (value.haveMirror == 'true') {
... ... @@ -4319,22 +4339,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4319 4339 }
4320 4340  
4321 4341 $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
4322   - })
  4342 +
  4343 +
  4344 + //if list manager is active and user selected any term then highlight that
  4345 + $scope.grayeddBR.push({ 'BRID': value.bodyRegionId })
  4346 +
  4347 + if ($scope.grayeddBR.length == 9) {
  4348 + if ($scope.isHighlightByListManager == true) {
  4349 + $timeout(function () {
  4350 +
  4351 + // $rootScope.isHighLight = false;
  4352 + //align
  4353 + // $scope.aligneCanvasWithTerm();
  4354 +
  4355 + $scope.HighlightBodyByTermList($scope.AllTerms)
  4356 + }, 800);
  4357 +
  4358 + }
  4359 + }
  4360 +
4323 4361  
4324 4362 if ($rootScope.isExtract == true) {
4325 4363 if ($rootScope.previousHighlightList.length > 0) {
4326   - //angular.forEach($rootScope.previousHighlightList, function (value, key)
4327   - //{
4328   - // $timeout(function () { $scope.HighlightBodyOnExtract(value) }, 50);
4329   -
4330   - // // to do
4331   - //});
  4364 +
4332 4365 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
4333 4366 }
4334 4367 }
4335 4368 else {
4336 4369 // 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
4337 4370 //and then highlight the previously selected body regions at the time of normal mode.
  4371 +
  4372 + if ($scope.grayeddBR.length == 9)
  4373 + {
  4374 + console.log('normal,extract,highlight and this time the length: ' + $scope.grayeddBR.length);
4338 4375 if ($rootScope.previousHighlightList.length > 0) {
4339 4376  
4340 4377 var multiTermList = [];
... ... @@ -4345,16 +4382,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4345 4382 multiTermList.push(TermList[i]);
4346 4383 }
4347 4384  
4348   - // to do
4349 4385 });
4350 4386  
4351   - $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 50);
  4387 +
  4388 + $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80);
  4389 + }
  4390 +
  4391 +
4352 4392 }
4353 4393 }
  4394 + })
4354 4395  
4355 4396 }
4356 4397 else {
4357   - //alert('came iside normal mode for extract');
  4398 + // This code will execute when user will select normal Mode but this time isHighlight will be false
4358 4399  
4359 4400 angular.forEach($scope.ColoredImageSRC, function (value, key) {
4360 4401 var id;
... ... @@ -4462,9 +4503,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4462 4503 }
4463 4504  
4464 4505  
4465   -
4466   -
4467   -
4468 4506 $scope.applyGrayMatrix = function (img, context_gray) {
4469 4507 var RED = 0.3086; // luminance contrast value for red
4470 4508 var GREEN = 0.694; // luminance contrast value for green
... ... @@ -4573,6 +4611,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4573 4611  
4574 4612  
4575 4613  
  4614 + //clsoe worker process
  4615 + $scope.$on('jsPanelCloseEvent', function (event, data) {
  4616 +
  4617 + console.log('terminate worker process')
  4618 + //terminate previous running workers to create space for new workers
  4619 + if ($scope.runningWorkers != null) {
  4620 + var workerCount = $scope.runningWorkers.length;
  4621 + if (workerCount > 0) {
  4622 + for (var i = workerCount - 1; i >= 0; i--) {
  4623 + var runningWorker = $scope.runningWorkers[i].workerName;
  4624 + runningWorker.terminate();
  4625 + $scope.runningWorkers.splice(i, 1);
  4626 + // workerCount--;
  4627 + }
  4628 + }
  4629 + }
  4630 +
  4631 + })
  4632 +
4576 4633 $scope.loadSelectedBodyView = function (currentBodyViewId) {
4577 4634  
4578 4635 //remove transaprency scale
... ... @@ -4591,7 +4648,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4591 4648 function (result) {
4592 4649 //debugger;
4593 4650  
4594   - $scope.BodyLayerData = result;
  4651 + $rootScope.BodyLayerData = result;
4595 4652 $scope.isBodylayerdataLoaded = true;
4596 4653  
4597 4654 //load json for annotations
... ... @@ -4618,7 +4675,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4618 4675  
4619 4676 function (error) {
4620 4677 // handle errors here
4621   - console.log(' $scope.BodyLayerData= ' + error.statusText);
  4678 + console.log(' $rootScope.BodyLayerData= ' + error.statusText);
4622 4679 }
4623 4680 );
4624 4681 }
... ... @@ -4864,19 +4921,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4864 4921 }
4865 4922  
4866 4923 $scope.HighlightBodysystem = function (event) {
  4924 +
4867 4925 var systemMatchedTermList = new jinqJs()
4868   - .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
4869   - .where('_SystemNumber == ' + event.currentTarget.id)
4870   - .select();
  4926 + .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
  4927 + .where('_SystemNumber == ' + event.currentTarget.id)
  4928 + .select();
4871 4929  
4872   - //color the body gray
4873   - $rootScope.isHighLight = true
4874   - $scope.highLightBody();
  4930 + if ($rootScope.isHighLight == false) {
  4931 + //color the body gray
  4932 + $rootScope.isHighLight = true
  4933 + $scope.highLightBody();
  4934 + }
4875 4935 //now highlight the selected body system in whole body
4876 4936  
4877 4937  
  4938 + //$rootScope.isLoading = true;
  4939 + $('#spinner').css('visibility', 'visible');
  4940 +
  4941 + $scope.isHighlightBodysystem = true;
  4942 +
4878 4943 $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);
4879   - $(".custom-tooltip").css("diisplay", "none");
  4944 +
4880 4945 }
4881 4946  
4882 4947 $scope.ShowSearch = function () {
... ...
400-SOURCECODE/AIAHTML5.Web/match-pixel-wp.js deleted
1   -๏ปฟpreviousGrayImageDataList = [];
2   -
3   -function updateGrayCanvasDataOnMatcghedLocation(termList, maskCanvasData, coloreImageData,
4   - grayImageData, grayImageMRDataList, bodyRegionId) {
5   - console.log('updateGrayCanvasDataOnMatcghedLocation= ' + bodyRegionId)
6   -
7   - debugger;
8   - var n = maskCanvasData.data.length;
9   - var maskData = maskCanvasData.data;
10   - for (var z = 0; z < termList.length; z++) {
11   -
12   - if (previousGrayImageDataList[parseInt(bodyRegionId - 1)] != null) {
13   - grayImageData = previousGrayImageDataList[parseInt(bodyRegionId - 1)];
14   -
15   - }
16   -
17   - var grayImageDataVar = grayImageData.data;
18   - var coloredImageDataVar = coloreImageData.data;
19   -
20   -
21   - for (var i = 0; i < n; i += 4) {
22   -
23   -
24   - var RED = maskData[i] - 9;
25   - var GREEN = maskData[i + 1] - 9;
26   - var BLUE = maskData[i + 2] - 9;
27   -
28   - var Red;
29   - var Green;
30   - var Blue;
31   - var zero = "0";
32   -
33   - if ((RED).toString().length != 2) {
34   - Red = zero.concat((RED).toString())
35   - }
36   - else {
37   - Red = (RED).toString()
38   - }
39   - if ((GREEN).toString().length != 2) {
40   - Green = zero.concat((GREEN).toString())
41   - }
42   - else {
43   - Green = (GREEN).toString()
44   -
45   - }
46   - if ((BLUE).toString().length != 2) {
47   - Blue = zero.concat((BLUE).toString())
48   - }
49   - else {
50   - Blue = (BLUE).toString()
51   -
52   - }
53   -
54   - var Icolor = (Red + Green + Blue);
55   - // alert('Icolor: ' + Icolor)
56   -
57   - if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) {
58   -
59   -
60   -
61   -
62   - // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i });
63   -
64   -
65   - // matched = true;
66   -
67   - var RED_coloredImage = coloredImageDataVar[i];
68   -
69   - grayImageDataVar[i] = RED_coloredImage;
70   -
71   -
72   - var GREEN_coloredImage = coloredImageDataVar[i + 1];
73   - grayImageDataVar[i + 1] = GREEN_coloredImage;
74   -
75   - var BLUE_coloredImage = coloredImageDataVar[i + 2];
76   - grayImageDataVar[i + 2] = BLUE_coloredImage;
77   -
78   -
79   - var ALPHA_coloredImage = coloredImageDataVar[i + 3];
80   - grayImageDataVar[i + 3] = ALPHA_coloredImage;
81   -
82   - }
83   -
84   -
85   - }
86   -
87   - previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData;
88   -
89   - // if (matched == true) {
90   -
91   - // }
92   -
93   - }
94   - self.postMessage({
95   - 'bodyRegionId': bodyRegionId,
96   - 'value': grayImageData,
97   - 'canvasId': canvasId
98   -
99   -
100   - });
101   -}
102   -
103   -self.onmessage = function (e) {
104   - console.log('shd')
105   - updateGrayCanvasDataOnMatcghedLocation(e.data.termList, e.data.maskCanvasData, e.data.coloreImageData,
106   - e.data.grayImageData, e.data.grayImageMRDataList, e.data.bodyRegionId, e.data.canvasId);
107   -
108   -}
400-SOURCECODE/AIAHTML5.Web/term-number-wp.js
... ... @@ -4,10 +4,11 @@ var abc = &#39;hello&#39;;
4 4 previousGrayImageDataList = [];
5 5 getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) {
6 6 console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
  7 + console.log(grayImageData);
7 8 var matchedRGBLocationInBodyRegion = [];
8 9 var matched;
9 10  
10   - console.log(grayImageData)
  11 + // console.log(grayImageData)
11 12 var n = maskCanvasData.data.length;
12 13 var maskData = maskCanvasData.data;
13 14 for (var z = 0; z < termList.length; z++) {
... ... @@ -17,94 +18,95 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo
17 18  
18 19 }
19 20  
20   - if (grayImageData != null) {
21   - var grayImageDataVar = grayImageData.data;
22   - var coloredImageDataVar = coloredImageData.data;
  21 +
  22 + var grayImageDataVar = grayImageData.data;
  23 + var coloredImageDataVar = coloredImageData.data;
23 24  
24   - for (var i = 0; i < n; i += 4) {
  25 + for (var i = 0; i < n; i += 4) {
25 26  
26 27  
27   - var RED = maskData[i] - 9;
28   - var GREEN = maskData[i + 1] - 9;
29   - var BLUE = maskData[i + 2] - 9;
  28 + var RED = maskData[i] - 9;
  29 + var GREEN = maskData[i + 1] - 9;
  30 + var BLUE = maskData[i + 2] - 9;
30 31  
31   - var Red;
32   - var Green;
33   - var Blue;
34   - var zero = "0";
  32 + var Red;
  33 + var Green;
  34 + var Blue;
  35 + var zero = "0";
35 36  
36   - if ((RED).toString().length != 2) {
37   - Red = zero.concat((RED).toString())
38   - }
39   - else {
40   - Red = (RED).toString()
41   - }
42   - if ((GREEN).toString().length != 2) {
43   - Green = zero.concat((GREEN).toString())
44   - }
45   - else {
46   - Green = (GREEN).toString()
47   -
48   - }
49   - if ((BLUE).toString().length != 2) {
50   - Blue = zero.concat((BLUE).toString())
51   - }
52   - else {
53   - Blue = (BLUE).toString()
54   -
55   - }
  37 + if ((RED).toString().length != 2) {
  38 + Red = zero.concat((RED).toString())
  39 + }
  40 + else {
  41 + Red = (RED).toString()
  42 + }
  43 + if ((GREEN).toString().length != 2) {
  44 + Green = zero.concat((GREEN).toString())
  45 + }
  46 + else {
  47 + Green = (GREEN).toString()
56 48  
57   - var Icolor = (Red + Green + Blue);
58   - // alert('Icolor: ' + Icolor)
  49 + }
  50 + if ((BLUE).toString().length != 2) {
  51 + Blue = zero.concat((BLUE).toString())
  52 + }
  53 + else {
  54 + Blue = (BLUE).toString()
59 55  
60   - if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) {
  56 + }
61 57  
62   - // debugger;
  58 + var Icolor = (Red + Green + Blue);
  59 + // alert('Icolor: ' + Icolor)
63 60  
  61 + if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) {
64 62  
65   - // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i });
  63 + // debugger;
  64 + // console.log('matched term= ' + termList[z]._TermNumber)
66 65  
67 66  
68   - // matched = true;
  67 + // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i });
69 68  
70   - var RED_coloredImage = coloredImageDataVar[i];
71 69  
72   - grayImageDataVar[i] = RED_coloredImage;
  70 + // matched = true;
73 71  
  72 + var RED_coloredImage = coloredImageDataVar[i];
74 73  
75   - var GREEN_coloredImage = coloredImageDataVar[i + 1];
76   - grayImageDataVar[i + 1] = GREEN_coloredImage;
  74 + grayImageDataVar[i] = RED_coloredImage;
77 75  
78   - var BLUE_coloredImage = coloredImageDataVar[i + 2];
79   - grayImageDataVar[i + 2] = BLUE_coloredImage;
80 76  
  77 + var GREEN_coloredImage = coloredImageDataVar[i + 1];
  78 + grayImageDataVar[i + 1] = GREEN_coloredImage;
81 79  
82   - var ALPHA_coloredImage = coloredImageDataVar[i + 3];
83   - grayImageDataVar[i + 3] = ALPHA_coloredImage;
  80 + var BLUE_coloredImage = coloredImageDataVar[i + 2];
  81 + grayImageDataVar[i + 2] = BLUE_coloredImage;
84 82  
85   - }
86 83  
  84 + var ALPHA_coloredImage = coloredImageDataVar[i + 3];
  85 + grayImageDataVar[i + 3] = ALPHA_coloredImage;
87 86  
88 87 }
89   - // debugger;
90   - previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData;
91   -
92   - // if (matched == true) {
93 88  
94   - // }
95 89  
96 90 }
97   - self.postMessage({
98   - 'bodyRegionId': bodyRegionId,
99   - 'value': grayImageData,
100   - 'canvasId': canvasId
  91 + // debugger;
  92 + previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData;
  93 +
  94 + // if (matched == true) {
  95 +
  96 + // }
101 97  
102   - });
103 98 }
  99 + self.postMessage({
  100 + 'bodyRegionId': bodyRegionId,
  101 + 'value': grayImageData,
  102 + 'canvasId': canvasId
  103 +
  104 + });
  105 +
104 106 }
105 107  
106 108 self.onmessage = function (e) {
107 109 getLocationForMatchedTermsInWholeBody(e.data.termList, e.data.maskCanvasData, e.data.coloredImageData,
108 110 e.data.grayImageData, e.data.bodyRegionId, e.data.canvasId);
109 111  
110   -}
  112 +}
111 113 \ No newline at end of file
... ...