EZvDatatip.m 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. % EZvDatatip 230802 attempting to fix for R2023a
  2. % Calls to EZdestComp.m EZmDayTrend.m
  3. global ghandles
  4. global Exp
  5. global zonePB
  6. RFcmpGFlg=0; %Test 180105 as it goes to EZmDayTrend.m
  7. lstBoxCmpFlg=0;
  8. curKey=get(gcf,'currentkey')
  9. htMapFg=0;
  10. if ghandles.Iaxes1==get(htargetAxes,'Parent'),expN=1;
  11. elseif ghandles.Iaxes2==get(htargetAxes,'Parent'),expN=2;
  12. elseif ghandles.Iaxes3==get(htargetAxes,'Parent'),expN=3;
  13. elseif ghandles.OLaxes1==get(htargetAxes,'Parent'),OLay=1; expN=1; %zone=1; datacursormode off;
  14. elseif ghandles.OLaxes2==get(htargetAxes,'Parent'),OLay=2; expN=2; %zone=2; datacursormode off;
  15. elseif ghandles.OLaxes3==get(htargetAxes,'Parent'),OLay=3; expN=3; %zone=3; datacursormode off;
  16. elseif ghandles.HtMap1==get(htargetAxes,'Parent'),expN=1; htMapFg=1;
  17. elseif ghandles.HtMap2==get(htargetAxes,'Parent'),expN=2; htMapFg=1;
  18. elseif ghandles.HtMap3==get(htargetAxes,'Parent'),expN=3; htMapFg=1;
  19. else
  20. return
  21. end
  22. if expN==1,DexpN=(get(ghandles.DN1,'value')); end
  23. if expN==2,DexpN=(get(ghandles.DN2,'value')); end
  24. if expN==3,DexpN=(get(ghandles.DN3,'value')); end
  25. % Exp(expN).DexpN=DexpN;
  26. if strcmp(Exp(expN).DexpType,'single'), DexpN=1; end
  27. if exist('OLay','var'), clear ExpN; end
  28. if ~exist('OLay','var')
  29. try
  30. ImageSel=expN<4
  31. destPerMP=Exp(expN).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
  32. MPsel=Exp(expN).Dexp(DexpN).MPsel; %floor(get(handles.MPsldr1,'value'));
  33. pertSel=Exp(expN).Dexp(DexpN).pertSel; %floor(get(handles.DMsldr1,'value'));
  34. tPtSel=Exp(expN).Dexp(DexpN).tPtSel; %floor(get(handles.Tptsldr1,'value'));
  35. plateNum=Exp(expN).Dexp(DexpN).plateNum; %(MPsel1-1)*destPerMP1 + pertSel1;
  36. scan=Exp(expN).Dexp(DexpN).scan;
  37. MP=Exp(expN).Dexp(DexpN).MP;
  38. ptrPos=[cpos(1),cpos(2)]; %for VerticleImage
  39. if htMapFg==0 %Comes from spot image Iaxes
  40. try
  41. for m=1:24
  42. for n=1:16
  43. coord=Exp(expN).Dexp(DexpN).FexpScanSpots{plateNum}{m,n,tPtSel}; %replace {1} with {plateNum}
  44. if ptrPos(2)> coord(1) && ptrPos(2)< coord(3)
  45. if ptrPos(1)> coord(2) && ptrPos(1)<coord(4)
  46. picLoc1=[n,m];
  47. spotFrm=Exp(expN).Dexp(DexpN).FexpScanSpots{plateNum}{m,n,tPtSel}; %20160108
  48. end
  49. end
  50. end
  51. end
  52. destcompMsg='GoodDataTip';
  53. catch
  54. destcompMsg='BadDataTip';
  55. m
  56. n
  57. end
  58. plateLoc=[(17-picLoc1(1)) picLoc1(2)];
  59. indx=(plateLoc(1)-1)*24+plateLoc(2);
  60. elseif htMapFg==1 %Comes from HeatMap image Haxes
  61. plateLoc=ptrPos;
  62. indx=(plateLoc(1)-1)*24+plateLoc(2);
  63. end
  64. Exp(expN).Dexp(DexpN).spotIndx=indx;
  65. K=scan(1,plateNum).plate(1).CFout(indx,3); Ks=num2str(K);
  66. r=scan(1,plateNum).plate(1).CFout(indx,4); rs=num2str(r);
  67. l=scan(1,plateNum).plate(1).CFout(indx,5); Ls=num2str(l);
  68. try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end
  69. try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end
  70. try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end
  71. Kl=scan(1,plateNum).plate(1).CFout(indx,7);
  72. Ku=scan(1,plateNum).plate(1).CFout(indx,8);
  73. rl=scan(1,plateNum).plate(1).CFout(indx,9);
  74. ru=scan(1,plateNum).plate(1).CFout(indx,10);
  75. lfast=scan(1,plateNum).plate(1).CFout(indx,11);
  76. lslow=scan(1,plateNum).plate(1).CFout(indx,12);
  77. t=1:200;
  78. clear g;
  79. try
  80. g=K ./ (1 + exp(-r.* (t - l )));
  81. gSlow=Kl ./ (1 + exp(-rl.* (t - lslow )));
  82. gFast=Ku ./ (1 + exp(-ru.* (t - lfast )));
  83. if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end
  84. tser=(scan(1,plateNum).plate(1).t0Series(:));
  85. rawData=scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx);
  86. if expN==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
  87. Exp(1).traceN=Exp(1).traceN+1;
  88. traceN=Exp(1).traceN;
  89. end
  90. if expN==2, plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;
  91. Exp(2).traceN=Exp(2).traceN+1;
  92. traceN=Exp(2).traceN;
  93. end
  94. if expN==3, plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;
  95. Exp(3).traceN=Exp(3).traceN+1;
  96. traceN=Exp(3).traceN;
  97. end
  98. plot(plotAxes,t,g);hold(plotAxes,'on');
  99. plot(plotAxes,tser,rawData,'g*');
  100. plot(plotAxes,t,gSlow,'y');plot(plotAxes,t,gFast,'r');
  101. hold(plotAxes,'off');
  102. try
  103. for i=1:length(Exp(expN).hOL(:)),set(Exp(expN).hOL(i),'color',[0 0 1]); end, catch, end %ZoneRelated
  104. if verLessThan('matlab','8.4')
  105. else % accomodate new matlab changes after 2014a fix 23_0807
  106. tempFig=figure;
  107. end
  108. Exp(expN).hOL(traceN)=plot(OLaxes,t,g);hold on;
  109. set(Exp(expN).hOL(traceN),'color',[1 0 0])
  110. Exp(expN).hOLb(traceN)=plot(OLaxes,tser,rawData,'g*');
  111. % Added for Composite Plot utility [C] 170419
  112. Exp(expN).ll(traceN)=l; Exp(expN).rr(traceN)=r; Exp(expN).kk(traceN)=K;
  113. if verLessThan('matlab','8.4')
  114. else % accomodate new matlab changes after 2014a fix update 23_0807
  115. close(tempFig)
  116. end
  117. catch
  118. %{
  119. g=K ./ (1 + exp(-r.* (t - l )));
  120. if K==0||r==0||l==0, g(1:200)=1;end
  121. tser=(scan(1,plateNum).plate(1).t0Series(:));
  122. rawData=scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx);
  123. plot(plotAxes, plot(t,g),hold on,plot(tser,rawData,'g*'),hold off);
  124. plot(OLaxes, plot(t,g),hold on,plot(tser,rawData,'g*');
  125. %}
  126. end
  127. % Get the DM agar description
  128. if expN==1,DMstr=char(get(ghandles.DM1,'string'));end
  129. if expN==2,DMstr=char(get(ghandles.DM2,'string'));end
  130. if expN==3,DMstr=char(get(ghandles.DM3,'string'));end
  131. gene=MP(1,MPsel).genename{1,1}(indx); orf=MP(1,MPsel).orf{1,1}(indx);
  132. spec=MP(1,MPsel).specifics{1,1}(indx); % orfrep=MP(1,plateNum).orfRep{1,1}(indx);
  133. tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
  134. geneOrfstr=strcat(gene,'_',orf,'_','r',num2str(plateLoc(1)),'c',num2str(plateLoc(2)),'_',tPtStr);
  135. grfgenestr=strcat(gene,'_',orf,'_','r',num2str(plateLoc(1)),'c',num2str(plateLoc(2)));
  136. selGnOrf=grfgenestr; % added for EZdestComp.m and EZmDayTrend.m
  137. graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
  138. spotDescrip=strcat(graphStr,'->',DMstr);
  139. xp=char(Exp(expN).Dexp(DexpN).resDir);
  140. if ispc,
  141. slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'\');
  142. else
  143. slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'/');
  144. end
  145. startPos=slashPos(length(slashPos)-2) +1;
  146. endPos=(slashPos(length(slashPos)) -1);
  147. expStr={xp(startPos:endPos)};
  148. Exp(expN).hOLname(traceN)=spotDescrip; % ZoneRelated %graphStr; %ghandles.Exp(expN).hOLname(traceN)=graphStr;
  149. Exp(expN).hOLexpNm(traceN)=expStr; % ghandles.Exp(expN).hOLexpNm(traceN)=expStr;
  150. Exp(expN).hOLresDir(traceN)={Exp(expN).Dexp(DexpN).resDir};
  151. Exp(expN).hOLplateNum(traceN)=plateNum;
  152. % traceData=vertcat(get(Exp(OLay).hOL(traceN),'XData'),get(ghandles.Exp(OLay).hOL(traceN),'YData'));
  153. if expN==1,set(ghandles.GeneOrfLoc1,'string',geneOrfstr);end % Displays the value.
  154. if expN==2,set(ghandles.GeneOrfLoc2,'string',geneOrfstr);end
  155. if expN==3,set(ghandles.GeneOrfLoc3,'string',geneOrfstr);end
  156. if expN==1,set(ghandles.graphStrLoc1,'string',spotDescrip);end % graphStr);end % Displays the value.
  157. if expN==2,set(ghandles.graphStrLoc2,'string',spotDescrip);end % graphStr);end
  158. if expN==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end % graphStr);end
  159. try
  160. if expN==1, %&& get(ghandles.rotPB1,'value')~=1
  161. try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay1,'FontSize',8);end, catch end
  162. set(ghandles.OLay1,'string', Exp(expN).hOLname(traceN));
  163. try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch end
  164. set(ghandles.OLexp1,'string',Exp(expN).hOLexpNm(traceN));
  165. end
  166. if expN==2 %&& get(ghandles.rotPB2,'value') ~=1
  167. try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch end
  168. set(ghandles.OLay2,'string', Exp(expN).hOLname(traceN));
  169. try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch end
  170. set(ghandles.OLexp2,'string',Exp(expN).hOLexpNm(traceN));
  171. end
  172. if expN==3 %&& get(ghandles.rotPB3,'value') ~=1
  173. try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch end
  174. set(ghandles.OLay3,'string', Exp(expN).hOLname(traceN));
  175. try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch end
  176. set(ghandles.OLexp3,'string',Exp(expN).hOLexpNm(traceN));
  177. end
  178. catch
  179. end
  180. %{
  181. if expN==1
  182. zonesel=1;
  183. set(ghandles.zoneRad1,'value',1)
  184. set(ghandles.zoneRad2,'value',0)
  185. set(ghandles.zoneRad3,'value',0)
  186. orfLstSel=get(ghandles.GeneOrfTog,'value');
  187. if orfLstSel==1
  188. set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
  189. else
  190. set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
  191. end
  192. end
  193. if expN==2
  194. zonesel=2;
  195. set(ghandles.zoneRad2,'value',1)
  196. set(ghandles.zoneRad1,'value',0)
  197. set(ghandles.zoneRad3,'value',0)
  198. orfLstSel=get(ghandles.GeneOrfTog,'value');
  199. if orfLstSel==1
  200. set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
  201. else
  202. set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
  203. end
  204. end
  205. if expN==3
  206. zonesel=3;
  207. set(ghandles.zoneRad3,'value',1)
  208. set(ghandles.zoneRad2,'value',0)
  209. set(ghandles.zoneRad1,'value',0)
  210. orfLstSel=get(ghandles.GeneOrfTog,'value');
  211. if orfLstSel==1
  212. set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)
  213. else
  214. set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
  215. end
  216. end
  217. %}
  218. % Zone PB set here as replacement for zonePB radio buttons 230815
  219. if expN==1
  220. zonesel=1;
  221. zonePB=expN;
  222. set(ghandles. zonePB1,'value',1)
  223. set(ghandles. zonePB2,'value',0)
  224. set(ghandles. zonePB3,'value',0)
  225. set(ghandles.zonePB1,'BackgroundColor',[1.0 0.6 0.6])
  226. set(ghandles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
  227. set(ghandles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
  228. orfLstSel=get(ghandles.GeneOrfTog,'value');
  229. if orfLstSel==1
  230. set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
  231. else
  232. set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
  233. end
  234. end
  235. if expN==2
  236. zonesel=2;
  237. zonePB=expN;
  238. set(ghandles. zonePB2,'value',1)
  239. set(ghandles. zonePB1,'value',0)
  240. set(ghandles. zonePB3,'value',0)
  241. set(ghandles.zonePB2,'BackgroundColor',[1.0 0.6 0.6])
  242. set(ghandles.zonePB1,'BackgroundColor',[1.0 1.0 1.0])
  243. set(ghandles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
  244. orfLstSel=get(ghandles.GeneOrfTog,'value');
  245. if orfLstSel==1
  246. set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
  247. else
  248. set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
  249. end
  250. end
  251. if expN==3
  252. zonesel=3;
  253. zonePB=expN;
  254. set(ghandles. zonePB3,'value',1)
  255. set(ghandles. zonePB2,'value',0)
  256. set(ghandles. zonePB1,'value',0)
  257. set(ghandles.zonePB3,'BackgroundColor',[1.0 0.6 0.6])
  258. set(ghandles.zonePB1,'BackgroundColor',[1.0 1.0 1.0])
  259. set(ghandles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
  260. orfLstSel=get(ghandles.GeneOrfTog,'value');
  261. if orfLstSel==1
  262. set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)
  263. else
  264. set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
  265. end
  266. end
  267. Exp(expN).Trace(traceN).UsrGLB=geneOrfstr;
  268. Exp(expN).Trace(traceN).dmSel=pertSel;
  269. Exp(expN).Trace(traceN).DexpN=DexpN;
  270. Exp(expN).Trace(traceN).Dexp(DexpN).DM(pertSel).UsrLvals=l;
  271. Exp(expN).Trace(traceN).Dexp(DexpN).DM(pertSel).UsrKvals=K;
  272. Exp(expN).Trace(traceN).Dexp(DexpN).DM(pertSel).Usrrvals=r;
  273. catch
  274. msg='NotImage'
  275. end
  276. end
  277. % Write Selected Trace Info to OLAY header
  278. try
  279. OLayTest=OLay<4
  280. msg='OLay'
  281. % make all traces blue
  282. for i=1:length(Exp(OLay).hOL(:))
  283. try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch end
  284. end
  285. % if get(ghandles.rotPB1,'value')~=1,
  286. for i=1:length(Exp(OLay).hOL(:))
  287. htargetAxes
  288. Exp(OLay).hOL(i)
  289. if htargetAxes==Exp(OLay).hOL(i)
  290. if OLay==1 && get(ghandles.rotPB1,'value')~=1,
  291. set(htargetAxes,'color',[1 0 0])
  292. try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
  293. set(ghandles.OLay1,'string', Exp(OLay).hOLname(i));
  294. traceLab=char(Exp(OLay).hOLname(i));
  295. try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
  296. set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(i));
  297. OLresDir=Exp(OLay).hOLresDir(i);
  298. Exp(OLay).hOLplateNum(i)=Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
  299. plateNum=Exp(expN).Dexp(DexpN).plateNum
  300. OLplateNum=Exp(OLay).hOLplateNum(i);
  301. seltraceN=i;
  302. end
  303. if OLay==2 && get(ghandles.rotPB2,'value') ~=1
  304. set(htargetAxes,'color',[1 0 0])
  305. try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
  306. set(ghandles.OLay2,'string', Exp(OLay).hOLname(i));
  307. traceLab=char(Exp(OLay).hOLname(i));
  308. try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
  309. set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(i));
  310. OLresDir=Exp(OLay).hOLresDir(i);
  311. Exp(OLay).hOLplateNum(i)=Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
  312. plateNum=Exp(expN).Dexp(DexpN).plateNum
  313. OLplateNum=Exp(OLay).hOLplateNum(i);
  314. seltraceN=i;
  315. end
  316. if OLay==3 && get(ghandles.rotPB3,'value') ~=1
  317. set(htargetAxes,'color',[1 0 0])
  318. try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
  319. set(ghandles.OLay3,'string', Exp(OLay).hOLname(i));
  320. traceLab=char(Exp(OLay).hOLname(i));
  321. try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
  322. set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(i));
  323. OLresDir=Exp(OLay).hOLresDir(i);
  324. Exp(OLay).hOLplateNum(i)=Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
  325. plateNum=Exp(expN).Dexp(DexpN).plateNum
  326. OLplateNum=Exp(OLay).hOLplateNum(i);
  327. seltraceN=i;
  328. end
  329. Exp(OLay).seltraceN=seltraceN;
  330. else
  331. msg='Cant Find trace'
  332. end
  333. end
  334. % Extract row and col values from stored trace label for dest compare plots(EZdestComp)
  335. % if a RFcmp_ is selected Need alternate method.
  336. % if the Composite button is active, Need yet another method.
  337. try
  338. tracename=char(Exp(OLay).hOLname(seltraceN))
  339. pos_=strfind(tracename,'_')
  340. rxcy=tracename(pos_(2):pos_(3))
  341. cindx=strfind(rxcy,'c')
  342. rindx=strfind(rxcy,'r')
  343. LBr=str2num(rxcy((rindx+1):cindx-1))
  344. LBc=str2num(tracename((pos_(2)+cindx): pos_(3)-1))
  345. indx=((LBr-1)*24) +LBc
  346. grfgenestr=tracename(1:pos_(3)-1)
  347. scan=Exp(OLay).Dexp(DexpN).scan;
  348. EZdatatip=2;
  349. try
  350. tracename=char(Exp(OLay).hOLname(seltraceN))
  351. EZdatatip=2;
  352. catch
  353. end
  354. catch
  355. msg='Not from an OLay selected trace'
  356. end
  357. catch
  358. msg='Not in OLay frame-axis 0'
  359. end
  360. % Hide selected plot trace: rotPBx used for 'Hide'
  361. try
  362. OLayTest=OLay<4
  363. msg='OLay'
  364. OLay
  365. if get(ghandles.rotPB1,'value') ==1 && OLay==1,
  366. % make all traces blue
  367. for i=1:length(Exp(OLay).hOL(:))
  368. set(Exp(OLay).hOL(i),'color',[0 0 1])
  369. end
  370. for i=1:length(Exp(OLay).hOL(:))
  371. if htargetAxes==Exp(OLay).hOL(i)
  372. hidAx1traceN=i
  373. set(Exp(OLay).hOL(i),'Visible','off')
  374. set(Exp(OLay).hOLb(i),'Visible','off')
  375. for j=1:length(Exp(OLay).hOL(:))
  376. if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN=j; end
  377. end
  378. end
  379. if htargetAxes==Exp(OLay).hOL(i), break;end
  380. end
  381. set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
  382. set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
  383. if OLay==1
  384. try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
  385. set(ghandles.OLay1,'string', Exp(OLay).hOLname(maxhN));
  386. traceLab=char(Exp(OLay).hOLname(maxhN));
  387. try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
  388. set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(maxhN));
  389. OLresDir=Exp(OLay).hOLresDir(maxhN);
  390. OLplateNum=Exp(OLay).hOLplateNum(maxhN);
  391. end
  392. end
  393. % Hide
  394. if get(ghandles.rotPB2,'value')==1 && OLay==2, %
  395. for j=1:length(Exp(OLay).hOL(:)) %Set all traces blue
  396. try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch, end
  397. end
  398. for i=1:length(Exp(OLay).hOL(:))
  399. if htargetAxes==Exp(OLay).hOL(i)
  400. hidAx2traceN=i
  401. set(Exp(OLay).hOL(i),'Visible','off')
  402. set(Exp(OLay).hOLb(i),'Visible','off')
  403. for j=1:length(Exp(OLay).hOL(:))
  404. try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN=j; end, catch end
  405. end
  406. end
  407. if htargetAxes==Exp(OLay).hOL(i), break;end
  408. end
  409. set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
  410. set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
  411. if OLay==2
  412. try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
  413. set(ghandles.OLay2,'string', Exp(OLay).hOLname(maxhN));
  414. traceLab=char(Exp(OLay).hOLname(maxhN));
  415. try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
  416. set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(maxhN));
  417. OLresDir=Exp(OLay).hOLresDir(maxhN);
  418. OLplateNum=Exp(OLay).hOLplateNum(maxhN);
  419. end
  420. end
  421. % Hide 3
  422. if get(ghandles.rotPB3,'value') ==1 && OLay==3,
  423. % make all traces blue
  424. for i=1:length(Exp(OLay).hOL(:))
  425. try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch, end
  426. end
  427. for i=1:length(Exp(OLay).hOL(:))
  428. if htargetAxes==Exp(OLay).hOL(i)
  429. hidAx3traceN=i
  430. set(Exp(OLay).hOL(i),'Visible','off')
  431. set(Exp(OLay).hOLb(i),'Visible','off')
  432. for j=1:length(Exp(OLay).hOL(:))
  433. try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN=j; end, catch, end
  434. end
  435. end
  436. if htargetAxes==Exp(OLay).hOL(i), break;end
  437. end
  438. set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
  439. set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
  440. if OLay==3
  441. try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
  442. set(ghandles.OLay3,'string', Exp(OLay).hOLname(maxhN));
  443. traceLab=char(Exp(OLay).hOLname(maxhN));
  444. try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
  445. set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(maxhN));
  446. OLresDir=Exp(OLay).hOLresDir(maxhN);
  447. OLplateNum=Exp(OLay).hOLplateNum(maxhN);
  448. end
  449. end
  450. destcompMsg='Olay';
  451. catch
  452. msg='Not in OLay frame-axis 1'
  453. end
  454. NoOLay=0;
  455. try
  456. OLay
  457. expN=OLay
  458. EZdatatip=2
  459. catch
  460. NoOLay=1;
  461. EZdatatip=1;
  462. end
  463. if get(ghandles.spotTog,'value')==1 && NoOLay
  464. OLresDir=Exp(expN).Dexp(DexpN).resDir;
  465. OLplateNum=plateNum;
  466. imLoc=[picLoc1(2), picLoc1(1)];
  467. EZspotview(expN,DexpN, imLoc,OLresDir,OLplateNum,NoOLay)
  468. end
  469. % GraphicPertibationComparison**15_821*OR Chrono Day Comparison
  470. if strcmpi(Exp(expN).DexpType,'single') ...
  471. || strcmpi(Exp(expN).DexpType,'multi')
  472. EZdestComp
  473. elseif strcmpi(Exp(expN).DexpType,'chrono') ...
  474. && length(Exp(expN).Dexp)>1
  475. EZmDayTrend
  476. end
  477. % spotTog && ~Hide && Olay Capture spot location for spotview May need to
  478. % add DexpN BUT the OLresDir likely get spotview to where it needs to go.
  479. try
  480. if exist('OLay') %User clicked on an Overlay
  481. if get(ghandles.spotTog,'value')==1 && get(ghandles.rotPB1,'value') ~=1 && OLay<4
  482. msg='OLay with SpotTog On and Hide off'
  483. pos_=strfind(traceLab,'_')
  484. rcStr=traceLab(pos_(2)+1:pos_(3)-1)
  485. cPos=findstr(rcStr,'c');
  486. rUsr=str2num(rcStr(2:cPos-1));
  487. cUsr=str2num(rcStr(cPos+1:end));
  488. imLoc=[cUsr, (17-rUsr)]; %picLoc1 %transform horz user data to vert image for picLocation data
  489. OLresDir %=Exp(expN).hOLresDir(traceN);
  490. OLplateNum %=Exp(expN).hOLplateNum(traceN);
  491. EZspotview(expN, imLoc,OLresDir,OLplateNum,NoOLay)
  492. end
  493. end
  494. catch
  495. end
  496. [output_txt]=datatipp(obj,event_obj);
  497. % HeatMap Text Field
  498. try
  499. ll=num2str(l);
  500. if length(ll)>5,htl=ll(1:5);else htl=ll;end
  501. catch
  502. htl=' ';
  503. end
  504. try
  505. kk=num2str(K);
  506. if length(kk)>5,htk=kk(1:5);else htk=kk;end
  507. catch
  508. htk=' ';
  509. end
  510. try
  511. rr=num2str(r);
  512. if length(rr)>5,htr=rr(1:5);else htr=rr;end
  513. catch
  514. htr=' ';
  515. end
  516. try
  517. n1=num2str(Exp(expN).HtMpIntN1(indx)); %num2str(Exp(expN).Dexp(DexpN).HtMpIntN1(indx));
  518. if length(n1)>5,N1=n1(1:5);else N1=n1; end
  519. htN1=strcat('_N1=',N1);
  520. catch
  521. htN1=' ';
  522. end
  523. try
  524. n2=num2str(Exp(expN).HtMpIntN2(indx)); %num2str(Exp(expN).Dexp(DexpN).HtMpIntN2(indx));
  525. if length(n2)>5,N2=n2(1:5);else N2=n2; end
  526. htN2=strcat('_N2=',N2);
  527. catch
  528. htN2=' ';
  529. end
  530. if Exp(expN).htmapPBsel==1, htmapStr=strcat('K=',htk); end
  531. if Exp(expN).htmapPBsel==2, htmapStr=strcat('r=',htr); end
  532. try
  533. if Exp(expN).htmapPBsel==0 || Exp(expN).htmapPBsel>2
  534. htmapStr=strcat('L=',htl, htN1,htN2)
  535. if expN==1,set(ghandles.HtMapVals1,'string',htmapStr);end
  536. if expN==2,set(ghandles.HtMapVals2,'string',htmapStr);end
  537. if expN==3,set(ghandles.HtMapVals3,'string',htmapStr);end
  538. end
  539. catch
  540. end
  541. try
  542. if Exp(expN).htmapPBsel==1 || Exp(expN).htmapPBsel==2
  543. if expN==1,set(ghandles.HtMapVals1,'string',htmapStr);end
  544. if expN==2,set(ghandles.HtMapVals2,'string',htmapStr);end
  545. if expN==3,set(ghandles.HtMapVals3,'string',htmapStr);end
  546. end
  547. catch
  548. end
  549. % datacursormode(gcf)
  550. % Test Area
  551. % Added 18_0105 to define RFcmpGFlg for EZmDayTrend.m when an Image spot
  552. % is clicked
  553. tempLB=str2mat(selGnOrf)
  554. RFcmpGFlg=0;
  555. if isequal(tempLB(4:6),'cmp'), RFnum=str2double(tempLB(3));
  556. elseif isequal(tempLB(3:6),'cmpG'), RFcmpGFlg=1;
  557. elseif isequal(tempLB(3:6),'cmpP'), RFcmpGFlg=1; %I beleive handling will be the same as RFcmpG
  558. end
  559. %attemp to accomodate problems in newer Matlab which pops an unneccessay
  560. %{
  561. if verLessThan('matlab','8.4') %)
  562. else %accomodate new matlab changes after 2014a fix 2nd update 23_0227
  563. close(1)
  564. end
  565. %blank figure that the user has to minimize
  566. if verLessThan('matlab','8.4') %original work 23_0227 updated 23_0525 (8.4 changed to 8.3)
  567. else %accomodate new matlab changes after 2014a fix 2nd update 23_0227
  568. clf
  569. end
  570. %}