Commit 9e600dfd751fdb92184dfc2bcac33d3b03c2d34f

Authored by Nikita Kulshreshtha
2 parents a6beb94e ad97d9e9

commit

150-DOCUMENTATION/TestCasesForHighlight.xlsx 0 → 100644
No preview for this file type
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
... ... @@ -75,17 +75,29 @@
75 75 <Content Include="app\widget\MainMenu.html" />
76 76 <Content Include="content\css\main.css" />
77 77 <Content Include="content\data\json\da\body-views\1\da_dat_tm_sg_1.json" />
  78 + <Content Include="content\data\json\da\body-views\10\da_dat_body_system_term_10.json" />
78 79 <None Include="content\data\json\da\body-views\10\da_dat_tm_sg_10.json" />
79 80 <Content Include="content\data\json\da\body-views\12\da_dat_layer_12.json" />
80 81 <Content Include="content\data\json\da\body-views\12\da_dat_tm_sg_12.json" />
81 82 <Content Include="content\data\json\da\body-views\11\da_dat_layer_11.json" />
82 83 <Content Include="content\data\json\da\body-views\11\da_dat_tm_sg_11.json" />
  84 + <Content Include="content\data\json\da\body-views\1\da_dat_body_system_term_1.json" />
  85 + <Content Include="content\data\json\da\body-views\2\da_dat_body_system_term_2.json" />
  86 + <Content Include="content\data\json\da\body-views\11\da_dat_body_system_term_11.json" />
  87 + <Content Include="content\data\json\da\body-views\12\da_dat_body_system_term_12.json" />
83 88 <None Include="content\data\json\da\body-views\2\da_dat_tm_sg_2.json" />
  89 + <Content Include="content\data\json\da\body-views\3\da_dat_body_system_term_3.json" />
84 90 <None Include="content\data\json\da\body-views\3\da_dat_tm_sg_3.json" />
  91 + <Content Include="content\data\json\da\body-views\4\da_dat_body_system_term_4.json" />
85 92 <None Include="content\data\json\da\body-views\4\da_dat_tm_sg_4.json" />
  93 + <Content Include="content\data\json\da\body-views\5\da_dat_body_system_term_5.json" />
  94 + <Content Include="content\data\json\da\body-views\6\da_dat_body_system_term_6.json" />
86 95 <None Include="content\data\json\da\body-views\6\da_dat_tm_sg_6.json" />
  96 + <Content Include="content\data\json\da\body-views\7\da_dat_body_system_term_7.json" />
87 97 <None Include="content\data\json\da\body-views\7\da_dat_tm_sg_7.json" />
  98 + <Content Include="content\data\json\da\body-views\8\da_dat_body_system_term_8.json" />
88 99 <None Include="content\data\json\da\body-views\8\da_dat_tm_sg_8.json" />
  100 + <Content Include="content\data\json\da\body-views\9\da_dat_body_system_term_9.json" />
89 101 <None Include="content\data\json\da\body-views\9\da_dat_tm_sg_9.json" />
90 102 <Content Include="content\images\1.jpg" />
91 103 <Content Include="content\images\1000x600.jpg" />
... ... @@ -42954,6 +42966,7 @@
42954 42966 <Content Include="content\data\json\da\body-views\9\da_dat_layer_9.json" />
42955 42967 <Content Include="content\data\json\da\body-views\9\da_dat_tm_sg_9.json" />
42956 42968 <Content Include="content\data\json\ci\ci_dat_contentlist.json" />
  42969 + <Content Include="content\data\json\da\da_dat_common.json" />
42957 42970 <None Include="Web.Debug.config">
42958 42971 <DependentUpon>Web.config</DependentUpon>
42959 42972 </None>
... ... @@ -42981,10 +42994,7 @@
42981 42994 </ItemGroup>
42982 42995 <ItemGroup>
42983 42996 <Folder Include="content\data\json\ca\" />
42984   - <Folder Include="content\data\json\ci\" />
42985 42997 <Folder Include="content\images\ca\" />
42986   - <Folder Include="content\images\ci\images\" />
42987   - <Folder Include="content\images\ci\thumbnails\" />
42988 42998 <Folder Include="content\images\DA\75\body-views\4\layers\329\6\" />
42989 42999 <Folder Include="Properties\" />
42990 43000 </ItemGroup>
... ... @@ -42999,7 +43009,7 @@
42999 43009 <VisualStudio>
43000 43010 <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
43001 43011 <WebProjectProperties>
43002   - <UseIIS>True</UseIIS>
  43012 + <UseIIS>False</UseIIS>
43003 43013 <AutoAssignPort>True</AutoAssignPort>
43004 43014 <DevelopmentServerPort>55837</DevelopmentServerPort>
43005 43015 <DevelopmentServerVPath>/</DevelopmentServerVPath>
... ...
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user
... ... @@ -3,5 +3,29 @@
3 3 <PropertyGroup>
4 4 <ProjectView>ShowAllFiles</ProjectView>
5 5 </PropertyGroup>
6   - <ProjectExtensions />
  6 + <ProjectExtensions>
  7 + <VisualStudio>
  8 + <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
  9 + <WebProjectProperties>
  10 + <StartPageUrl>
  11 + </StartPageUrl>
  12 + <StartAction>CurrentPage</StartAction>
  13 + <AspNetDebugging>True</AspNetDebugging>
  14 + <SilverlightDebugging>False</SilverlightDebugging>
  15 + <NativeDebugging>False</NativeDebugging>
  16 + <SQLDebugging>False</SQLDebugging>
  17 + <ExternalProgram>
  18 + </ExternalProgram>
  19 + <StartExternalURL>
  20 + </StartExternalURL>
  21 + <StartCmdLineArguments>
  22 + </StartCmdLineArguments>
  23 + <StartWorkingDirectory>
  24 + </StartWorkingDirectory>
  25 + <EnableENC>True</EnableENC>
  26 + <AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
  27 + </WebProjectProperties>
  28 + </FlavorProperties>
  29 + </VisualStudio>
  30 + </ProjectExtensions>
