Commit 6b4aa0ed65a5ebd1c9ca250411f70ec0279c4155
1 parent
afb328d8
modifications
Showing
2 changed files
with
8 additions
and
231 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1376,20 +1376,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1376 | 1376 | //4. |
1377 | 1377 | |
1378 | 1378 | $scope.machedTermNoLocation = []; |
1379 | - // console.log(' TermList.length= ' + TermList.length) | |
1380 | - | |
1381 | - | |
1382 | - | |
1383 | - //var dataForthisBR = new jinqJs() | |
1384 | - // .from($scope.ColoredCanvasData) | |
1385 | - // .where('bodyRegionId == ' + 1) | |
1386 | - // .select(); | |
1387 | - //var coloredImageData = dataForthisBR.coloredImageData; | |
1388 | - | |
1379 | + | |
1389 | 1380 | |
1390 | 1381 | var worker = new Worker('term-number-wp.js'); |
1391 | 1382 | |
1392 | - // console.log('Start time taken for term: ' + TermList[i]._TermNumber + 'in posting: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); | |
1393 | 1383 | worker.postMessage({ |
1394 | 1384 | |
1395 | 1385 | 'termList': TermList, |
... | ... | @@ -1404,12 +1394,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1404 | 1394 | //} |
1405 | 1395 | |
1406 | 1396 | worker.onmessage = function (e) { |
1407 | - console.log('callback: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); | |
1408 | - | |
1409 | - // alert(e.data.value + '....name= ' + e.data.name) | |
1397 | + | |
1410 | 1398 | var updatedData = e.data.value; |
1411 | - // debugger; | |
1412 | - for (var i = 1; i <= updatedData.length; i++) { | |
1399 | + | |
1400 | + for (var i = 1; i < updatedData.length; i++) { | |
1413 | 1401 | |
1414 | 1402 | var grayCanvasID = 'imageCanvas' +i; |
1415 | 1403 | var grayCanvas = document.getElementById(grayCanvasID); |
... | ... | @@ -1419,13 +1407,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1419 | 1407 | |
1420 | 1408 | grayCanvasContext.putImageData(updatedData[i], 0, 0); |
1421 | 1409 | } |
1422 | - //var upadteddata = e.data.value; | |
1423 | - //var bodyRegionId = e.data.bodyRegionId; | |
1424 | - | |
1425 | - | |
1426 | - | |
1427 | - | |
1428 | - // $rootScope.grayImageDataList[bodyRegionId - 1] = upadteddata; | |
1410 | + | |
1429 | 1411 | |
1430 | 1412 | }; |
1431 | 1413 | worker.onerror = function (e) { |
... | ... | @@ -1433,201 +1415,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1433 | 1415 | }; |
1434 | 1416 | } |
1435 | 1417 | |
1436 | - | |
1437 | - | |
1438 | - //$scope.highLightBodyBasedOnIcolor = function (RGBColor) { | |
1439 | - | |
1440 | - // $scope.previousSelectedTermList.length = 0; | |
1441 | - | |
1442 | - // var RGBColor = $scope.previousSelectedTermList[i]; | |
1443 | - | |
1444 | - // //2. Find Actul Term No Based on Icolor. | |
1445 | - // var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1446 | - | |
1447 | - // //3. Find Term No List Based on ActualTermNo | |
1448 | - // var TermList = $scope.getTermNumberList(ActualTermNo); | |
1449 | - | |
1450 | - // if ($scope.previousSelectedTermList.length > 0) { | |
1451 | - | |
1452 | - // var worker = new Worker('term-number-wp.js'); | |
1453 | - | |
1454 | - | |
1455 | - // for (var i = 0; i < $scope.previousSelectedTermList.length; i++) { | |
1456 | - // $scope.machedTermNoLocation = []; | |
1457 | - // for (var i = 0; i < TermList.length; i++) { | |
1458 | - | |
1459 | - // var termNumber = parseInt(TermList[i]._TermNumber); | |
1460 | - | |
1461 | - // // //Match Term No List in each bodyRegion | |
1462 | - // // $scope.getLocationsForMatchedTermsInWholeBody(termNumber); | |
1463 | - | |
1464 | - // worker.postMessage({ | |
1465 | - // 'cmd': 'abc', | |
1466 | - // 'value': termNumber | |
1467 | - // }); | |
1468 | - // } | |
1469 | - | |
1470 | - // } | |
1471 | - | |
1472 | - // worker.onmessage = function (e) { | |
1473 | - // var msg = e.data.msg1; | |
1474 | - // }; | |
1475 | - // worker.onerror = function (e) { | |
1476 | - // alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); | |
1477 | - // }; | |
1478 | - // } | |
1479 | - // else { | |
1480 | - | |
1481 | - // $scope.machedTermNoLocation = []; | |
1482 | - // for (var i = 0; i < TermList.length; i++) { | |
1483 | - | |
1484 | - // var termNumber = parseInt(TermList[i]._TermNumber); | |
1485 | - | |
1486 | - // var worker = new Worker('term-number-wp.js'); | |
1487 | - | |
1488 | - // //start the worker | |
1489 | - // worker.postMessage({ | |
1490 | - // 'cmd': 'abc', | |
1491 | - // 'value': termNumber | |
1492 | - // }); | |
1493 | - | |
1494 | - // worker.onmessage = function (e) { | |
1495 | - // var msg = e.data.msg; | |
1496 | - // }; | |
1497 | - // worker.onerror = function (e) { | |
1498 | - // alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); | |
1499 | - // }; | |
1500 | - // //Match Term No List in each bodyRegion | |
1501 | - // //$scope.getLocationsForMatchedTermsInWholeBody(termNumber); | |
1502 | - // } | |
1503 | - | |
1504 | - | |
1505 | - // } | |
1506 | - //} | |
1507 | - | |
1508 | - | |
1509 | - | |
1510 | - $scope.fillMatchedTerm = function (grayImageDataVar, BrId) { | |
1511 | - console.log('Start time taken in fillMatchedTerm: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); | |
1512 | - | |
1513 | - //for (var x = 0; x < $scope.ColoredImageSRC.length; x++) { | |
1514 | - // // alert('called for bodyRegionId: ' + $scope.MaskImageSRC[x].bodyRegionId); | |
1515 | - // var bodyRegionId = $scope.ColoredImageSRC[x].bodyRegionId; | |
1516 | - | |
1517 | - // { | |
1518 | - | |
1519 | - // var scaledWidth = $scope.ColoredImageSRC[x].Width; | |
1520 | - // var scaledHeight = $scope.ColoredImageSRC[x].Height; | |
1521 | - // //var maskImg = $scope.ColoredImageSRC[x].SRC; | |
1522 | - | |
1523 | - | |
1524 | - // var coloredImg = $scope.ColoredImageSRC[x].SRC; | |
1525 | - | |
1526 | - // var maskImg = $scope.GetMaskImageSource(coloredImg); | |
1527 | - | |
1528 | - | |
1529 | - // var scledX = $scope.ColoredImageSRC[x].x; | |
1530 | - // var scledY = $scope.ColoredImageSRC[x].y; | |
1531 | - | |
1532 | - | |
1533 | - // // 1. get mask canvas for this body region. | |
1534 | - // //var maskCanvasID; | |
1535 | - // //if ($scope.ColoredImageSRC[x].haveMirror == 'true') { | |
1536 | - // // maskCanvasID = 'imageCanvas' + bodyRegionId + '_MR_mci'; | |
1537 | - // //} | |
1538 | - // //else { | |
1539 | - // // maskCanvasID = 'imageCanvas' + bodyRegionId + '_mci'; | |
1540 | - | |
1541 | - // //} | |
1542 | - // //var maskCanvas = document.getElementById(maskCanvasID); | |
1543 | - // //var maskCanvasContext = maskCanvas.getContext("2d"); | |
1544 | - // //var maskImgData = maskCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight); | |
1545 | - | |
1546 | - // // 2. get coloured canvas for this body region. | |
1547 | - | |
1548 | - | |
1549 | - // var coloredImageDataVar; | |
1550 | - // var coloredImageDataMRVar | |
1551 | - | |
1552 | - // if ($scope.ColoredImageSRC[x].haveMirror == 'true') { | |
1553 | - | |
1554 | - // coloredImageDataVar = $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)]; | |
1555 | - // } | |
1556 | - // else { | |
1557 | - // coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)]; | |
1558 | - // } | |
1559 | - // var grayImageDataVar; | |
1560 | - // var grayCanvas; | |
1561 | - // if ($scope.ColoredImageSRC[x].haveMirror == 'true') { | |
1562 | - | |
1563 | - // //// 3. get mask canvas for this body region._MR | |
1564 | - // var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR'; | |
1565 | - // grayCanvas = document.getElementById(grayCanvasID); | |
1566 | - // var grayCanvasContext = grayCanvas.getContext("2d"); | |
1567 | - // var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight); | |
1568 | - // grayImageDataVar = grayImageData.data; | |
1569 | - // } | |
1570 | - | |
1571 | - // else { | |
1572 | - // var grayCanvasID = 'imageCanvas' + bodyRegionId; | |
1573 | - // grayCanvas = document.getElementById(grayCanvasID); | |
1574 | - // var grayCanvasContext = grayCanvas.getContext("2d"); | |
1575 | - // var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight); | |
1576 | - // grayImageDataVar = grayImageData.data; | |
1577 | - // } | |
1578 | - | |
1579 | - // var coloredImageDataVarMR; | |
1580 | - // var coloredImageDataMR | |
1581 | - | |
1582 | - | |
1583 | - // var counter = 0; | |
1584 | - | |
1585 | - | |
1586 | - // var dataForthisBR = new jinqJs() | |
1587 | - // .from(matchedLocationData) | |
1588 | - // .where('BRId == ' + bodyRegionId) | |
1589 | - // .select(); | |
1590 | - | |
1591 | - // for (var z = 0; z < dataForthisBR.length; z++) | |
1592 | - // { | |
1593 | - // var location = parseInt(dataForthisBR[z].location); | |
1594 | - | |
1595 | - | |
1596 | - // var RED_coloredImage = coloredImageDataVar[location]; | |
1597 | - | |
1598 | - // grayImageDataVar[location] = RED_coloredImage; | |
1599 | - | |
1600 | - | |
1601 | - // var GREEN_coloredImage = coloredImageDataVar[location + 1]; | |
1602 | - // grayImageDataVar[location + 1] = GREEN_coloredImage; | |
1603 | - | |
1604 | - // var BLUE_coloredImage = coloredImageDataVar[location + 2]; | |
1605 | - // grayImageDataVar[location + 2] = BLUE_coloredImage; | |
1606 | - | |
1607 | - | |
1608 | - // var ALPHA_coloredImage = coloredImageDataVar[location + 3]; | |
1609 | - // grayImageDataVar[location + 3] = ALPHA_coloredImage; | |
1610 | - | |
1611 | - // } | |
1612 | - var grayCanvasID = 'imageCanvas' + BrId; | |
1613 | - var grayCanvas = document.getElementById(grayCanvasID); | |
1614 | - var grayCanvasContext = grayCanvas.getContext("2d"); | |
1615 | - | |
1616 | - | |
1617 | - var garyDatalength = grayImageDataVar.length; | |
1618 | - var pixelData = new Uint8ClampedArray(garyDatalength); | |
1619 | - for (var i = 0; i < garyDatalength; i++) { | |
1620 | - pixelData[i] = grayImageDataVar[i]; | |
1621 | - } | |
1622 | - var imgDta = grayCanvasContext.getImageData(0, 0, 348, 507); | |
1623 | - imgDta.data.set | |
1624 | - grayCanvasContext.putImageData(imgDta, 0, 0); | |
1625 | - //} | |
1626 | - | |
1627 | - // } | |
1628 | - | |
1629 | - console.log('End time taken in fillMatchedTerm: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); | |
1630 | - } | |
1418 | + | |
1631 | 1419 | |
1632 | 1420 | $scope.GetRGBColor = function (maskCanvasContext, actulalX, actualY, x, y) { |
1633 | 1421 | var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/match-pixel-wp.js
... | ... | @@ -3,7 +3,6 @@ |
3 | 3 | function updateGrayCanvasDataOnMatcghedLocation(termList, maskCanvasData, coloreImageData, |
4 | 4 | grayImageData, grayImageMRDataList, bodyRegionId) |
5 | 5 | { |
6 | - console.log('updateGrayCanvasDataOnMatcghedLocation= ' + bodyRegionId) | |
7 | 6 | |
8 | 7 | |
9 | 8 | var n = maskCanvasData.data.length; |
... | ... | @@ -51,17 +50,10 @@ function updateGrayCanvasDataOnMatcghedLocation(termList, maskCanvasData, colore |
51 | 50 | } |
52 | 51 | |
53 | 52 | var Icolor = (Red + Green + Blue); |
54 | - // alert('Icolor: ' + Icolor) | |
55 | 53 | |
56 | 54 | if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) { |
57 | 55 | |
58 | - | |
59 | - | |
60 | - | |
61 | - // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i }); | |
62 | - | |
63 | - | |
64 | - // matched = true; | |
56 | + | |
65 | 57 | |
66 | 58 | var RED_coloredImage = coloredImageDataVar[i]; |
67 | 59 | |
... | ... | @@ -85,10 +77,7 @@ function updateGrayCanvasDataOnMatcghedLocation(termList, maskCanvasData, colore |
85 | 77 | |
86 | 78 | previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData; |
87 | 79 | |
88 | - // if (matched == true) { | |
89 | - | |
90 | - // } | |
91 | - | |
80 | + | |
92 | 81 | } |
93 | 82 | self.postMessage({ |
94 | 83 | 'bodyRegionId': bodyRegionId, | ... | ... |