diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 42ffa43..94cef87 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -813,7 +813,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var gender; if (localStorage.getItem("genderId") == 'Female') { gender = 'F'; - } + } else { gender = 'M'; } @@ -986,7 +986,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.GetImageSource = function (bodyRegionId) { // debugger; var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; @@ -996,27 +995,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // debugger $('#txtLayerNumber').attr('max', $scope.totalLayers); $('#layerChangeSlider').slider("option", "max", $scope.totalLayers); - // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($rootScope.layerNumber)); + // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($scope.layerNumber)); $scope.one = 1; - $scope.userInput = parseInt($rootScope.layerNumber); + $scope.userInput = parseInt($scope.layerNumber); $scope.skinTone = $rootScope.globalSetting.ethnicity; var SelectedLayerData = []; SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1]; if ((SelectedLayerData != null || SelectedLayerData != undefined)) - if ($rootScope.layerNumber == 0) { + if ($scope.layerNumber == 0) { + console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length); + if (SelectedLayerData.BodyRegion.length > 0) { for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) { var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone; - if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { + if ($rootScope.viewOrientationId == 3 && bodyRegionId==1) { + console.log('$rootScope.voId: ' + $rootScope.voId); + if (bodyRegion == bodyRegionId && bodyRegionSkinTone == 'W') { + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + } + } + + else { + + if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + } } } } @@ -1027,7 +1038,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) { var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId; - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; } else // it is for other body view which have multiple body regions and layer no > 0 @@ -1038,7 +1049,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; if (bodyRegion == bodyRegionId) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } @@ -1048,6 +1059,67 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } + //$scope.GetImageSource = function (bodyRegionId) { + // // debugger; + // var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; + + // //set max for LayerNumber input + // $scope.totalLayers = dataLength - 1; + // // debugger + // $('#txtLayerNumber').attr('max', $scope.totalLayers); + // $('#layerChangeSlider').slider("option", "max", $scope.totalLayers); + // // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($rootScope.layerNumber)); + + // $scope.one = 1; + + // $scope.userInput = parseInt($rootScope.layerNumber); + // $scope.skinTone = $rootScope.globalSetting.ethnicity; + + // var SelectedLayerData = []; + // SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1]; + // if ((SelectedLayerData != null || SelectedLayerData != undefined)) + + // if ($rootScope.layerNumber == 0) { + // if (SelectedLayerData.BodyRegion.length > 0) { + // for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) { + + // var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; + // var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone; + + // if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { + + // return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + // } + // } + // } + // } + // else { + // // debugger; + // //below 4 bodyviews have only single body region + // if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) { + // var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId; + + // return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; + + // } + // else // it is for other body view which have multiple body regions and layer no > 0 + // { + // // debugger; + // if (SelectedLayerData.BodyRegion.length > 0) { + // for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) { + // var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; + // if (bodyRegion == bodyRegionId) { + + // return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + + + // } + // } + // } + // } + // } + + //} $scope.GetBackgroundImgSource = function (bodyRegionId) { // debugger; @@ -1373,11 +1445,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); //$timeout(function () { - console.log('inside start of flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) - $rootScope.isHighLight = true; - console.log('just before highLightBody call'); - $scope.highLightBody(); - console.log('just after highLightBody call'); + console.log('inside start of flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) + $rootScope.isHighLight = true; + console.log('just before highLightBody call'); + $scope.highLightBody(); + console.log('just after highLightBody call'); //}, 500); } } @@ -1599,35 +1671,35 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('1. annotationText: ' + annotationText); - if ($('#dot').length > 0) { - $('#dot').remove(); + if ($('#dot').length > 0) { + $('#dot').remove(); - if ($('#sppeachBubble').length > 0) { - $('#sppeachBubble').remove(); - } + if ($('#sppeachBubble').length > 0) { + $('#sppeachBubble').remove(); + } - // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); + // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); - $scope.MultiLanguageAnnationArray.push(annotationText); + $scope.MultiLanguageAnnationArray.push(annotationText); - console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); + console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); - } - else { + } + else { - $scope.MultiLanguageAnnationArray = []; - $scope.MultiLanguageAnnationArray.push(annotationText); + $scope.MultiLanguageAnnationArray = []; + $scope.MultiLanguageAnnationArray.push(annotationText); - console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); - } + console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); + } } @@ -1693,11 +1765,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); //$timeout(function () { - console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) - $rootScope.isHighLight = true; - console.log('just before highLightBody call'); - $scope.highLightBody(); - console.log('just after highLightBody call'); + console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) + $rootScope.isHighLight = true; + console.log('just before highLightBody call'); + $scope.highLightBody(); + console.log('just after highLightBody call'); //}, 500); } } @@ -1707,7 +1779,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - if (imgCanvas.id.match('_mci')) { + if (imgCanvas.id.match('_mci')) { var maskImgData = context.getImageData(0, 0, w, h); $rootScope.MaskCanvasData.push( { @@ -1840,7 +1912,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //push workers in array to further used the refernece to delete the workers $scope.runningWorkers.push({ 'workerName': worker }) - console.log('for BRID = ' + bodyRegionId + ', coloredImageDataVar: ' + coloredImageDataVar + ', maskData= ' + maskData + ', white= ' + white) + console.log('for BRID = ' + bodyRegionId + ', coloredImageDataVar: ' + coloredImageDataVar + ', maskData= ' + maskData + ', white= ' + white) if (coloredImageDataVar != null && maskData != null && white != null) { worker.postMessage({ @@ -1880,26 +1952,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo grayCanvasContext.putImageData(updatedData, 0, 0); - //to resolve lateral arm black issue in highlight mode + //to resolve lateral arm black issue in highlight mode - if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) { + if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) { - var canavsWidth = parseInt(grayCanvas.width) ; - var canavsHeight = parseInt(grayCanvas.height); + var canavsWidth = parseInt(grayCanvas.width) ; + var canavsHeight = parseInt(grayCanvas.height); - console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight) + console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight) - var imgData = grayCanvasContext.getImageData(0, 0, canavsWidth, canavsHeight); - var data = imgData.data; - var c = 0; - for (var i = 0; i < data.length; i += 4) { - if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { - data[i + 3] = 0; - } + var imgData = grayCanvasContext.getImageData(0, 0, canavsWidth, canavsHeight); + var data = imgData.data; + var c = 0; + for (var i = 0; i < data.length; i += 4) { + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { + data[i + 3] = 0; + } + } + grayCanvasContext.putImageData(imgData, 0, 0); } - grayCanvasContext.putImageData(imgData, 0, 0); - } if ($rootScope.multiAnnotationIsON == true) { @@ -1995,22 +2067,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId]; } } - else + else { - if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1] == undefined) { + if ($rootScope.updatedGrayDataList[bodyRegionId - 1] == null || $rootScope.updatedGrayDataList[bodyRegionId - 1] == undefined) { - if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) { - grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId]; + if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) { + grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId]; + } } - } - else { - if ($rootScope.updatedGrayMRDataList[bodyRegionId] != null || $rootScope.updatedGrayMRDataList[bodyRegionId] != undefined) { - grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId] + else { + if ($rootScope.updatedGrayMRDataList[bodyRegionId] != null || $rootScope.updatedGrayMRDataList[bodyRegionId] != undefined) { + grayImageDataVar = $rootScope.updatedGrayMRDataList[bodyRegionId] + } } } } - } else { if ($rootScope.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) { grayImageDataVar = $rootScope.grayImageMRDataList[bodyRegionId]; @@ -2053,7 +2125,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo grayImageDataVar = $rootScope.updatedGrayDataList[bodyRegionId - 1]; } } - } + } } else if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) { @@ -2431,7 +2503,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#btnHighLight').addClass('btn-primary'); console.log('highLightBody call from DisableProgressBar') - // $scope.highLightBody(); + // $scope.highLightBody(); @@ -4733,7 +4805,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.highLightBody = function () { - // console.log('highLightBody is called and ColoredImageSRC length: ' + $scope.ColoredImageSRC.length + ' and $rootScope.viewOrientationId= ' + $rootScope.viewOrientationId); + // console.log('highLightBody is called and ColoredImageSRC length: ' + $scope.ColoredImageSRC.length + ' and $rootScope.viewOrientationId= ' + $rootScope.viewOrientationId); $scope.terminateCurrentlyRunningWPs(); @@ -4792,14 +4864,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - var context_gray = imageCanvas.getContext('2d'); + var context_gray = imageCanvas.getContext('2d'); - var dataURL = imageCanvas.toDataURL(); + var dataURL = imageCanvas.toDataURL(); - var img = new Image(); + var img = new Image(); - img.src = dataURL; + img.src = dataURL; img.onload = function () { @@ -4821,27 +4893,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - context_gray.putImageData(DAData.data, 0, 0) + context_gray.putImageData(DAData.data, 0, 0) - // to resolve lateral arm black issue in highlight mode + // to resolve lateral arm black issue in highlight mode - if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) { + if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) { - var imgData = context_gray.getImageData(0, 0, width, ht); - var data = imgData.data; - var c=0; - for (var i = 0; i < data.length; i += 4) { - if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { - data[i + 3] = 0; - } - + var imgData = context_gray.getImageData(0, 0, width, ht); + var data = imgData.data; + var c=0; + for (var i = 0; i < data.length; i += 4) { + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { + data[i + 3] = 0; } - context_gray.putImageData(imgData, 0, 0); + } + context_gray.putImageData(imgData, 0, 0); + } - // - //push BRID into array - $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); + // + //push BRID into array + $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); var grayImageData = context_gray.getImageData(0, 0, width, ht); var grayImageImageDataVar = grayImageData.data; @@ -5473,7 +5545,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.voId = currentBodyViewId; $scope.skinTone = $rootScope.globalSetting.ethnicity; - + if($scope.NavigatorData!=null || $scope.NavigatorData!=undefined){ var navdtlOrient = new jinqJs() .from($scope.NavigatorData.Navigtor.ViewOrientation) .where("_ViewOrientationId == " + $scope.voId) @@ -5507,6 +5579,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } } + } //Annotation tool event lsitener