7 31 </Project>
8 32 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -43,6 +43,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
43 43 $scope.previousGrayImageDataVar;
44 44 $scope.previousGrayCanvas;
45 45  
  46 + $scope.previousSelectedTermList = [];
  47 +
  48 +
  49 +
46 50 $scope.machedBodyRegion = [];
47 51  
48 52 //array for bodyviewid correspoing to male female(used for gender change)
... ... @@ -149,7 +153,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
149 153  
150 154 }
151 155  
152   - $scope.imagePath = "~/../content/images/DA/"+$scope.zoomInOut +"/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
  156 + $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
153 157 // debugger;
154 158  
155 159 var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >'
... ... @@ -190,12 +194,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
190 194 $rootScope.ClearIframe();
191 195  
192 196 //load common data
193   - var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json';
  197 + var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json';
194 198  
195 199 DataService.getAnotherJson(commondataJsonPath)
196 200 .then(
197 201 function (result) {
198   -
  202 +
199 203 $rootScope.CommonData = result;
200 204 $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) {
201 205  
... ... @@ -215,17 +219,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
215 219 }
216 220 )
217 221 //load body-views data
218   -
  222 +
219 223  
220 224 // $('#daLoaderLabel').css('visibility', 'hidden')
221 225 $rootScope.isLoading = false;
222 226  
223   -
  227 +
224 228  
225 229 //push the details of open module in array $rootScope.openModules
226 230 $rootScope.openModules.push({ "ModuleId": 1 });
227   -
228   -
  231 +
  232 +
229 233 }
230 234  
231 235  
... ... @@ -321,7 +325,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
321 325 selector: '.daBodyView',
322 326 theme: 'success',
323 327 currentController: 'DAController',
324   - parentSlug:'da-view-list',
  328 + parentSlug: 'da-view-list',
325 329 ajax: {
326 330 url: 'app/views/da/da-view.html'
327 331 },
... ... @@ -760,7 +764,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
760 764  
761 765 if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
762 766  
763   - return "content/images/DA/"+$scope.zoomInOut +"/body-views/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  767 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
764 768 }
765 769 }
766 770 }
... ... @@ -782,7 +786,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
782 786 if (bodyRegion == bodyRegionId) {
783 787  
784 788 return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
785   -
  789 +
786 790  
787 791 }
788 792 }
... ... @@ -818,7 +822,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
818 822 for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) {
819 823 var gender = $scope.bagartDetailsOnSktn[z]._Gender;
820 824 if (gender == selectedGender) {
821   - return "content/images/DA/"+$scope.zoomInOut+"/body-views/" + $scope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId;
  825 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $scope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId;
822 826 }
823 827 }
824 828 }
... ... @@ -839,7 +843,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
839 843 FlipedImgCanvas.style.left = x + "px";
840 844 FlipedImgCanvas.style.top = y + "px";
841 845  
842   -
  846 +
843 847  
844 848 if (isMaskImage == 'Y') {
845 849 FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci';
... ... @@ -852,14 +856,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
852 856  
853 857 }
854 858  
855   -
  859 +
856 860  
857 861 FlipedImgCanvas.addEventListener('click', function (evt) {
858 862  
859   -
  863 +
860 864 //get mouse coordinate of mirror image click
861 865 var mousePos = $scope.getMousePos(evt);
862   -
  866 +
863 867 var context = FlipedImgCanvas.getContext("2d");
864 868 var canvasId = context.canvas.getAttribute('id');
865 869  
... ... @@ -875,7 +879,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
875 879 var canvasDiv = document.getElementById('canvasDiv');
876 880 var verticalScrollPosition = canvasDiv.scrollTop;
877 881 var horizontlScrollPosition = canvasDiv.scrollLeft;
878   -
  882 +
879 883 var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135);
880 884  
881 885 var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
... ... @@ -934,7 +938,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
934 938 var termNumber = parseInt(TermList[i]._TermNumber);
935 939  
936 940 //Match Term No List in each bodyRegion
937   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
  941 + $scope.getLocationsForMatchedTermsInWholeBody(termNumber);
938 942 }
939 943 }
940 944  
... ... @@ -943,10 +947,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
943 947  
944 948 if ($('#speechBubbleTrns').length > 0)
945 949 $('#speechBubbleTrns').remove();
946   -
947   - if ($scope.multiAnnotationIsON == true)
948   - {
949   -
  950 +
  951 + if ($scope.multiAnnotationIsON == true) {
  952 +
950 953 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
951 954  
952 955 }
... ... @@ -954,11 +957,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
954 957 if ($('#speechBubble').length > 0) {
955 958 $('#speechBubble').remove();
956 959  
957   -
  960 +
958 961 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
959 962 }
960 963 else {
961   -
  964 +
962 965 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
963 966 }
964 967  
... ... @@ -1010,10 +1013,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1010 1013  
1011 1014  
1012 1015 }
1013   -
  1016 +
1014 1017 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1015 1018  
1016   - var imgCanvas = document.createElement('canvas');
  1019 + var imgCanvas = document.createElement('canvas');
