Commit 65d737e0e2a37eccc540a21c012e9e57cacffadb

Authored by Nikita Kulshreshtha
1 parent 9e21c12e

started adding highlight code in worker process

400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
... ... @@ -73,6 +73,7 @@
73 73 <Content Include="app\views\da\da-view.html" />
74 74 <Content Include="app\views\LabExerc\LabExerc-view.html" />
75 75 <Content Include="app\widget\MainMenu.html" />
  76 + <Content Include="term-wp.js" />
76 77 <Content Include="content\css\main.css" />
77 78 <Content Include="content\data\json\da\body-views\1\da_dat_tm_sg_1.json" />
78 79 <Content Include="content\data\json\da\body-views\10\da_dat_body_system_term_10.json" />
... ... @@ -42898,6 +42899,7 @@
42898 42899 <Content Include="libs\videogular\vg-controls.min.js" />
42899 42900 <Content Include="libs\videogular\videogular.js" />
42900 42901 <Content Include="libs\videogular\videogular.min.js" />
  42902 + <Content Include="libs\worker.js" />
42901 42903 <Content Include="login.html" />
42902 42904 <Content Include="app\widget\MainView.html" />
42903 42905 <Content Include="themes\default\css\bootstrap\3.3.6\bootstrap-theme.css" />
... ... @@ -42993,6 +42995,7 @@
42993 42995 </Content>
42994 42996 </ItemGroup>
42995 42997 <ItemGroup>
  42998 + <Folder Include="app\worker-process\" />
42996 42999 <Folder Include="content\data\json\ca\" />
42997 43000 <Folder Include="content\images\ca\" />
42998 43001 <Folder Include="content\images\DA\75\body-views\4\layers\329\6\" />
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -44,7 +44,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
44 44 $scope.previousGrayCanvas;
45 45  
46 46 $scope.previousSelectedTermList = [];
47   -
  47 + $scope.MaskCanvasData = [];
48 48  
49 49 // This variable is used for unhighlight previously highlighted body portion, if multiAnnotation is false.
50 50 $scope.machedIcolorInBodyRegion = [];
... ... @@ -478,7 +478,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
478 478 //}
479 479  
480 480 $scope.ColoredImageSRC = [];
481   -
  481 +
482 482  
483 483 angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
484 484  
... ... @@ -1058,9 +1058,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1058 1058 };
1059 1059  
1060 1060 if (document.getElementById('canvasDiv') != null)
1061   - document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
  1061 + document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
1062 1062  
  1063 + //push mask data
  1064 + var maskImgData = context.getImageData(0, 0, w, h);
  1065 + $scope.MaskCanvasData.push(
  1066 + {
  1067 + "bodyRegionId": bodyRegionId,
  1068 + "canvasId": FlipedImgCanvas.id,
  1069 + "maskData": maskImgData,
1063 1070  
  1071 + }
  1072 + );
