NCsingleDisplay.m 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. %% CALLED WHEN ACCESSING 'CurveFit Display' %%
  2. global scLst
  3. global scan
  4. hf=figure;
  5. % Parameter Entry
  6. [scLst, row, col]=NCdisplayGui(projectScansDir);
  7. close(hf)
  8. selSpot=(row-1)*24 + col;
  9. for iPlate=1:length(scLst)
  10. scanPltNum=str2double(scLst(iPlate));
  11. K=scan(scanPltNum).plate(1).CFout((selSpot),3);
  12. r=scan(scanPltNum).plate(1).CFout((selSpot),4);
  13. l=scan(scanPltNum).plate(1).CFout((selSpot),5);
  14. suffix=strcat('Scan-Plate', scLst(iPlate)); % char(QspLst(n));
  15. % fileSpotSuffix=strcat('-Spot#',num2str(selSpot),'-Row=',selSpotRC(1),'-Col=',selSpotRC(2),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
  16. fileSpotSuffix=strcat('-Spot#',num2str(selSpot),'-Row=',num2str(row),'-Col=',num2str(col),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
  17. filenameNoExt=[suffix fileSpotSuffix];
  18. timeArr=scan(scanPltNum).plate(1).tSeries;
  19. rawIntens=scan(scanPltNum).plate(1).intens((selSpot),:)/scan(scanPltNum).plate(1).Ag((selSpot));
  20. try
  21. filterTms=scan(scanPltNum).plate(1).filterTimes{(selSpot)};
  22. normInts=scan(scanPltNum).plate(1).normIntens{(selSpot)};
  23. catch
  24. end
  25. if (exist('K','var')&& exist('r','var') && exist('l','var'))
  26. t=(0:1:200);
  27. Growth=K ./ (1 + exp(-r.* (t - l )));
  28. end
  29. if length(scLst)>1
  30. figure
  31. else
  32. cla
  33. end
  34. hold on
  35. plot(timeArr,rawIntens,'g*');
  36. try
  37. plot(filterTms,normInts,'o');
  38. catch
  39. end
  40. hold on;
  41. title(filenameNoExt); % this didn't make sense so changed
  42. xlabel('Hours');
  43. ylabel('Intensities Normalized by Area');
  44. grid on;
  45. if (exist('K','var')&& exist('r','var') && exist('l','var'))
  46. plot(t, Growth,'b-');
  47. % Plot L on curvefit figure
  48. grL=Growth(round(l)); % growthCurve timePT for l in hours
  49. plot(l,0:grL,'-b') % to display position of l
  50. plot(l,grL,'^b') % to display l position on curve as an arrowhead
  51. % Plot Arbitrary User Entry AUC "finalTimePt"
  52. % plot(finalTimePt,0,'+m')
  53. % plot(0:finalTimePt,bl,'-m')
  54. end
  55. end
  56. %Spot entry form------------------------------------------------------
  57. %{
  58. prompt={'Enter spot to analyse:'};
  59. dlg_title='Input spot to curve fit';
  60. num_lines=1;
  61. def={'1'};
  62. selSpot=inputdlg(prompt,dlg_title,num_lines,def);
  63. K=scan(scanPltNum).plate(1).CFout(str2double(selSpot),3);
  64. r=scan(scanPltNum).plate(1).CFout(str2double(selSpot),4);
  65. l=scan(scanPltNum).plate(1).CFout(str2double(selSpot),5);
  66. suffix=strcat('Scan-Plate', scLst); %char(QspLst(n));
  67. fileSpotSuffix=strcat('-Spot#',selSpot,'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
  68. filenameNoExt=[suffix fileSpotSuffix];
  69. timeArr=scan(scanPltNum).plate(1).tSeries;
  70. rawIntens=scan(scanPltNum).plate(1).intens(str2double(selSpot),:)/scan(scanPltNum).plate(1).Ag(str2double(selSpot));
  71. filterTms=scan(scanPltNum).plate(1).filterTimes{str2double(selSpot)};
  72. normInts=scan(scanPltNum).plate(1).normIntens{str2double(selSpot)};
  73. %}
  74. %-----------------------------------------------------------------------
  75. %{
  76. prompt={'Enter Spot row:','Enter Spot column:'};
  77. dlg_title='Input spot to curve fit';
  78. num_lines=2;
  79. def={'1','1'};
  80. selSpotRC=inputdlg(prompt,dlg_title,num_lines,def);
  81. row=str2double(selSpotRC(1)); col=str2double(selSpotRC(2));
  82. %}
  83. %row=cell2mat(row);