1017 1020 // imgCanvas.style.backgroundColor = 'red';
1018 1021 imgCanvas.height = h;
1019 1022 imgCanvas.width = w;
... ... @@ -1050,12 +1053,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1050 1053 }
1051 1054 imgCanvas.addEventListener('click', function (evt) {
1052 1055  
1053   - if (evt.ctrlKey)
1054   - {
  1056 + if (evt.ctrlKey) {
1055 1057 $scope.multiAnnotationIsON = true;
1056 1058 }
1057   - else
1058   - {
  1059 + else {
1059 1060 $scope.multiAnnotationIsON = false;
1060 1061 }
1061 1062  
... ... @@ -1079,7 +1080,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1079 1080 // var mousePos = $scope.getMousePos1(evt);
1080 1081 //}
1081 1082 //else
1082   - var mousePos = $scope.getMousePos(evt);
  1083 + var mousePos = $scope.getMousePos(evt);
1083 1084 // alert(mousePos.x + ',' + mousePos.y);
1084 1085  
1085 1086 var canvasDiv = document.getElementById('canvasDiv');
... ... @@ -1091,15 +1092,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1091 1092 var actulalX = mousePos.x + horizontlScrollPosition;
1092 1093 var actualY = mousePos.y + verticalScrollPosition;
1093 1094  
1094   - //debugger;
  1095 +
  1096 +
1095 1097 var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
1096 1098  
1097   - if ($rootScope.isHighLight)
1098   - {
1099   - if ($scope.machedBodyRegion.length > 0)
1100   - {
1101   - if ($scope.multiAnnotationIsON == false)
1102   - {
  1099 + if ($rootScope.isHighLight) {
  1100 + if ($scope.machedBodyRegion.length > 0) {
  1101 + if ($scope.multiAnnotationIsON == false) {
1103 1102 for (var i = 0; i < $scope.machedBodyRegion.length; i++) {
1104 1103 var bodyRegionId = $scope.machedBodyRegion[i];
1105 1104  
... ... @@ -1112,53 +1111,64 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1112 1111  
1113 1112 grayCanvasContext.putImageData(grayImageData, 0, 0)
1114 1113  
1115   - }
  1114 + }
1116 1115 }
  1116 + }
1117 1117  
1118   - var ActualTermNo = $scope.getActualTermNumber(RGBColor);
1119   - //alert('actual term no: ' + ActualTermNo);
  1118 + // var IcolorWithCordinate = new Object;
  1119 + var previousIcolor = RGBColor;
  1120 + //var previousX;
  1121 + // var previousY;
1120 1122  
1121   - //3. Find Term No List Based on ActualTermNo
1122   - var TermList = $scope.getTermNumberList(ActualTermNo);
1123   - // alert('termList.count: ' + TermList.length);
  1123 + //IcolorWithCordinate.previousIcolor= RGBColor;
  1124 + // IcolorWithCordinate.previousX = x;
  1125 + // IcolorWithCordinate.previousY = y;
1124 1126  
1125   - //4.
  1127 + $scope.previousSelectedTermList.push(previousIcolor);
1126 1128  
1127   - $scope.machedTermNoLocation = [];
1128   - for (var i = 0; i < TermList.length; i++) {
  1129 + $scope.highLightBodyBasedOnIcolor(RGBColor);
1129 1130  
1130   - var termNumber = parseInt(TermList[i]._TermNumber);
  1131 + //var ActualTermNo = $scope.getActualTermNumber(RGBColor);
  1132 + ////3. Find Term No List Based on ActualTermNo
  1133 + //var TermList = $scope.getTermNumberList(ActualTermNo);
  1134 + //// alert('termList.count: ' + TermList.length);
1131 1135  
1132   - //Match Term No List in each bodyRegion
1133   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
1134   - }
  1136 + ////4.
1135 1137  
1136   - }
  1138 + //$scope.machedTermNoLocation = [];
  1139 + //for (var i = 0; i < TermList.length; i++) {
1137 1140  
1138   - else
1139   - {
  1141 + // var termNumber = parseInt(TermList[i]._TermNumber);
  1142 +
  1143 + // //Match Term No List in each bodyRegion
  1144 + // $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
  1145 + //}
  1146 +
  1147 + }
1140 1148  
1141   - //2. Find Actul Term No Based on Icolor.
1142   - var ActualTermNo = $scope.getActualTermNumber(RGBColor);
1143   - //alert('actual term no: ' + ActualTermNo);
  1149 + else {
  1150 + $scope.highLightBodyBasedOnIcolor(RGBColor);
1144 1151  
1145   - //3. Find Term No List Based on ActualTermNo
1146   - var TermList = $scope.getTermNumberList(ActualTermNo);
1147   - // alert('termList.count: ' + TermList.length);
  1152 + ////2. Find Actul Term No Based on Icolor.
  1153 + //var ActualTermNo = $scope.getActualTermNumber(RGBColor);
1148 1154  
1149   - //4.
  1155 + ////3. Find Term No List Based on ActualTermNo
  1156 + //var TermList = $scope.getTermNumberList(ActualTermNo);
1150 1157  
1151   - $scope.machedTermNoLocation = [];
1152   - for (var i = 0; i < TermList.length; i++) {
1153 1158  
1154   - var termNumber = parseInt(TermList[i]._TermNumber);
  1159 + ////4.
1155 1160  
1156   - //Match Term No List in each bodyRegion
1157   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
1158   - }
1159   - }
  1161 + //$scope.machedTermNoLocation = [];
  1162 + //for (var i = 0; i < TermList.length; i++) {
  1163 +
  1164 + // var termNumber = parseInt(TermList[i]._TermNumber);
  1165 +
  1166 + // //Match Term No List in each bodyRegion
  1167 + // $scope.getLocationsForMatchedTermsInWholeBody(termNumber, x, y);
  1168 + //}
1160 1169 }
1161   -
  1170 +
  1171 +
1162 1172  
1163 1173  
1164 1174 //Modesty ON
... ... @@ -1195,7 +1205,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1195 1205 $('#speechBubbleTrns').remove();
1196 1206  
1197 1207 if ($scope.multiAnnotationIsON == true) {
1198   -
  1208 +
1199 1209 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1200 1210  
1201 1211 }
... ... @@ -1203,18 +1213,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1203 1213 if ($('#speechBubble').length > 0) {
1204 1214 $('#speechBubble').remove();
1205 1215  
1206   -
  1216 +
1207 1217 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1208 1218 }
1209 1219 else {
1210   -
  1220 +
1211 1221 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1212 1222 }
1213 1223  
1214 1224  
1215 1225 }
1216   - },false);
1217   -
  1226 + }, false);
  1227 +
1218 1228 var PI = Math.PI;
1219 1229 var PI2 = PI * 2;
1220 1230 var cw, ch, imgW, imgH, mouseX, mouseY;
... ... @@ -1225,21 +1235,40 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1225 1235 img.onload = start;
1226 1236  
1227 1237 img.src = src;
1228   -
  1238 +
1229 1239 function start() {
1230 1240 // debugger;
1231 1241 context.drawImage(img, 0, 0);
1232 1242 };
1233   -
  1243 +