1064 1073 }
1065 1074  
1066 1075 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
... ... @@ -1151,13 +1160,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1151 1160 var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
1152 1161  
1153 1162 if ($rootScope.isHighLight) {
1154   -
1155   - if ($scope.machedIcolorInBodyRegion.length > 0)
1156   - {
1157   - if ($scope.multiAnnotationIsON == false)
1158   - {
1159   - for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++)
1160   - {
  1163 +
  1164 + if ($scope.machedIcolorInBodyRegion.length > 0) {
  1165 + if ($scope.multiAnnotationIsON == false) {
  1166 + for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
1161 1167 var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
1162 1168  
1163 1169 var grayCanvasID = 'imageCanvas' + bodyRegionId;
... ... @@ -1286,7 +1292,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1286 1292 if ($('#sppeachBubble').length > 0) {
1287 1293 $('#sppeachBubble').remove();
1288 1294 }
1289   -
  1295 +
1290 1296  
1291 1297  
1292 1298 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
... ... @@ -1316,13 +1322,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1316 1322 context.drawImage(img, 0, 0);
1317 1323 };
1318 1324  
1319   - if (document.getElementById('canvasDiv')!=null)
1320   - document.getElementById('canvasDiv').appendChild(imgCanvas);
  1325 + if (document.getElementById('canvasDiv') != null)
  1326 + document.getElementById('canvasDiv').appendChild(imgCanvas);
  1327 +
  1328 + //push mask data
  1329 + var maskImgData = context.getImageData(0, 0, w, h);
  1330 + $scope.MaskCanvasData.push(
  1331 + {
  1332 + "bodyRegionId": bodyRegionId,
  1333 + "canvasId": imgCanvas.id,
  1334 + "maskData": maskImgData,
  1335 +
  1336 + }
  1337 + );
1321 1338  
1322 1339 }
1323 1340  
1324   - $scope.highLightBodyBasedOnIcolor = function (RGBColor)
1325   - {
  1341 + $scope.highLightBodyBasedOnIcolor = function (RGBColor) {
1326 1342  
1327 1343 //2. Find Actul Term No Based on Icolor.
1328 1344 var ActualTermNo = $scope.getActualTermNumber(RGBColor);
... ... @@ -1336,34 +1352,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1336 1352 $scope.machedTermNoLocation = [];
1337 1353 console.log(' TermList.length= ' + TermList.length)
1338 1354  
1339   - //for (var i = 0; i < TermList.length; i++) {
1340   -
1341   - // $timeout(callHight(TermList[i]._TermNumber), 5)
1342   -
1343   -
1344   - //}
1345   -
1346 1355 var worker = new Worker('term-wp.js');
1347 1356  
  1357 + for (var i = 0; i < TermList.length; i++) {
  1358 +
  1359 + //start the worker
  1360 + worker.postMessage({
  1361 + 'termNumber': TermList[i],
  1362 + 'maskData': $scope.MaskCanvasData
  1363 + });
  1364 + }
1348 1365 worker.onmessage = function (e) {
1349   - alert(e.data.PiValue);
  1366 + alert(e.data.PiValue);
1350 1367 };
1351 1368 worker.onerror = function (e) {
1352 1369 alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
1353 1370 };
1354   -
1355   - //start the worker
1356   - worker.postMessage({
1357   -
1358   - 'value':100000
1359   - });
1360 1371 }
1361 1372  
1362 1373  
1363 1374 function callHight(termNumber) {
1364 1375  
1365 1376 console.log('timeout function call. termNumber = ' + termNumber + ' -time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
1366   - // var termNumber = parseInt(TermList[i]._TermNumber);
  1377 + // var termNumber = parseInt(TermList[i]._TermNumber);
1367 1378  
1368 1379 //Match Term No List in each bodyRegion
1369 1380 $timeout($scope.getLocationsForMatchedTermsInWholeBody(termNumber, 1), 5);
... ... @@ -1496,7 +1507,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1496 1507 // // alert('Icolor: ' + Icolor)
1497 1508  
1498 1509 // if (parseInt(termNo) == parseInt(Icolor)) {
1499   -
  1510 +
1500 1511 // counter++;
1501 1512 // var have = $scope.machedIcolorInBodyRegion.indexOf(bodyRegionId);
1502 1513  
... ... @@ -1548,169 +1559,169 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1548 1559 // debugger;
1549 1560 //console.log('bodyRegionId = ' + bodyRegionId + '-time: ' + new Date().getTime());
1550 1561 console.log('bodyRegionId = ' + bodyRegionId + '-time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
1551   - var bodyRegionIdDetails = new jinqJs()
1552   - .from($scope.ColoredImageSRC)
1553   - .where('bodyRegionId == ' + bodyRegionId)
1554   - .select();
  1562 + var bodyRegionIdDetails = new jinqJs()
  1563 + .from($scope.ColoredImageSRC)
  1564 + .where('bodyRegionId == ' + bodyRegionId)
  1565 + .select();
1555 1566  
1556 1567 var scaledWidth = bodyRegionIdDetails[0].Width;
1557 1568 var scaledHeight = bodyRegionIdDetails[0].Height;
1558   - //var maskImg = $scope.ColoredImageSRC[x].SRC;
  1569 + //var maskImg = $scope.ColoredImageSRC[x].SRC;
1559 1570  
1560 1571  
1561 1572 var coloredImg = bodyRegionIdDetails[0].SRC;
1562 1573  
1563   - var maskImg = $scope.GetMaskImageSource(coloredImg);
  1574 + var maskImg = $scope.GetMaskImageSource(coloredImg);
1564 1575  
1565 1576  
1566   - var scledX = bodyRegionIdDetails[0].x;
1567   - var scledY = bodyRegionIdDetails[0].y;
  1577 + var scledX = bodyRegionIdDetails[0].x;
  1578 + var scledY = bodyRegionIdDetails[0].y;
1568 1579  
1569 1580  
1570   - // 1. get mask canvas for this body region.
1571   - var maskCanvasID;
1572   - if (bodyRegionIdDetails[0].haveMirror == 'true') {
1573   - maskCanvasID = 'imageCanvas' + bodyRegionId + '_MR_mci';
1574   - }
1575   - else {
1576   - maskCanvasID = 'imageCanvas' + bodyRegionId + '_mci';
  1581 + // 1. get mask canvas for this body region.
  1582 + var maskCanvasID;
  1583 + if (bodyRegionIdDetails[0].haveMirror == 'true') {
  1584 + maskCanvasID = 'imageCanvas' + bodyRegionId + '_MR_mci';
  1585 + }
  1586 + else {
  1587 + maskCanvasID = 'imageCanvas' + bodyRegionId + '_mci';
1577 1588  
1578   - }
1579   - var maskCanvas = document.getElementById(maskCanvasID);
1580   - var maskCanvasContext = maskCanvas.getContext("2d");
1581   - var maskImgData = maskCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
  1589 + }
  1590 + var maskCanvas = document.getElementById(maskCanvasID);
  1591 + var maskCanvasContext = maskCanvas.getContext("2d");
  1592 + var maskImgData = maskCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
1582 1593  
1583   - // 2. get coloured canvas for this body region.
  1594 + // 2. get coloured canvas for this body region.
1584 1595  
1585 1596  
1586   - var coloredImageDataVar;
1587   - var coloredImageDataMRVar
  1597 + var coloredImageDataVar;
  1598 + var coloredImageDataMRVar
1588 1599  
1589   - if (bodyRegionIdDetails[0].haveMirror == 'true') {
  1600 + if (bodyRegionIdDetails[0].haveMirror == 'true') {
1590 1601  
1591   - coloredImageDataVar = $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)];
1592   - }
1593   - else {
1594   - coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)];
1595   - }
1596   - var grayImageDataVar;
1597   - var grayCanvas;
1598   - if (bodyRegionIdDetails[0].haveMirror == 'true') {
1599   -
1600   - //// 3. get mask canvas for this body region._MR
1601   - var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
1602   - grayCanvas = document.getElementById(grayCanvasID);
1603   - var grayCanvasContext = grayCanvas.getContext("2d");
1604   - var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
1605   - grayImageDataVar = grayImageData.data;
1606   - }
  1602 + coloredImageDataVar = $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)];
  1603 + }
  1604 + else {
  1605 + coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)];
  1606 + }
  1607 + var grayImageDataVar;
  1608 + var grayCanvas;
  1609 + if (bodyRegionIdDetails[0].haveMirror == 'true') {
1607 1610  
1608   - else {
1609   - var grayCanvasID = 'imageCanvas' + bodyRegionId;
1610   - grayCanvas = document.getElementById(grayCanvasID);
1611   - var grayCanvasContext = grayCanvas.getContext("2d");
1612   - var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
1613   - grayImageDataVar = grayImageData.data;
1614   - }
  1611 + //// 3. get mask canvas for this body region._MR
  1612 + var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
  1613 + grayCanvas = document.getElementById(grayCanvasID);
  1614 + var grayCanvasContext = grayCanvas.getContext("2d");
  1615 + var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
  1616 + grayImageDataVar = grayImageData.data;
  1617 + }
