Files
hartman-server/workflow/templates/easy/NCsingleDisplay.m
2024-07-23 10:54:58 -04:00

111 lines
3.6 KiB
Matlab
Executable File

%% CALLED WHEN ACCESSING 'CurveFit Display' %%
global expDir
global scLst
global ExpPath
global scan
eDir= ExpPath;
hf= figure;
%**************Parameter Entry******************
[scLst, row, col] = NCdisplayGui(eDir); %(ExpPath); %Ncode 122111replaced removed ,numOfPrtTimes)
%***********************************************
close(hf)
selSpot= (row-1)*24 + col;
for iPlate=1:length(scLst)
scanPltNum= str2double(scLst(iPlate));
%scanPltNum(iPlate);
%-----------------------------------------------------------------------
K= scan(scanPltNum).plate(1).CFout((selSpot),3);
r= scan(scanPltNum).plate(1).CFout((selSpot),4);
l= scan(scanPltNum).plate(1).CFout((selSpot),5);
suffix= strcat('Scan-Plate', scLst(iPlate)); %char(QspLst(n));
%fileSpotSuffix = strcat('-Spot#',num2str(selSpot),'-Row=',selSpotRC(1),'-Col=',selSpotRC(2),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
fileSpotSuffix = strcat('-Spot#',num2str(selSpot),'-Row=',num2str(row),'-Col=',num2str(col),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
filenameNoExt= [suffix fileSpotSuffix];
timeArr= scan(scanPltNum).plate(1).tSeries;
rawIntens= scan(scanPltNum).plate(1).intens((selSpot),:)/scan(scanPltNum).plate(1).Ag((selSpot));
try
filterTms= scan(scanPltNum).plate(1).filterTimes{(selSpot)};
normInts= scan(scanPltNum).plate(1).normIntens{(selSpot)};
catch
end
%********************************
if (exist('K','var')&& exist('r','var') && exist('l','var'))
t = (0:1:200);
Growth = K ./ (1 + exp(-r.* (t - l )));
end
if length(scLst)>1
figure
else
cla
end
hold on
plot(timeArr,rawIntens,'g*');
try
plot(filterTms,normInts,'o');
catch
end
hold on;
title(strcat(filenameNoExt,''));
xlabel('Hours');
ylabel('Intensities Normalized by Area');
grid on;
if (exist('K','var')&& exist('r','var') && exist('l','var'))
plot(t, Growth,'b-');
%*********Plot L on curvefit figure***********
grL=Growth(round(l)); %growthCurve timePT for l in hours
plot(l,0:grL,'-b') %to display position of l
plot(l,grL,'^b') %to display l position on curve as an arrowhead
%***Plot Arbitrary User Entry AUC "finalTimePt"
% plot(finalTimePt,0,'+m')
% plot(0:finalTimePt,bl,'-m')
end
end
%end %end for SWsingle display/plot figure
%############################################################
%Spot entry form------------------------------------------------------
%{
prompt = {'Enter spot to analyse:'};
dlg_title = 'Input spot to curve fit';
num_lines = 1;
def = {'1'};
selSpot = inputdlg(prompt,dlg_title,num_lines,def);
K= scan(scanPltNum).plate(1).CFout(str2double(selSpot),3);
r= scan(scanPltNum).plate(1).CFout(str2double(selSpot),4);
l= scan(scanPltNum).plate(1).CFout(str2double(selSpot),5);
suffix= strcat('Scan-Plate', scLst); %char(QspLst(n));
fileSpotSuffix = strcat('-Spot#',selSpot,'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
filenameNoExt= [suffix fileSpotSuffix];
timeArr= scan(scanPltNum).plate(1).tSeries;
rawIntens= scan(scanPltNum).plate(1).intens(str2double(selSpot),:)/scan(scanPltNum).plate(1).Ag(str2double(selSpot));
filterTms= scan(scanPltNum).plate(1).filterTimes{str2double(selSpot)};
normInts= scan(scanPltNum).plate(1).normIntens{str2double(selSpot)};
%}
%-----------------------------------------------------------------------
%{
prompt = {'Enter Spot row:','Enter Spot column:'};
dlg_title = 'Input spot to curve fit';
num_lines = 2;
def = {'1','1'};
selSpotRC = inputdlg(prompt,dlg_title,num_lines,def);
row= str2double(selSpotRC(1)); col=str2double(selSpotRC(2));
%}
%row= cell2mat(row);