1234 1244 document.getElementById('canvasDiv').appendChild(imgCanvas);
1235 1245  
1236 1246 }
1237 1247  
1238   - $scope.getLocationsForMatchedTermsInWholeBody = function (termNo, x, y)
1239   - {
1240   -
1241   - for (var x = 0; x < $scope.ColoredImageSRC.length; x++)
1242   - {
  1248 + $scope.highLightBodyBasedOnIcolor = function (RGBColor) {
  1249 +
  1250 + //2. Find Actul Term No Based on Icolor.
  1251 + var ActualTermNo = $scope.getActualTermNumber(RGBColor);
  1252 +
  1253 + //3. Find Term No List Based on ActualTermNo
  1254 + var TermList = $scope.getTermNumberList(ActualTermNo);
  1255 +
  1256 +
  1257 + //4.
  1258 +
  1259 + $scope.machedTermNoLocation = [];
  1260 + for (var i = 0; i < TermList.length; i++) {
  1261 +
  1262 + var termNumber = parseInt(TermList[i]._TermNumber);
  1263 +
  1264 + //Match Term No List in each bodyRegion
  1265 + $scope.getLocationsForMatchedTermsInWholeBody(termNumber);
  1266 + }
  1267 + }
  1268 +
  1269 + $scope.getLocationsForMatchedTermsInWholeBody = function (termNo) {
  1270 +
  1271 + for (var x = 0; x < $scope.ColoredImageSRC.length; x++) {
1243 1272 // alert('called for bodyRegionId: ' + $scope.MaskImageSRC[x].bodyRegionId);
1244 1273 var bodyRegionId = $scope.ColoredImageSRC[x].bodyRegionId;
1245 1274  
... ... @@ -1251,7 +1280,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1251 1280  
1252 1281 var coloredImg = $scope.ColoredImageSRC[x].SRC;
1253 1282  
1254   - var maskImg = $scope.GetMaskImageSource(coloredImg);
  1283 + var maskImg = $scope.GetMaskImageSource(coloredImg);
1255 1284  
1256 1285  
1257 1286 var scledX = $scope.ColoredImageSRC[x].x;
... ... @@ -1269,20 +1298,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1269 1298 }
1270 1299 var maskCanvas = document.getElementById(maskCanvasID);
1271 1300 var maskCanvasContext = maskCanvas.getContext("2d");
  1301 + debugger;
1272 1302 var maskImgData = maskCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
1273 1303  
1274 1304 // 2. get coloured canvas for this body region.
1275 1305  
1276   -
  1306 +
1277 1307 var coloredImageDataVar;
1278 1308 var coloredImageDataMRVar
1279 1309  
1280 1310 if ($scope.ColoredImageSRC[x].haveMirror == 'true') {
1281 1311  
1282   - coloredImageDataVar = $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)];
  1312 + coloredImageDataVar = $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)];
1283 1313 }
1284   - else
1285   - {
  1314 + else {
1286 1315 coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)];
1287 1316 }
1288 1317 var grayImageDataVar;
... ... @@ -1291,16 +1320,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1291 1320  
1292 1321 //// 3. get mask canvas for this body region._MR
1293 1322 var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
1294   - grayCanvas = document.getElementById(grayCanvasID);
  1323 + grayCanvas = document.getElementById(grayCanvasID);
1295 1324 var grayCanvasContext = grayCanvas.getContext("2d");
1296 1325 var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
1297   - grayImageDataVar = grayImageData.data;
  1326 + grayImageDataVar = grayImageData.data;
