diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
index 006f5c0..0105fd9 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -1,4 +1,5 @@
-'use strict';
+
+'use strict';
AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", "DataService",
function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, DataService) {
@@ -23,7 +24,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.drawnBodyRegions;
//view specific constants
$rootScope.voId;
- $rootScope.layerNumber;
+ $scope.layerNumber;
$scope.daCounter = 1;
$scope.bagartDetails;
$scope.transNumber = 50;
@@ -623,7 +624,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.isNormalMode = true;
- $rootScope.layerNumber = 0;
+ $scope.layerNumber = 0;
$scope.skinTone = $rootScope.globalSetting.ethnicity;
$rootScope.viewOrientationId = $rootScope.voId;
@@ -717,11 +718,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.ColoredImageSRC = [];
}
- if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined)
- {
- angular.forEach($scope.bodyRegionCoordinates, function (value, key)
- {
- console.log('$scope.bodyRegionCoordinates length= ' + $scope.bodyRegionCoordinates.length)
+ if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) {
+ angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
if (value._HaveMirrorImage == 'Y') {
@@ -734,7 +732,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var src = $scope.GetImageSource(value._BodyRegionId);
$scope.imageSource = src;
-
+
//2.Draw mirror image
$scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
// debugger;
@@ -757,7 +755,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//0. Scaling as per default zoom
var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, 0);
-
+
//1.Draw body region which have mirror image
$scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
$scope.BodyRegionCordinatesData.push(
@@ -773,7 +771,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
else {
-
+
//0.Scaling as per default zoom
var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue);
@@ -787,7 +785,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.imageSource = src;
}
-
//2.Draw body region which don't have mirror image
$scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
@@ -813,6 +810,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var gender;
if (localStorage.getItem("genderId") == 'Female') {
gender = 'F';
+
}
else {
gender = 'M';
@@ -842,7 +840,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if ((dtlOfSktn != null || dtlOfSktn != undefined) && (dtlOfSktn.length > 0)) {
- if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($rootScope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($rootScope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
+ if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($scope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($scope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
$scope.figLaefImageName = dtlOfSktn[0]._ImageId;
//$scope.figLaefX = filtereddata[0]._X;
//$scope.figLaefY = filtereddata[0]._Y;
@@ -897,7 +895,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$('#canvasDiv').scrollTop(50)
var abc = $rootScope.BodyRegionCordinatesData;
//debugger;
- $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
+ $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
// $('#spinner').css('visibility', 'hidden');
$rootScope.isLoading = false;
//Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top.
@@ -986,6 +984,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
+
$scope.GetImageSource = function (bodyRegionId) {
// debugger;
var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
@@ -1007,27 +1006,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if ((SelectedLayerData != null || SelectedLayerData != undefined))
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 ($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;
- }
- }
+ if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
- else {
-
- if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
-
- return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.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;
}
}
}
@@ -1059,67 +1046,6 @@ 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;
@@ -1201,8 +1127,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
FlipedImgCanvas.addEventListener('click', function (evt) {
//to get correct data on multihighlight highlight
- if($scope.isLayerChange == true)
- {
+ if ($scope.isLayerChange == true) {
$scope.isLayerChange = false;
}
@@ -1483,7 +1408,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
var imgCanvas = document.createElement('canvas');
-
+
imgCanvas.height = h;
imgCanvas.width = w;
imgCanvas.setAttribute("data-IsMirrored", "N")
@@ -1869,7 +1794,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
loopLength = 1;
}
-
+
if (loopLength !== 0) {
for (var x = 0; x < loopLength; x++) {
if ($rootScope.MaskCanvasData[x] != null || $rootScope.MaskCanvasData[x] != undefined) {
@@ -1912,7 +1837,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 bodyRegionId = ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
if (coloredImageDataVar != null && maskData != null && white != null) {
worker.postMessage({
@@ -1956,7 +1881,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) {
- var canavsWidth = parseInt(grayCanvas.width) ;
+ var canavsWidth = parseInt(grayCanvas.width);
var canavsHeight = parseInt(grayCanvas.height);
console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight)
@@ -1973,7 +1898,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
grayCanvasContext.putImageData(imgData, 0, 0);
}
-
+
if ($rootScope.multiAnnotationIsON == true) {
//debugger;
if (canvasId.match('_MR'))
@@ -2016,6 +1941,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.HighlightBodyByTermList = function (TermList) {
+ //if (($rootScope.updatedGrayMRDataList != null || $rootScope.updatedGrayMRDataList != undefined) && $rootScope.updatedGrayMRDataList.length > 0) {
+ // $rootScope.updatedGrayMRDataList = null;
+ // $rootScope.updatedGrayMRDataList = [];
+ //}
+ //if (($rootScope.updatedGrayDataList != null || $rootScope.updatedGrayDataList != undefined) && $rootScope.updatedGrayDataList.length > 0) {
+ // $rootScope.updatedGrayDataList = null;
+ // $rootScope.updatedGrayDataList = [];
+ //}
console.log('HighlightBodyByTermList is called');
@@ -2026,8 +1959,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
- $timeout(function ()
- {
+ $timeout(function () {
var loopLength = 0;
if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
loopLength = 9;
@@ -2067,9 +1999,7 @@ 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.grayImageMRDataList[bodyRegionId] != null || $rootScope.grayImageMRDataList[bodyRegionId] != undefined) {
@@ -2106,7 +2036,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if ($scope.isLayerChange == true) {
if ($rootScope.grayImageDataList[bodyRegionId - 1] != null || $rootScope.grayImageDataList[bodyRegionId - 1] != undefined) {
grayImageDataVar = $rootScope.grayImageDataList[bodyRegionId - 1];
-
+
}
} else {
@@ -2190,11 +2120,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if (canvasId.match('_MR')) {
$rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData;
+ //alert('HighlightBodyByTermList, is mutiAnnotation on= ' + $rootScope.multiAnnotationIsON);
+
+ //$rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData;
}
else
$rootScope.updatedGrayDataList[bodyRegionId - 1] = updatedData;
-
+ //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
+
console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) {
@@ -2239,8 +2173,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
-
-
$scope.createTermListByPreviousTermsAndHighlight = function () {
@@ -2264,14 +2196,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
console.log('createTermListByPreviousTermsAndHighlight is called');
- if ((multiTermList != undefined || multiTermList!=null) && multiTermList.length>0) {
+ if ((multiTermList != undefined || multiTermList != null) && multiTermList.length > 0) {
$timeout(function () { $scope.HighlightBodyByTermList(multiTermList); }, 50);
}
}
-
$scope.GetRGBColor = function (maskCanvasContext, actulalX, actualY, x, y) {
var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1);
@@ -2449,7 +2380,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
//var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
// debugger;
- $rootScope.layerNumber = parseInt(txtlayerNumber.value);
+ $scope.layerNumber = parseInt(txtlayerNumber.value);
$scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
@@ -2465,7 +2396,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
$('#txtlayerNumber').val(dataLength - 1);
$scope.currentLayerNumber = parseInt(dataLength - 1);
- $rootScope.layerNumber = parseInt(dataLength - 1);
+ $scope.layerNumber = parseInt(dataLength - 1);
}
else
$scope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
@@ -2488,7 +2419,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$timeout(function () { $scope.DisableProgressBar() }, 1000);
}
- $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
+ $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
}
$scope.DisableProgressBar = function () {
@@ -3714,14 +3645,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
else if (isLayerChanged) {
// debugger
- $rootScope.layerNumber = parseInt($('#txtlayerNumber').val());
+ $scope.layerNumber = parseInt($('#txtlayerNumber').val());
}
else {
var currentLayer = parseInt($('#txtlayerNumber').val());
var tranparencyLayer = currentLayer + 1;
- $rootScope.layerNumber = tranparencyLayer;
+ $scope.layerNumber = tranparencyLayer;
}
//dedebugger;
@@ -3953,7 +3884,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
PreviousBodyRegionX = XforTransImage;
previousBodyRegionId = bodyRegionId;
- // $rootScope.layerNumber = parseInt($rootScope.layerNumber - 1);
+ // $scope.layerNumber = parseInt($scope.layerNumber - 1);
}
@@ -4452,7 +4383,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
//var scope = angular.element(document.getElementById("DAView")).scope();
//scope.$apply(function () {
- // $rootScope.layerNumber = 0;
+ // $scope.layerNumber = 0;
$scope.isTransparencyActivated = false;
//})
@@ -4466,7 +4397,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']"))
//.remove();
- $rootScope.layerNumber = $scope.currentLayerNumber;
+ $scope.layerNumber = $scope.currentLayerNumber;
$scope.transNumber = 50;
$(".slider").slider({ value: 50 })
}
@@ -4597,75 +4528,75 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.flushCanvas = function () {
- if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
- angular.forEach($scope.ColoredImageSRC, function (value, key) {
+ //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
+ // angular.forEach($scope.ColoredImageSRC, function (value, key) {
- var id;
- var maskId;
- if (value.haveMirror == 'true') {
- id = 'imageCanvas' + value.bodyRegionId + '_MR';
- maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
- }
- else {
- id = 'imageCanvas' + value.bodyRegionId;
- maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
- }
+ // var id;
+ // var maskId;
+ // if (value.haveMirror == 'true') {
+ // id = 'imageCanvas' + value.bodyRegionId + '_MR';
+ // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
+ // }
+ // else {
+ // id = 'imageCanvas' + value.bodyRegionId;
+ // maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
+ // }
- var canvas = document.getElementById(id);
- if (canvas != null || canvas != undefined) {
- document.getElementById('canvasDiv').removeChild(canvas);
- }
+ // var canvas = document.getElementById(id);
+ // if (canvas != null || canvas != undefined) {
+ // document.getElementById('canvasDiv').removeChild(canvas);
+ // }
- var maskcanvas = document.getElementById(maskId);
- if (maskcanvas != null || maskcanvas != undefined) {
- document.getElementById('canvasDiv').removeChild(maskcanvas);
+ // var maskcanvas = document.getElementById(maskId);
+ // if (maskcanvas != null || maskcanvas != undefined) {
+ // document.getElementById('canvasDiv').removeChild(maskcanvas);
- }
+ // }
- var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
- for (var i = 0; i < modestyCanvases.length; i++) {
- modestyCanvases[i].remove();
- }
- });
- }
+ // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
+ // for (var i = 0; i < modestyCanvases.length; i++) {
+ // modestyCanvases[i].remove();
+ // }
+ // });
+ //}
- //for (var i = 1; i < 7; i++) {
+ for (var i = 1; i < 7; i++) {
- // var id;
- // var maskId;
+ var id;
+ var maskId;
- // id = 'imageCanvas' + i;
- // maskId = 'imageCanvas' + i + '_mci';
+ id = 'imageCanvas' + i;
+ maskId = 'imageCanvas' + i + '_mci';
- // var canvas = document.getElementById(id);
- // if (canvas != null || canvas != undefined)
- // document.getElementById('canvasDiv').removeChild(canvas);
+ var canvas = document.getElementById(id);
+ if (canvas != null || canvas != undefined)
+ document.getElementById('canvasDiv').removeChild(canvas);
- // var maskcanvas = document.getElementById(maskId);
- // if (maskcanvas != null || maskcanvas != undefined)
- // document.getElementById('canvasDiv').removeChild(maskcanvas);
+ var maskcanvas = document.getElementById(maskId);
+ if (maskcanvas != null || maskcanvas != undefined)
+ document.getElementById('canvasDiv').removeChild(maskcanvas);
- // if (i == 4 || i == 5 || i == 6) {
- // id = 'imageCanvas' + i + '_MR';
- // maskId = 'imageCanvas' + i + '_MR_mci';
+ if (i == 4 || i == 5 || i == 6) {
+ id = 'imageCanvas' + i + '_MR';
+ maskId = 'imageCanvas' + i + '_MR_mci';
- // var canvas = document.getElementById(id);
- // if (canvas != null || canvas != undefined)
- // document.getElementById('canvasDiv').removeChild(canvas);
+ var canvas = document.getElementById(id);
+ if (canvas != null || canvas != undefined)
+ document.getElementById('canvasDiv').removeChild(canvas);
- // var maskcanvas = document.getElementById(maskId);
- // if (maskcanvas != null || maskcanvas != undefined)
- // document.getElementById('canvasDiv').removeChild(maskcanvas);
- // }
+ var maskcanvas = document.getElementById(maskId);
+ if (maskcanvas != null || maskcanvas != undefined)
+ document.getElementById('canvasDiv').removeChild(maskcanvas);
+ }
- // //remove modesty canavs
- // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
- // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
- // for (var j = 0; j < modestyCanvases.length; j++) {
- // modestyCanvases[j].remove();
- // }
- // }
- //}
+ //remove modesty canavs
+ var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
+ if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
+ for (var j = 0; j < modestyCanvases.length; j++) {
+ modestyCanvases[j].remove();
+ }
+ }
+ }
}
$scope.terminateCurrentlyRunningWPs = function () {
@@ -4805,7 +4736,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);
$scope.terminateCurrentlyRunningWPs();
@@ -4828,13 +4759,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.doHighlightOrExtract = false;
}
- console.log('$scope.doHighlightOrExtract= ' + $scope.doHighlightOrExtract)
+
if ($scope.doHighlightOrExtract == true) {
if ($rootScope.isHighLight == true) {
$scope.grayedBR = [];
angular.forEach($scope.ColoredImageSRC, function (value, key) {
+ console.log('$scope.ColoredImageSRC length before gray= ' + $scope.ColoredImageSRC.length)
var id;
if (value.haveMirror == 'true') {
id = 'imageCanvas' + value.bodyRegionId + '_MR';
@@ -4874,7 +4806,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
img.src = dataURL;
img.onload = function () {
-
+ console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= '
+ + value.bodyRegionId)
var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
DAData.draw(img);
@@ -4892,26 +4825,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
-
+
context_gray.putImageData(DAData.data, 0, 0)
-
- // to resolve lateral arm black issue in highlight mode
- if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 ||value.bodyRegionId==4)) {
-
+ //NIKI- to resolve lateral arm black issue in highlight mode
+
+ 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;
+ 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);
}
-
- //
+
//push BRID into array
$scope.grayedBR.push({ 'BRID': value.bodyRegionId });
@@ -4975,6 +4907,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
else if ($scope.isHighlightByListManager == true) {
+ // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
$timeout(function () {
$scope.HighlightBodyByTermList($scope.AllTerms)
@@ -4984,7 +4917,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
$scope.createTermListByPreviousTermsAndHighlight();
}
-
}
@@ -4997,12 +4929,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if ($rootScope.isExtract == true) {
if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
- console.log('HighlightBodyOnExtract')
+
$timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
}
}
//else {
- // console.log('INSIDE ELSE. $scope.grayedBR.length= ' + $scope.grayedBR.length)
// // 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
// //and then highlight the previously selected body regions at the time of normal mode.
// if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
@@ -5021,14 +4952,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
// }
- // console.log('INSIDE ELSE $scope.isEligibleForHighlightBodyByTermList = ' + $scope.isEligibleForHighlightBodyByTermList)
+
// //
//}
})
-
- //if ($scope.isEligibleForHighlightBodyByTermList == true) {
- // console.log('CREATE multiTermList')
+ //if ($scope.isEligibleForHighlightBodyByTermList == true) {
// if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
// var multiTermList = [];
@@ -5071,6 +5000,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var imageCanvas = document.getElementById(id);
+ //var coloredCanvasID = 'imageCanvas' + bodyRegionId;
+ //var coloredCanvas = document.getElementById(coloredCanvasID);
var width = value.Width;
var ht = value.Height;
@@ -5382,7 +5313,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$('#spinner').css('visibility', 'visible');
$rootScope.isViewChange = true;
- $rootScope.layerNumber = 0;
+ $scope.layerNumber = 0;
// debugger;
var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
$rootScope.viewOrientationId = selectedViewId;
@@ -5522,9 +5453,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//console.log('reloadDABodyViewEvent');
$scope.ReloadBodyViewId = data.reloadDABodyViewId;
- // $rootScope.layerNumber = 0;
+ // $scope.layerNumber = 0;
// debugger;
- var layerNumber = $rootScope.layerNumber
+
console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId);
if ($rootScope.isSettingEventAlredayDispachted == true) {
@@ -5545,7 +5476,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)
@@ -5579,7 +5510,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
}
}
- }
//Annotation tool event lsitener
@@ -5593,7 +5523,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.$on('annotationToolEvent', function (event, data) {
$("#canvas").css("display", "block");
$("#canvasPaint").css("display", "block");
- // $rootScope.FreeStylePaint();
+ // $rootScope.FreeStylePaint();
$scope.doClick();
});
$scope.mousePs;
@@ -6173,7 +6103,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
- //-- TextArea functionality of Annotation toolbar
+ //-- TextArea functionality of Annotation toolbar
$rootScope.fontSizes;
$rootScope.fontWeight;
@@ -6184,8 +6114,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.textArea;
$rootScope.fontFamily;
$rootScope.saveText = function () {
-
- $rootScope.fontSizes = $("#text_area").css("font-size");
+
+ $rootScope.fontSizes = $("#text_area").css("font-size");
$rootScope.fontWeight = $("#text_area").css("font-weight");
$rootScope.fontStyle = $("#text_area").css("font-style");
$rootScope.textAlignmt = $("#text_area").css("text-align");
@@ -6195,11 +6125,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.textArea = $("#text_area").val();
$("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
$("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
-
+
$('#canvas').drawText({
layer: true,
draggable: true,
- name:'TextArea_'+ $rootScope.resetText,
+ name: 'TextArea_' + $rootScope.resetText,
groups: ['TextArea_' + $rootScope.resetText],
dragGroups: ['TextArea_' + $rootScope.resetText],
fillStyle: $rootScope.fontColor,
@@ -6212,16 +6142,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
x: $scope.offsetX1, y: $scope.offsetY1,
maxWidth: $scope.x - $scope.offsetX1,
maxHeight: $scope.y - $scope.offsetY1,
-
+
click: function (layer) {
-
-
+
+
},
change: function (layer, props) {
}
-
+
})
// Draw rect as wide as the text
.drawRect({
@@ -6238,19 +6168,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
click: function (layer) {
$rootScope.shapeTypeText = "textAreaRect";
-
+
var layerNameSplit = layer.name;
-
+
var splitedName = layerNameSplit.split("_");
-
+
var textValName = "TextArea_";
-
+
var concatinateResult = textValName.concat(splitedName[1]);
-
+
$rootScope.canvasLayerNameCollection = [];
$rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
-
-
+
+
$('#canvas').setLayer(layer.name, {
handle: {
@@ -6265,7 +6195,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
},
mouseout: function (layer) {
-
+
$rootScope.canvasLayerNameCollection = [];
$('#canvas').setLayer(layer.name, {
handle: {
@@ -6281,7 +6211,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
},
mouseover: function (layer) {
-
+
$('#canvas').setLayer(layer.name, {
handle: {
type: 'rectangle',
@@ -6296,25 +6226,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
});
$("#text_area").val('');
-
- $("#text_area").css({" font-family":"'Verdana, sans-serif'","font-size":"14px","font-weight":"normal","font-style":"normal","color":"#000","text-align":"left","text-decoration":"none"});
-
+
+ $("#text_area").css({ " font-family": "'Verdana, sans-serif'", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
+
}
function OnPaintCanvasMouseMove(event) {
-
+
}
$rootScope.FreeStylePaint = function (e) {
// debugger;
- // alert("asasssas");
+ // alert("asasssas");
$rootScope.shapeType = "FreeStylePaint";
canvas.addEventListener('mouseup', $scope.OnPaintCanvasMouseUp, false);
-
+
}
$(document).keydown(function (event) {
@@ -6656,7 +6586,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
if (($scope.isHighlightBodysystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
$timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);
- }
+ }
}
@@ -6671,7 +6601,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item;
//var systemListHtml = ''
- $('#bodySystems').empty();
var $all = $('').appendTo('#bodySystems');
$compile($all)($scope);
@@ -6707,7 +6636,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
// var TermTextList = [];
// var TermTextList = [];
- $('#termList').empty();
+
$scope.loadListManger();
@@ -6769,6 +6698,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
})
+
$scope.VocabTermTxt = new jinqJs()
.from(vocabTermTxt)
.distinct('_TermText', '_ActualTermNumber')
@@ -6792,7 +6722,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
// })
-
+
//.error(function (data, status, headers, config) {
// console.log(data);
@@ -6850,7 +6780,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
layerNumber = parseInt(layerNumber) - 1;
}
- $rootScope.layerNumber = layerNumber;
+ $scope.layerNumber = layerNumber;
//4.get scroll position
if (actualTermNumber != DA[0].SKIN_TERM_ID) {
@@ -6891,8 +6821,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
}
- $('#txtlayerNumber').val((parseInt($rootScope.layerNumber)));
- $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
+ $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
+ $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
//8.remove current layer canavses
$scope.flushCanvas();