1615 1618  
1616   - var coloredImageDataVarMR;
1617   - var coloredImageDataMR
  1619 + else {
  1620 + var grayCanvasID = 'imageCanvas' + bodyRegionId;
  1621 + grayCanvas = document.getElementById(grayCanvasID);
  1622 + var grayCanvasContext = grayCanvas.getContext("2d");
  1623 + var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
  1624 + grayImageDataVar = grayImageData.data;
  1625 + }
1618 1626  
  1627 + var coloredImageDataVarMR;
  1628 + var coloredImageDataMR
1619 1629  
1620   - var counter = 0;
1621 1630  
1622   - var imageDataVar = maskImgData.data;
  1631 + var counter = 0;
1623 1632  
1624   - // var previousBRID;
  1633 + var imageDataVar = maskImgData.data;
1625 1634  
1626   - var counter = 0;
  1635 + // var previousBRID;
1627 1636  
  1637 + var counter = 0;
1628 1638  
1629   - var n = maskImgData.data.length;
1630 1639  
1631   - for (var i = 0; i < n; i += 4) {
  1640 + var n = maskImgData.data.length;
1632 1641  
  1642 + for (var i = 0; i < n; i += 4) {
1633 1643  
1634   - var RED = imageDataVar[i] - 9;
1635   - var GREEN = imageDataVar[i + 1] - 9;
1636   - var BLUE = imageDataVar[i + 2] - 9;
1637 1644  
1638   - var Red;
1639   - var Green;
1640   - var Blue;
1641   - var zero = "0";
  1645 + var RED = imageDataVar[i] - 9;
  1646 + var GREEN = imageDataVar[i + 1] - 9;
  1647 + var BLUE = imageDataVar[i + 2] - 9;
1642 1648  
1643   - if ((RED).toString().length != 2) {
1644   - Red = zero.concat((RED).toString())
1645   - }
1646   - else {
1647   - Red = (RED).toString()
1648   - }
1649   - if ((GREEN).toString().length != 2) {
1650   - Green = zero.concat((GREEN).toString())
1651   - }
1652   - else {
1653   - Green = (GREEN).toString()
  1649 + var Red;
  1650 + var Green;
  1651 + var Blue;
  1652 + var zero = "0";
1654 1653  
1655   - }
1656   - if ((BLUE).toString().length != 2) {
1657   - Blue = zero.concat((BLUE).toString())
1658   - }
1659   - else {
1660   - Blue = (BLUE).toString()
  1654 + if ((RED).toString().length != 2) {
  1655 + Red = zero.concat((RED).toString())
  1656 + }
  1657 + else {
  1658 + Red = (RED).toString()
  1659 + }
  1660 + if ((GREEN).toString().length != 2) {
  1661 + Green = zero.concat((GREEN).toString())
  1662 + }
  1663 + else {
  1664 + Green = (GREEN).toString()
1661 1665  
1662   - }
  1666 + }
  1667 + if ((BLUE).toString().length != 2) {
  1668 + Blue = zero.concat((BLUE).toString())
  1669 + }
  1670 + else {
  1671 + Blue = (BLUE).toString()
1663 1672  
1664   - var Icolor = (Red + Green + Blue);
1665   - // alert('Icolor: ' + Icolor)
  1673 + }
1666 1674  
1667   - if (parseInt(termNo) == parseInt(Icolor)) {
  1675 + var Icolor = (Red + Green + Blue);
  1676 + // alert('Icolor: ' + Icolor)
1668 1677  
1669   - counter++;
1670   - var have = $scope.machedIcolorInBodyRegion.indexOf(bodyRegionId);
  1678 + if (parseInt(termNo) == parseInt(Icolor)) {
1671 1679  
  1680 + counter++;
  1681 + var have = $scope.machedIcolorInBodyRegion.indexOf(bodyRegionId);
1672 1682  
1673   - if (have == -1) {
1674   - $scope.machedIcolorInBodyRegion.push(bodyRegionId);
1675   - }
1676   - else {
1677 1683  
1678   - }
  1684 + if (have == -1) {
  1685 + $scope.machedIcolorInBodyRegion.push(bodyRegionId);
  1686 + }
  1687 + else {
1679 1688  
  1689 + }
1680 1690  
1681   - //previousGrayColoredData = i;
1682   - if (coloredImageDataVar != null) {
1683 1691  
  1692 + //previousGrayColoredData = i;
  1693 + if (coloredImageDataVar != null) {
1684 1694  
1685   - var RED_coloredImage = coloredImageDataVar[i];
1686 1695  
1687   - grayImageDataVar[i] = RED_coloredImage;
  1696 + var RED_coloredImage = coloredImageDataVar[i];
1688 1697  
  1698 + grayImageDataVar[i] = RED_coloredImage;
1689 1699  
1690   - var GREEN_coloredImage = coloredImageDataVar[i + 1];
1691   - grayImageDataVar[i + 1] = GREEN_coloredImage;
1692 1700  
1693   - var BLUE_coloredImage = coloredImageDataVar[i + 2];
1694   - grayImageDataVar[i + 2] = BLUE_coloredImage;
  1701 + var GREEN_coloredImage = coloredImageDataVar[i + 1];
  1702 + grayImageDataVar[i + 1] = GREEN_coloredImage;
1695 1703  
  1704 + var BLUE_coloredImage = coloredImageDataVar[i + 2];
  1705 + grayImageDataVar[i + 2] = BLUE_coloredImage;
1696 1706  
1697   - var ALPHA_coloredImage = coloredImageDataVar[i + 3];
1698   - grayImageDataVar[i + 3] = ALPHA_coloredImage;
1699 1707  
  1708 + var ALPHA_coloredImage = coloredImageDataVar[i + 3];
  1709 + grayImageDataVar[i + 3] = ALPHA_coloredImage;
1700 1710  
1701   - }
1702 1711  
1703   - }
  1712 + }
1704 1713  
  1714 + }
1705 1715  
1706   - }
1707 1716  
1708   - grayCanvasContext.putImageData(grayImageData, 0, 0);
1709   -
1710 1717 }
1711 1718  
  1719 + grayCanvasContext.putImageData(grayImageData, 0, 0);
  1720 +
  1721 + }
  1722 +
  1723 +