1298 1327 }
1299 1328  
1300   - else
1301   - {
  1329 + else {
1302 1330 var grayCanvasID = 'imageCanvas' + bodyRegionId;
1303   - grayCanvas = document.getElementById(grayCanvasID);
  1331 + grayCanvas = document.getElementById(grayCanvasID);
1304 1332 var grayCanvasContext = grayCanvas.getContext("2d");
1305 1333 var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight);
1306 1334 grayImageDataVar = grayImageData.data;
... ... @@ -1309,16 +1337,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1309 1337 var coloredImageDataVarMR;
1310 1338 var coloredImageDataMR
1311 1339  
1312   -
  1340 +
1313 1341 var counter = 0;
1314 1342  
1315 1343 var imageDataVar = maskImgData.data;
1316 1344  
1317   - // var p unhighlight reviousBRID;
1318   -
  1345 + // var previousBRID;
  1346 +
1319 1347 var counter = 0;
1320   -
1321   -
  1348 +
  1349 +
1322 1350 var n = maskImgData.data.length;
1323 1351  
1324 1352 for (var i = 0; i < n; i += 4) {
... ... @@ -1355,28 +1383,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1355 1383 }
1356 1384  
1357 1385 var Icolor = (Red + Green + Blue);
1358   -
  1386 + // alert('Icolor: ' + Icolor)
1359 1387  
1360 1388 if (parseInt(termNo) == parseInt(Icolor)) {
  1389 +
1361 1390 counter++;
1362   - console.log('matched')
1363 1391 var have = $scope.machedBodyRegion.indexOf(bodyRegionId);
1364 1392  
1365 1393  
1366   - if (have == -1)
1367   - {
  1394 + if (have == -1) {
1368 1395 $scope.machedBodyRegion.push(bodyRegionId);
1369 1396 }
1370   - else
1371   - {
1372   -
  1397 + else {
  1398 +
1373 1399 }
1374   -
  1400 +
1375 1401  
1376 1402 //previousGrayColoredData = i;
1377 1403 if (coloredImageDataVar != null) {
1378 1404  
1379   -
  1405 +
1380 1406 var RED_coloredImage = coloredImageDataVar[i];
1381 1407  
1382 1408 grayImageDataVar[i] = RED_coloredImage;
... ... @@ -1392,7 +1418,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1392 1418 var ALPHA_coloredImage = coloredImageDataVar[i + 3];
1393 1419 grayImageDataVar[i + 3] = ALPHA_coloredImage;
1394 1420  
1395   -
  1421 +
1396 1422 }
1397 1423  
1398 1424 }
... ... @@ -1498,7 +1524,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1498 1524  
1499 1525 //layer change function
1500 1526 $scope.LayerChange = function () {
1501   - // alert('layer chnage')
  1527 + // alert('layer chnage')
1502 1528  
1503 1529 var canvasDiv = document.getElementById('canvasDiv');
1504 1530 $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
... ... @@ -1564,7 +1590,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1564 1590 // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
1565 1591 if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
1566 1592 //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
1567   - // debugger;
  1593 + // debugger;
1568 1594 $scope.layerNumber = parseInt(txtlayerNumber.value);
1569 1595  
1570 1596  
... ... @@ -1599,9 +1625,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1599 1625  
1600 1626 $('#btnHighLight').removeClass('btn btn-black');
1601 1627 $('#btnHighLight').addClass('btn-primary');
1602   -
  1628 +
1603 1629 $timeout(function () { $scope.highLightBody() }, 350);
1604 1630  
  1631 +
  1632 +
1605 1633 }
1606 1634  
1607 1635 }
... ... @@ -1615,7 +1643,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1615 1643 //alert('Disabled wait cursor is done.See val :' + $rootScope.isLoading);
1616 1644 }
1617 1645  
1618   -
  1646 +
1619 1647 $scope.changeLayer = function () {
1620 1648 console.log('changeLayer');
1621 1649 // alert('slide')
... ... @@ -1638,16 +1666,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1638 1666 }
1639 1667 }
1640 1668  
1641   - $scope.createDynamicSpeechBubble= function (event, text, x, y)
1642   - {
  1669 + $scope.createDynamicSpeechBubble = function (event, text, x, y) {
1643 1670  
1644 1671 if (event.ctrlKey) {
1645 1672  
1646 1673 $scope.multiAnnotationIsON = true;
1647   -
  1674 +
1648 1675 $scope.i = $scope.i + 1;
1649   - // var a = $("#sppeachBubble").find('span').html();
1650   - // alert(a);
  1676 + // var a = $("#sppeachBubble").find('span').html();
  1677 + // alert(a);
1651 1678 var sub_id = "black" + $scope.i;
1652 1679 $("#canvasDiv").append("<div class='com'><div style='position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.i + "'></div><div data=" + $scope.i + " id=" + sub_id + " class='appendDragg' style='z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;width:200px;position:absolute;color:#000;text-align:left;font-size: 12px;background-color:#fff;font-weight:bold;left:" + x + "px;top:" + y + "px;'>" + text + "<div style='z-index:7000;position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.i + " class='dynCross' src='/AIA/content/images/speeachBubbleClose.png'></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.i + "'></div></div>");
1653 1680  
... ... @@ -1678,8 +1705,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1678 1705 $('.dynCross').on('click', function (evt) {
1679 1706 $(this).parent().parent().parent().css('display', 'none');
1680 1707  
1681   - // $("#bord").css("display", "none");
1682   - // $("#dot").css("display", "none");
  1708 + // $("#bord").css("display", "none");
  1709 + // $("#dot").css("display", "none");
1683 1710  
1684 1711  
1685 1712 });
... ... @@ -1688,22 +1715,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1688 1715 }
1689 1716  
1690 1717  
1691   - else
1692   - {
  1718 + else {
1693 1719 $scope.multiAnnotationIsON = false;
1694 1720  
1695 1721 $(".com").css("display", "none");
1696 1722 $("#bord").css({ "width": "0px", "display": "none" });
1697 1723 $('<div 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);" id="dot"></div>'
1698   - + '<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>'
  1724 + + '<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>'
1699 1725 + '<span style="position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;">'
1700 1726 + '<img class="crossDiv_temp" src="/AIA/content/images/speeachBubbleClose.png"></span></div>'
1701 1727  
1702 1728 + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord">'
1703 1729 + '</div>').appendTo('#canvasDiv');
1704 1730 var Globe = [];
1705   - Globe.push({ currentX: x, currentY: y});
1706   -
  1731 + Globe.push({ currentX: x, currentY: y });
  1732 +
1707 1733 document.getElementById('dot').style.display = 'block';
1708 1734 document.getElementById('dot').style.left = ((Globe[0].currentX) - 10) + 'px';
1709 1735 document.getElementById('dot').style.top = ((Globe[0].currentY) + 10) + 'px';
... ... @@ -1727,7 +1753,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1727 1753  
1728 1754 $('.crossDiv_temp').on('click', function (evt) {
1729 1755 $('#sppeachBubble').css('display', 'none');
1730   -
  1756 +
1731 1757 $("#bord").css("display", "none");
1732 1758 $("#dot").css("display", "none");
1733 1759  
... ... @@ -1773,7 +1799,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1773 1799  
1774 1800 }
1775 1801  
1776   -
  1802 +
1777 1803 $scope.angle = function (cx, cy, ex, ey) {
1778 1804  
1779 1805  
... ... @@ -1802,7 +1828,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1802 1828  
1803 1829  
1804 1830 }
1805   -
  1831 +
1806 1832  
1807 1833 $scope.createSpeechBubble = function (event, text, x, y) {
1808 1834 //set z index to make annoation speech buble on top others
... ... @@ -1824,7 +1850,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1824 1850  
1825 1851  
1826 1852 $scope.createTransparencyBox = function () {
1827   -
  1853 +
1828 1854 // debugger
1829 1855 // alert('transparency clcked')
1830 1856  
... ... @@ -1921,7 +1947,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1921 1947 function mouseUpListener(e) {
1922 1948 // $selection.remove();
1923 1949 // debugger;
1924   -
  1950 +
1925 1951 $scope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
1926 1952 $('.rectangle').remove();
1927 1953  
... ... @@ -2061,7 +2087,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2061 2087  
2062 2088 $('#btnTranparency').addClass('tButtonActive');
2063 2089 //debugger;
2064   - $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber))+1);
  2090 + $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1);
2065 2091 }
2066 2092  
2067 2093 $scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged) {
... ... @@ -2205,8 +2231,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2205 2231 //do nothing
2206 2232 }
2207 2233 else if (isLayerChanged) {
2208   - // debugger
  2234 + // debugger
2209 2235 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
  2236 +
2210 2237 }
2211 2238 else {
2212 2239 var currentLayer = parseInt($('#txtlayerNumber').val());
... ... @@ -2459,13 +2486,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2459 2486 PreviousBodyRegionX = XforTransImage;
2460 2487 previousBodyRegionId = bodyRegionId;
2461 2488  
2462   - // $scope.layerNumber = parseInt($scope.layerNumber - 1);
  2489 + // $scope.layerNumber = parseInt($scope.layerNumber - 1);
2463 2490  
2464 2491 }
2465 2492  
2466 2493 }
2467 2494  
2468   -
  2495 +
  2496 +
  2497 +
  2498 +
  2499 +
2469 2500 function resizeCanvas() {
2470 2501 //debugger;
2471 2502 // alert('reload')
... ... @@ -2905,7 +2936,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2905 2936 //var txtTransparencyChange = document.getElementById("txtTransparencyChange");
2906 2937 //txtTransparencyChange.value = 0;
2907 2938 // document.getElementById('txtLayerNumber').value = 0;
2908   - // debugger;
  2939 + // debugger;
2909 2940  
2910 2941  
2911 2942 $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.currentLayerNumber));
... ... @@ -2936,7 +2967,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2936 2967 //.remove();
2937 2968 $scope.layerNumber = $scope.currentLayerNumber;
2938 2969 $scope.transNumber = 50;
2939   - $('.slider').value= 50;
  2970 + $('.slider').value = 50;
2940 2971 }
2941 2972 $('#transparencyScale').css('visibility', 'hidden');
2942 2973  
... ... @@ -3014,20 +3045,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3014 3045 }
3015 3046  
3016 3047 }
3017   -
  3048 +
