Format NCsingleDisplay.m

This commit is contained in:
2024-07-25 14:47:54 -04:00
parent 513f531fa4
commit 9a5c9ffb6a

View File

@@ -4,107 +4,89 @@ global scLst
global ExpPath global ExpPath
global scan global scan
eDir= ExpPath; eDir=ExpPath;
hf= figure; hf=figure;
%**************Parameter Entry****************** % Parameter Entry
[scLst, row, col] = NCdisplayGui(eDir); %(ExpPath); %Ncode 122111replaced removed ,numOfPrtTimes) [scLst, row, col]=NCdisplayGui(eDir); %(ExpPath); %Ncode 122111replaced removed ,numOfPrtTimes)
%***********************************************
close(hf) close(hf)
selSpot=(row-1)*24 + col;
selSpot= (row-1)*24 + col;
for iPlate=1:length(scLst) for iPlate=1:length(scLst)
scanPltNum= str2double(scLst(iPlate)); scanPltNum=str2double(scLst(iPlate));
%scanPltNum(iPlate); K=scan(scanPltNum).plate(1).CFout((selSpot),3);
%----------------------------------------------------------------------- r=scan(scanPltNum).plate(1).CFout((selSpot),4);
K= scan(scanPltNum).plate(1).CFout((selSpot),3); l=scan(scanPltNum).plate(1).CFout((selSpot),5);
r= scan(scanPltNum).plate(1).CFout((selSpot),4); suffix=strcat('Scan-Plate', scLst(iPlate)); % char(QspLst(n));
l= scan(scanPltNum).plate(1).CFout((selSpot),5); % 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));
suffix= strcat('Scan-Plate', scLst(iPlate)); %char(QspLst(n)); filenameNoExt=[suffix fileSpotSuffix];
%fileSpotSuffix = strcat('-Spot#',num2str(selSpot),'-Row=',selSpotRC(1),'-Col=',selSpotRC(2),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); timeArr=scan(scanPltNum).plate(1).tSeries;
fileSpotSuffix = strcat('-Spot#',num2str(selSpot),'-Row=',num2str(row),'-Col=',num2str(col),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); rawIntens=scan(scanPltNum).plate(1).intens((selSpot),:)/scan(scanPltNum).plate(1).Ag((selSpot));
filenameNoExt= [suffix fileSpotSuffix]; try
filterTms=scan(scanPltNum).plate(1).filterTimes{(selSpot)};
timeArr= scan(scanPltNum).plate(1).tSeries; normInts=scan(scanPltNum).plate(1).normIntens{(selSpot)};
rawIntens= scan(scanPltNum).plate(1).intens((selSpot),:)/scan(scanPltNum).plate(1).Ag((selSpot)); catch
try end
filterTms= scan(scanPltNum).plate(1).filterTimes{(selSpot)}; if (exist('K','var')&& exist('r','var') && exist('l','var'))
normInts= scan(scanPltNum).plate(1).normIntens{(selSpot)}; t=(0:1:200);
catch Growth=K ./ (1 + exp(-r.* (t - l )));
end end
%******************************** if length(scLst)>1
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 figure
else else
cla 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
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------------------------------------------------------ %Spot entry form------------------------------------------------------
%{ %{
prompt = {'Enter spot to analyse:'}; prompt={'Enter spot to analyse:'};
dlg_title = 'Input spot to curve fit'; dlg_title='Input spot to curve fit';
num_lines = 1; num_lines=1;
def = {'1'}; def={'1'};
selSpot = inputdlg(prompt,dlg_title,num_lines,def); selSpot=inputdlg(prompt,dlg_title,num_lines,def);
K= scan(scanPltNum).plate(1).CFout(str2double(selSpot),3); K=scan(scanPltNum).plate(1).CFout(str2double(selSpot),3);
r= scan(scanPltNum).plate(1).CFout(str2double(selSpot),4); r=scan(scanPltNum).plate(1).CFout(str2double(selSpot),4);
l= scan(scanPltNum).plate(1).CFout(str2double(selSpot),5); l=scan(scanPltNum).plate(1).CFout(str2double(selSpot),5);
suffix= strcat('Scan-Plate', scLst); %char(QspLst(n)); suffix=strcat('Scan-Plate', scLst); %char(QspLst(n));
fileSpotSuffix = strcat('-Spot#',selSpot,'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); fileSpotSuffix=strcat('-Spot#',selSpot,'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K));
filenameNoExt= [suffix fileSpotSuffix]; filenameNoExt=[suffix fileSpotSuffix];
timeArr= scan(scanPltNum).plate(1).tSeries; timeArr=scan(scanPltNum).plate(1).tSeries;
rawIntens= scan(scanPltNum).plate(1).intens(str2double(selSpot),:)/scan(scanPltNum).plate(1).Ag(str2double(selSpot)); rawIntens=scan(scanPltNum).plate(1).intens(str2double(selSpot),:)/scan(scanPltNum).plate(1).Ag(str2double(selSpot));
filterTms= scan(scanPltNum).plate(1).filterTimes{str2double(selSpot)}; filterTms=scan(scanPltNum).plate(1).filterTimes{str2double(selSpot)};
normInts= scan(scanPltNum).plate(1).normIntens{str2double(selSpot)}; normInts=scan(scanPltNum).plate(1).normIntens{str2double(selSpot)};
%} %}
%----------------------------------------------------------------------- %-----------------------------------------------------------------------
%{ %{
prompt = {'Enter Spot row:','Enter Spot column:'}; prompt={'Enter Spot row:','Enter Spot column:'};
dlg_title = 'Input spot to curve fit'; dlg_title='Input spot to curve fit';
num_lines = 2; num_lines=2;
def = {'1','1'}; def={'1','1'};
selSpotRC = inputdlg(prompt,dlg_title,num_lines,def); selSpotRC=inputdlg(prompt,dlg_title,num_lines,def);
row= str2double(selSpotRC(1)); col=str2double(selSpotRC(2)); row=str2double(selSpotRC(1)); col=str2double(selSpotRC(2));
%} %}
%row= cell2mat(row); %row=cell2mat(row);