1712 1724  
1713   -
1714 1725  
1715 1726 $scope.GetRGBColor = function (maskCanvasContext, actulalX, actualY, x, y) {
1716 1727  
... ... @@ -1833,8 +1844,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1833 1844 tempCanvas.style.left = 200 + 'px';
1834 1845 tempCanvas.style.backgroundColor = "transparent";
1835 1846 tempCanvas.style.visibility = 'hidden';
1836   - if (document.getElementById('canvasDiv')!=null)
1837   - document.getElementById('canvasDiv').appendChild(tempCanvas);
  1847 + if (document.getElementById('canvasDiv') != null)
  1848 + document.getElementById('canvasDiv').appendChild(tempCanvas);
1838 1849  
1839 1850 // //debugger;
1840 1851  
... ... @@ -1917,15 +1928,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1917 1928 $scope.DisableProgressBar = function () {
1918 1929  
1919 1930 // alert('Disabled wait cursor is called');
1920   -
1921   -
  1931 +
  1932 +
1922 1933 if ($rootScope.isHighLight) {
1923 1934 //alert('isHighlight: ' + $scope.isHighLight);
1924 1935  
1925 1936 $('#btnHighLight').removeClass('btn btn-black');
1926 1937 $('#btnHighLight').addClass('btn-primary');
1927 1938  
1928   - $scope.highLightBody() ;
  1939 + $scope.highLightBody();
1929 1940  
1930 1941  
1931 1942  
... ... @@ -2013,7 +2024,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2013 2024  
2014 2025 $(".com").css("display", "none");
2015 2026 $("#bord").css({ "width": "0px", "display": "none" });
2016   -
  2027 +
2017 2028 $('<div id="dot" style="position:absolute;height:15px;width:35px;display:none;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
2018 2029 + '<div id="sppeachBubble" style="height:auto!important;z-index:10000;margin-left:25px;border:1px solid #000;display:none;padding:5px 10px;width:200px;position:absolute;color:#000;text-align:left;font-size:12px;background-color:#fff;font-weight:bold;"><span>' + text + '</span>'
2019 2030 + '<span style="position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;">'
... ... @@ -2280,8 +2291,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2280 2291 tempCanvas.style.backgroundColor = "transparent";
2281 2292 tempCanvas.style.visibility = 'hidden';
2282 2293 tempCanvas.style.border = "black 1px solid";
2283   - if( document.getElementById('canvasDiv')!=null)
2284   - document.getElementById('canvasDiv').appendChild(tempCanvas);
  2294 + if (document.getElementById('canvasDiv') != null)
  2295 + document.getElementById('canvasDiv').appendChild(tempCanvas);
2285 2296 }
2286 2297  
2287 2298  
... ... @@ -2316,7 +2327,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2316 2327 transparencyCanvas.style.backgroundColor = "transparent";
2317 2328 // transparencyCanvas.style.visibility = 'hidden';
2318 2329 if (document.getElementById('canvasDiv') != null)
2319   - document.getElementById('canvasDiv').appendChild(transparencyCanvas);
  2330 + document.getElementById('canvasDiv').appendChild(transparencyCanvas);
2320 2331 $scope.transparencyChangeCounter = 0;
2321 2332  
2322 2333 $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeCanvas(); }, start: function (event, ui) { clearTransCanvas(); } });
... ... @@ -2593,7 +2604,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2593 2604 //transparencyTempCanvas.style.visibility = 'visible';
2594 2605 // transparencyCanvas.style.zIndex = 4000;
2595 2606 if (document.getElementById('canvasDiv') != null)
2596   - document.getElementById('canvasDiv').appendChild(transparencyTempCanvas);
  2607 + document.getElementById('canvasDiv').appendChild(transparencyTempCanvas);