3018 3049 $scope.Zoom = function () {
3019 3050 $scope.flushCanvas();
3020 3051  
3021 3052 if ($scope.zoomInOut == 25) {
3022 3053 $scope.zoomInOut = 75;
3023   -
  3054 +
3024 3055 }
3025 3056 else {
3026 3057 $scope.zoomInOut = 25;
3027 3058 }
3028 3059  
3029 3060 $scope.CalculateImageCordinates($scope.viewOrientationId);
3030   - if($scope.zoomInOut==25)
  3061 + if ($scope.zoomInOut == 25)
3031 3062 $('#canvasDiv').scrollLeft(0)
3032 3063 else
3033 3064 $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
... ... @@ -3050,7 +3081,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3050 3081 }
3051 3082 else {
3052 3083 id = 'imageCanvas' + value.bodyRegionId;
3053   - maskId = 'imageCanvas' + value.bodyRegionId+'_mci';
  3084 + maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
3054 3085 }
3055 3086  
3056 3087 var canvas = document.getElementById(id);
... ... @@ -3074,104 +3105,109 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3074 3105 $scope.highLightBody();
3075 3106 }
3076 3107  
3077   -
3078 3108  
3079 3109 $scope.highLightBody = function () {
3080 3110  
3081   - angular.forEach($scope.ColoredImageSRC, function (value, key) {
3082 3111  
  3112 + if ($rootScope.isHighLight == true) {
3083 3113  
3084   - var id;
3085   - if (value.haveMirror == 'true') {
3086   - id = 'imageCanvas' + value.bodyRegionId + '_MR';
3087   - }
3088   - else {
3089   - id = 'imageCanvas' + value.bodyRegionId;
3090   - }
  3114 + angular.forEach($scope.ColoredImageSRC, function (value, key) {
  3115 + var id;
  3116 + if (value.haveMirror == 'true') {
  3117 + id = 'imageCanvas' + value.bodyRegionId + '_MR';
  3118 + }
  3119 + else {
  3120 + id = 'imageCanvas' + value.bodyRegionId;
  3121 + }
3091 3122  
3092   - var imageCanvas = document.getElementById(id);
  3123 + var imageCanvas = document.getElementById(id);
3093 3124  
3094   - //var coloredCanvasID = 'imageCanvas' + bodyRegionId;
3095   - //var coloredCanvas = document.getElementById(coloredCanvasID);
  3125 + //var coloredCanvasID = 'imageCanvas' + bodyRegionId;
  3126 + //var coloredCanvas = document.getElementById(coloredCanvasID);
3096 3127  
3097   - var width = value.Width;
3098   - var ht = value.Height;
  3128 + var width = value.Width;
  3129 + var ht = value.Height;
3099 3130  
3100   - var coloredCanvasContext = imageCanvas.getContext("2d");
3101   - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
3102   - var coloredImageDataVar = coloredImageData.data;
3103   -
3104   -
3105   - if (value.haveMirror == 'true') {
3106   - $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
3107   - }
3108   - else
3109   - {
3110   - //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
  3131 + var coloredCanvasContext = imageCanvas.getContext("2d");
  3132 + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht);
  3133 + var coloredImageDataVar = coloredImageData.data;
3111 3134  
3112   - $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
3113   - }
3114 3135  
  3136 + if (value.haveMirror == 'true') {
  3137 + $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
  3138 + }
  3139 + else {
  3140 + //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
3115 3141  
3116   - //$rootScope.coloredImageCanvasList.push(parts);
3117   -
3118   -
  3142 + $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
  3143 + }
3119 3144  
3120   - var context_gray = imageCanvas.getContext('2d');
3121 3145  
  3146 + //$rootScope.coloredImageCanvasList.push(parts);
3122 3147  
3123   - var dataURL = imageCanvas.toDataURL();
3124 3148  
3125 3149  
3126   - var img = new Image();
3127   - img.src = dataURL;
  3150 + var context_gray = imageCanvas.getContext('2d');
3128 3151  
3129   -
3130   - img.onload = function () {
3131   - console.log(Math.max(img.width) + ', ' + Math.max(img.height))
3132 3152  
3133   - var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
3134   - DAData.draw(img);
3135   - var RED = 0.3086; // luminance contrast value for red
3136   - var GREEN = 0.694; // luminance contrast value for green
3137   - var BLUE = 0.0820; // luminance contrast value for blue
  3153 + var dataURL = imageCanvas.toDataURL();
3138 3154  
3139   - var RGB = [RED, GREEN, BLUE, 0, 0];
3140   - var RGB2 = [RED, GREEN, BLUE, 0, 0];
3141   - var RGB3 = [RED, GREEN, BLUE, 0, 0];
3142   - var ALPHA = [0, 0, 0, 1, 0];
3143 3155  
3144   - var rgbPx = RGB.concat(RGB2);
3145   - var rgbPx2 = rgbPx.concat(RGB3);
3146   - var matrix = rgbPx2.concat(ALPHA);
  3156 + var img = new Image();
  3157 + img.src = dataURL;
3147 3158  
3148   - var zeroPoint = new Point();
3149   - var grayScale = new ColorMatrixFilter(matrix);
3150   - DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
3151 3159  
3152   - context_gray.putImageData(DAData.data, 0, 0)
  3160 + img.onload = function () {
  3161 + console.log(Math.max(img.width) + ', ' + Math.max(img.height))
3153 3162  
3154   - var grayImageData = context_gray.getImageData(0, 0, width, ht);
3155   - var grayImageImageDataVar = grayImageData.data;
  3163 + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
  3164 + DAData.draw(img);
  3165 + var RED = 0.3086; // luminance contrast value for red
  3166 + var GREEN = 0.694; // luminance contrast value for green
  3167 + var BLUE = 0.0820; // luminance contrast value for blue
3156 3168  
3157   - if (value.haveMirror == 'true') {
3158   - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
3159   - }
3160   - else {
3161   - //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
  3169 + var RGB = [RED, GREEN, BLUE, 0, 0];
  3170 + var RGB2 = [RED, GREEN, BLUE, 0, 0];
  3171 + var RGB3 = [RED, GREEN, BLUE, 0, 0];
  3172 + var ALPHA = [0, 0, 0, 1, 0];
  3173 +
  3174 + var rgbPx = RGB.concat(RGB2);
  3175 + var rgbPx2 = rgbPx.concat(RGB3);
  3176 + var matrix = rgbPx2.concat(ALPHA);
  3177 +
  3178 + var zeroPoint = new Point();
  3179 + var grayScale = new ColorMatrixFilter(matrix);
  3180 + DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
  3181 +
  3182 + context_gray.putImageData(DAData.data, 0, 0)
  3183 +
  3184 + var grayImageData = context_gray.getImageData(0, 0, width, ht);
  3185 + var grayImageImageDataVar = grayImageData.data;
3162 3186  
3163   - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  3187 + if (value.haveMirror == 'true') {
  3188 + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  3189 + }
  3190 + else {
  3191 + //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
  3192 +
  3193 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  3194 + }
3164 3195 }
3165   - }
3166 3196  
3167   - });
  3197 + });
3168 3198  
3169   - // alert('length: '+ $scope.coloredImageCanvasList.length);
  3199 + // alert('length: '+ $scope.coloredImageCanvasList.length);
3170 3200  
3171   - }
  3201 + }
  3202 +
  3203 + if ($scope.previousSelectedTermList.length > 0) {
  3204 + for (var i = 0; i < $scope.previousSelectedTermList.length; i++) {
  3205 + $scope.highLightBodyBasedOnIcolor($scope.previousSelectedTermList[i]);
3172 3206  
3173   - $scope.applyGrayMatrix = function (img, context_gray)
3174   - {
  3207 + }
  3208 + }
  3209 + }
  3210 + $scope.applyGrayMatrix = function (img, context_gray) {
3175 3211 var DAData = new BitmapData(img.width, img.height);
3176 3212 DAData.draw(img);
3177 3213 var RED = 0.3086; // luminance contrast value for red
... ... @@ -3216,14 +3252,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3216 3252  
3217 3253  
3218 3254 $scope.OnGenderChange = function (event) {
3219   -
  3255 +
3220 3256 //use $scope.correspondingBodyViewIds for getting correspnding viewid
3221 3257 // alert('gender changed= ' + event.currentTarget.attributes[1].value)
3222 3258  
3223 3259 // $(".enableGender li").removeClass("active");
3224 3260 // $(event.currentTarget.attributes[2].value).parent().addClass("active");
3225   -
3226   - var viewname= localStorage.getItem("currentViewTitle")
  3261 +
  3262 + var viewname = localStorage.getItem("currentViewTitle")
3227 3263 var currentBodyViewId = $scope.correspondingBodyViewIds[$scope.voId];
3228 3264  
3229 3265 if ((event.currentTarget.attributes[1].value == 'Male') && (localStorage.getItem("genderId") == 'Female')) {
... ... @@ -3244,7 +3280,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3244 3280  
3245 3281  
3246 3282 $scope.loadSelectedBodyView(currentBodyViewId)
3247   - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male','Female');
  3283 + $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female');
3248 3284  
3249 3285 $rootScope.isLoading = true;
3250 3286  
... ... @@ -3263,7 +3299,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3263 3299 }
3264 3300  
3265 3301  
3266   - $scope.voId = currentBodyViewId;
  3302 + $scope.voId = currentBodyViewId;
3267 3303  
3268 3304 var layerJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_layer_' + currentBodyViewId + '.json';
3269 3305  
... ... @@ -3305,10 +3341,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3305 3341 }
3306 3342  
3307 3343 $scope.OnViewChange = function (event) {
3308   -
  3344 +
3309 3345  
3310 3346 $scope.layerNumber = 0;
3311   - // debugger;
  3347 + // debugger;
3312 3348 var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
3313 3349 $scope.viewOrientationId = selectedViewId;
3314 3350 if (localStorage.getItem("genderId") == 'Male') {
... ... @@ -3328,7 +3364,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3328 3364  
3329 3365  
3330 3366 //set selected view name as the title of jspanel
3331   - // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") +" "+ event.currentTarget.attributes[1].value;
  3367 + // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") +" "+ event.currentTarget.attributes[1].value;
3332 3368  
3333 3369 }
3334 3370 else {
... ... @@ -3348,10 +3384,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3348 3384 };
3349 3385  
3350 3386  
3351   - // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + $scope.bodyViews[event.currentTarget.attributes[1].value;
  3387 + // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + $scope.bodyViews[event.currentTarget.attributes[1].value;
3352 3388  
3353 3389 }
3354   - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") +" "+ event.currentTarget.attributes[1].value;
  3390 + $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value;
3355 3391 localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value);
3356 3392 }
3357 3393  
... ... @@ -3370,7 +3406,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3370 3406 paintCanvas.style.left = 0 + 'px';
3371 3407 paintCanvas.style.top = 0 + 'px';
3372 3408 // paintCanvas.className = 'col-lg-12';
3373   - paintCanvas.style.backgroundColor = 'yellow';
  3409 + paintCanvas.style.backgroundColor = 'yellow';
