Commit b29d108944707abb65c69bd36b9108c7723c1b85
1 parent
027496b9
started work on geneder change highlight but not completed.
Showing
1 changed file
with
24 additions
and
11 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -81,6 +81,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
81 | 81 | $scope.dragdivleft = 0; |
82 | 82 | $scope.dragdivtop = 0; |
83 | 83 | |
84 | + $scope.drawnBodyRegions; | |
85 | + | |
84 | 86 | $scope.dragdivposition = { |
85 | 87 | "left": $scope.dragdivleft, |
86 | 88 | "top": $scope.dragdivtop |
... | ... | @@ -595,7 +597,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
595 | 597 | //calculate coordinates for body region images |
596 | 598 | $scope.CalculateImageCordinates = function (viewOrientationId) { |
597 | 599 | |
598 | - | |
600 | + $scope.drawnBodyRegions = []; | |
599 | 601 | //remove the previous layer mask data from array |
600 | 602 | var n = $rootScope.MaskCanvasData.length |
601 | 603 | |
... | ... | @@ -642,7 +644,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
642 | 644 | |
643 | 645 | angular.forEach($scope.bodyRegionCoordinates, function (value, key) { |
644 | 646 | |
645 | - | |
647 | + | |
646 | 648 | |
647 | 649 | if (value._HaveMirrorImage == 'Y') { |
648 | 650 | |
... | ... | @@ -815,7 +817,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
815 | 817 | |
816 | 818 | } |
817 | 819 | |
818 | - | |
820 | + if ($rootScope.isHighLight == true && $scope.ColoredImageSRC.length == 9) { | |
821 | + console.log('$scope.ColoredImageSRC.length = ' + $scope.ColoredImageSRC.length) | |
822 | + $scope.highLightBody(); | |
823 | + } | |
819 | 824 | }); |
820 | 825 | |
821 | 826 | if ((DA[0].modesty == 'Y')) { |
... | ... | @@ -880,7 +885,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
880 | 885 | } |
881 | 886 | |
882 | 887 | $('#draggable').css('width', dragdivw); |
883 | - $('#draggable').css('height', dragdivh) | |
888 | + $('#draggable').css('height', dragdivh); | |
889 | + | |
890 | + | |
884 | 891 | } |
885 | 892 | |
886 | 893 | function scaleRectangle(x, y, height, width, mirrorValue) { |
... | ... | @@ -4281,12 +4288,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4281 | 4288 | $scope.highLightBody = function () { |
4282 | 4289 | |
4283 | 4290 | |
4284 | - | |
4291 | + console.log('htghlightbody') | |
4285 | 4292 | if ($rootScope.isHighLight == true) { |
4286 | 4293 | |
4287 | 4294 | $scope.grayeddBR = []; |
4288 | 4295 | |
4289 | 4296 | angular.forEach($scope.ColoredImageSRC, function (value, key) { |
4297 | + console.log('jjjj') | |
4298 | + | |
4290 | 4299 | var id; |
4291 | 4300 | if (value.haveMirror == 'true') { |
4292 | 4301 | id = 'imageCanvas' + value.bodyRegionId + '_MR'; |
... | ... | @@ -4324,7 +4333,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4324 | 4333 | |
4325 | 4334 | var dataURL = imageCanvas.toDataURL(); |
4326 | 4335 | |
4327 | - | |
4336 | + | |
4328 | 4337 | var img = new Image(); |
4329 | 4338 | |
4330 | 4339 | img.src = dataURL; |
... | ... | @@ -4332,29 +4341,33 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4332 | 4341 | |
4333 | 4342 | |
4334 | 4343 | img.onload = function () { |
4335 | - //console.log(Math.max(img.width) + ', ' + Math.max(img.height)) | |
4344 | + console.log('BRID= '+value.bodyRegionId +'IMGDATA= '+img.src) | |
4336 | 4345 | |
4337 | 4346 | var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); |
4338 | 4347 | DAData.draw(img); |
4339 | 4348 | |
4340 | 4349 | var colorMode; |
4341 | - | |
4342 | 4350 | if ($scope.isExtract == true) { |
4351 | + console.log('$scope.isExtract= ' + $scope.isExtract) | |
4343 | 4352 | colorMode = $scope.applyWhiteMatrix(img, context_gray); |
4344 | 4353 | } |
4345 | 4354 | else { |
4355 | + console.log('$scope.isExtract= ' + $scope.isExtract) | |
4356 | + | |
4346 | 4357 | colorMode = $scope.applyGrayMatrix(img, context_gray); |
4358 | + console.log('colorMode= ' + colorMode) | |
4359 | + | |
4347 | 4360 | } |
4348 | 4361 | |
4349 | 4362 | var zeroPoint = new Point(); |
4350 | - | |
4363 | + | |
4351 | 4364 | DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); |
4352 | 4365 | |
4353 | 4366 | context_gray.putImageData(DAData.data, 0, 0) |
4354 | 4367 | |
4355 | 4368 | var grayImageData = context_gray.getImageData(0, 0, width, ht); |
4356 | 4369 | var grayImageImageDataVar = grayImageData.data; |
4357 | - | |
4370 | + | |
4358 | 4371 | if ($scope.isExtract == true) { |
4359 | 4372 | if (value.haveMirror == 'true') { |
4360 | 4373 | $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; |
... | ... | @@ -4377,7 +4390,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4377 | 4390 | } |
4378 | 4391 | } |
4379 | 4392 | } |
4380 | - | |
4393 | + | |
4381 | 4394 | $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); |
4382 | 4395 | |
4383 | 4396 | ... | ... |