2597 2608  
2598 2609 //create temp mask canvas
2599 2610 transparencyTempcanavsMask.height = Height;
... ... @@ -2605,7 +2616,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2605 2616 //transparencyTempCanvas.style.visibility = 'visible';
2606 2617 // transparencyCanvas.style.border = "black 1px solid";
2607 2618 if (document.getElementById('canvasDiv') != null)
2608   - document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask);
  2619 + document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask);
2609 2620  
2610 2621  
2611 2622 var tempImg = new Image();
... ... @@ -2837,7 +2848,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2837 2848 transparencyCanvas.style.top = tCanvas.style.top//y + "px";
2838 2849 transparencyCanvas.style.border = "black 1px solid";
2839 2850 if (document.getElementById('canvasDiv') != null)
2840   - document.getElementById('canvasDiv').appendChild(transparencyCanvas);
  2851 + document.getElementById('canvasDiv').appendChild(transparencyCanvas);
2841 2852  
2842 2853 $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeCanvas(); }, start: function (event, ui) { clearTransCanvas(); } });
2843 2854  
... ... @@ -2863,7 +2874,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2863 2874 // tempCanvas.style.border = "black 1px solid";
2864 2875  
2865 2876 if (document.getElementById('canvasDiv') != null)
2866   - document.getElementById('canvasDiv').appendChild(tempCanvas);
  2877 + document.getElementById('canvasDiv').appendChild(tempCanvas);