3374 3410 paintCanvas.style.zIndex = '1100'
3375 3411 //this is to get annoatation while annotation window is open
3376 3412 paintCanvas.addEventListener('click', OnPaintCanvasClick);
... ... @@ -3397,7 +3433,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3397 3433 var ctx;
3398 3434  
3399 3435 function OnPaintCanvasMouseDown(event) {
3400   -
  3436 +
3401 3437 if ($rootScope.isDrawingToolSelected == true) {
3402 3438  
3403 3439  
... ... @@ -3416,7 +3452,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3416 3452  
3417 3453 }
3418 3454 else
3419   - document.getElementById('paintCanvas').addEventListener('mousemove', OnPaintCanvasMouseMove, false)
  3455 + document.getElementById('paintCanvas').addEventListener('mousemove', OnPaintCanvasMouseMove, false)
3420 3456  
3421 3457 }
3422 3458 //ctx.moveTo(50, 50);
... ... @@ -3448,7 +3484,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3448 3484 if ($scope.mousePressed) {
3449 3485 var mousePos = $scope.getMousePos(event)
3450 3486  
3451   - $rootScope.Draw(mousePos.x, mousePos.y, true,$scope.paintCanvasContext);
  3487 + $rootScope.Draw(mousePos.x, mousePos.y, true, $scope.paintCanvasContext);
3452 3488 }
3453 3489 }
3454 3490 }
... ... @@ -3456,32 +3492,32 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3456 3492  
3457 3493  
3458 3494  
3459   -// $scope.Draw=function(x, y, isDown) {
3460   -// if (isDown) {
3461   -// $scope.paintCanvasContext.beginPath();
3462   -// $scope.paintCanvasContext.strokeStyle = '#000000';
3463   -// $scope.paintCanvasContext.lineWidth = 1//$('#selWidth').val();
3464   -// $scope.paintCanvasContext.lineJoin = "round";
3465   -// $scope.paintCanvasContext.moveTo($scope.lastX, $scope.lastY);
3466   -// $scope.paintCanvasContext.lineTo(x, y);
3467   -// $scope.paintCanvasContext.closePath();
3468   -// $scope.paintCanvasContext.stroke();
3469   -// }
3470   -// $scope.lastX = x; $scope.lastY = y;
3471   -//}
  3495 + // $scope.Draw=function(x, y, isDown) {
  3496 + // if (isDown) {
  3497 + // $scope.paintCanvasContext.beginPath();
  3498 + // $scope.paintCanvasContext.strokeStyle = '#000000';
  3499 + // $scope.paintCanvasContext.lineWidth = 1//$('#selWidth').val();
  3500 + // $scope.paintCanvasContext.lineJoin = "round";
  3501 + // $scope.paintCanvasContext.moveTo($scope.lastX, $scope.lastY);
  3502 + // $scope.paintCanvasContext.lineTo(x, y);
  3503 + // $scope.paintCanvasContext.closePath();
  3504 + // $scope.paintCanvasContext.stroke();
  3505 + // }
  3506 + // $scope.lastX = x; $scope.lastY = y;
  3507 + //}
3472 3508  
3473 3509 //body highlight options functinality
3474 3510 $scope.LoadBodySystemList = function () {
3475   -
  3511 +
3476 3512 var currentBodyViewId = $scope.voId;
3477 3513 var systemListHtml = '<ul class="dropdown-menu" aria-labelledby="dropdownMenu2"><li><a href="#" title="Current Structure">Current Structure</a></li> <li role="separator" class="divider"></li>'
3478 3514 var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item;
3479 3515  
3480 3516 angular.forEach(systemList, function (value, key) {
3481   -
  3517 +
3482 3518 systemListHtml = systemListHtml + '<li><a href="#" id="' + value._BodySystemId + '" title="' + value._Name + '">' + value._Name + '</a></li>'
3483 3519 })
3484   -
  3520 +
3485 3521 systemListHtml = systemListHtml + '</ul>';
3486 3522 $('#bodySystem').append(systemListHtml);
3487 3523  
... ... @@ -3491,7 +3527,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3491 3527 function (result) {
3492 3528  
3493 3529 $rootScope.BodySystemData = result;
3494   -
  3530 +
3495 3531 },
3496 3532 function (error) {
3497 3533 console.log(error.statusText)
... ... @@ -3501,21 +3537,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3501 3537 }
3502 3538  
3503 3539 $scope.HighlightBodysystem = function (event) {
3504   - var systemMatchedTermList = new jinqJs()
3505   - .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
3506   - .where('_SystemNumber == ' + event.currentTarget.id)
3507   - .select();
3508   - debugger;
  3540 + var systemMatchedTermList = new jinqJs()
  3541 + .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
  3542 + .where('_SystemNumber == ' + event.currentTarget.id)
  3543 + .select();
  3544 +
3509 3545 //color the body gray
3510   - $scope.highLightBody();
  3546 + $rootScope.isHighLight =true
  3547 + $scope.highLightBody();
3511 3548 //now highlight the selected body system in whole body
3512   - for (var i = 0; i < systemMatchedTermList.length; i++) {
3513 3549  
3514   - var termNumber = parseInt(systemMatchedTermList[i]._TermNumber);
  3550 + var termNumber = parseInt(systemMatchedTermList[0]._TermNumber);
  3551 +
  3552 + //Match Term No List in each bodyRegion
  3553 + $scope.getLocationsForMatchedTermsInWholeBody(termNumber, 0, 0);
  3554 + //for (var i = 0; i < systemMatchedTermList.length; i++) {
3515 3555  
3516   - //Match Term No List in each bodyRegion
3517   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber, 0, 0);
3518   - }
  3556 + // var termNumber = parseInt(systemMatchedTermList[i]._TermNumber);
  3557 +
  3558 + // //Match Term No List in each bodyRegion
  3559 + // $scope.getLocationsForMatchedTermsInWholeBody(termNumber, 0, 0);
  3560 + //}
3519 3561 }
3520 3562  
3521 3563 }]
... ...