2867 2878  
2868 2879  
2869 2880 var BodyRegionDictionary = $scope.BodyRegionCordinatesData;
... ... @@ -2976,7 +2987,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2976 2987 transparencyTempcanavsMask.style.visibility = 'hidden';
2977 2988  
2978 2989 if (document.getElementById('canvasDiv') != null)
2979   - document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask);
  2990 + document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask);
2980 2991  
2981 2992 var tranparencyImgSrc = $scope.GetImageSource(clickedBodyRegion);
2982 2993 var tempMaskImg = new Image();
... ... @@ -3088,7 +3099,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3088 3099 $scope.getAnnotationForTransparencyBox = function (pixelData, pixelDataTrans, scope) {
3089 3100  
3090 3101  
3091   -
  3102 +
3092 3103 pixelData.data[0] = pixelData.data[0] - 9;
3093 3104 pixelData.data[1] = pixelData.data[1] - 9;
3094 3105 pixelData.data[2] = pixelData.data[2] - 9;
... ... @@ -3502,29 +3513,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3502 3513 $timeout(function () { imageCanvas.style.visibility = 'visible' }, 250);
3503 3514 })
3504 3515  
3505   -
3506   -
  3516 +
  3517 +
3507 3518 // alert('length: '+ $scope.coloredImageCanvasList.length);
3508 3519  
3509   -
3510 3520  
3511   - //alert('length: ' + $scope.previousSelectedTermList.length);
3512 3521  
3513   - if ($scope.previousSelectedTermList.length > 0) {
  3522 + //alert('length: ' + $scope.previousSelectedTermList.length);
  3523 +
  3524 + if ($scope.previousSelectedTermList.length > 0) {
3514 3525  
3515   - //alert('previousSelectedTermList length: ' + $scope.previousSelectedTermList.length);
  3526 + //alert('previousSelectedTermList length: ' + $scope.previousSelectedTermList.length);
3516 3527  
3517   - for (var i = 0; i < $scope.previousSelectedTermList.length; i++) {
3518   -
3519   - $scope.highLightBodyBasedOnIcolor($scope.previousSelectedTermList[i]);
  3528 + for (var i = 0; i < $scope.previousSelectedTermList.length; i++) {
3520 3529  
  3530 + $scope.highLightBodyBasedOnIcolor($scope.previousSelectedTermList[i]);
  3531 +
  3532 + }
3521 3533 }
3522   - }
3523 3534  
  3535 + }
3524 3536 }
3525   -}
3526 3537  
3527   -
  3538 +
3528 3539  
3529 3540 $scope.applyGrayMatrix = function (img, context_gray) {
3530 3541 var DAData = new BitmapData(img.width, img.height);
... ... @@ -3734,7 +3745,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3734 3745 paintCanvas.addEventListener('mouseup', OnPaintCanvasMouseUp, false)
3735 3746  
3736 3747 if (document.getElementById('canvasDiv') != null)
3737   - document.getElementById('canvasDiv').appendChild(paintCanvas);
  3748 + document.getElementById('canvasDiv').appendChild(paintCanvas);
3738 3749  
3739 3750 $scope.paintCanvasContext = document.getElementById('paintCanvas').getContext('2d');
3740 3751 }
... ... @@ -3793,7 +3804,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3793 3804 function OnPaintCanvasMouseMove(event) {
3794 3805  
3795 3806 if ($rootScope.isDrawingToolSelected == true) {
3796   - // console.log('moving');
  3807 + // console.log('moving');
3797 3808 //var mousePos = $scope.getMousePos(event);
3798 3809 //var canvasDiv = document.getElementById('canvasDiv');
3799 3810 //var verticalScrollPosition = canvasDiv.scrollTop;
... ... @@ -3861,9 +3872,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3861 3872 .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
3862 3873 .where('_SystemNumber == ' + event.currentTarget.id)
3863 3874 .select();
3864   -
  3875 +
3865 3876 //color the body gray
3866   - $rootScope.isHighLight =true
  3877 + $rootScope.isHighLight = true
3867 3878 $scope.highLightBody();
3868 3879 //now highlight the selected body system in whole body
3869 3880  
... ...
400-SOURCECODE/AIAHTML5.Web/term-wp.js
... ... @@ -15,9 +15,9 @@ function CalculatePi(loop) {
15 15 Pi = Pi + (4 / n) - (4 / (n + 2));
16 16 n = n + 4;
17 17 }
18   - self.postMessage({ 'PiValue': Pi });
  18 + self.postMessage({ 'PiValue': loop });
19 19 }
20 20  
21 21 self.onmessage = function (e) {
22   - CalculatePi(e.data.value);
  22 + CalculatePi(e.data.termNumber);
23 23 }
24 24 \ No newline at end of file
... ...