diff --git a/workflow/script-run-workflow b/workflow/script-run-workflow index 1ce7278d..b4ea6037 100755 --- a/workflow/script-run-workflow +++ b/workflow/script-run-workflow @@ -533,13 +533,19 @@ easy() { 'NoGrowth_.txt', and 'GrowthOnly_.txt' files will be generated in the 'PrintResults' folder. EOF - script="EASYConsole.m" + script="$EASY_TEMPLATE_DIR/EASYConsole.m" - pushd "$EASY_TEMPLATE_DIR" || return 1 - # Launch graphical matlab if the user wants - ! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI." && - matlab -nosplash -sd ~/downloads -r "$script" - popd || return 1 + # Add EASY directory to the Matlab path + # If this does not work we can try changing the -sd argument and if that fails then pushing/popping + debug "Adding EASY directory to the Matlab path" + hash matlab &>/dev/null && + matlab -nodisplay -nosplash -nodesktop -nojvm -batch "addpath('$EASY_TEMPLATE_DIR')" + + # Ask the user to launch EASYconsole.m in MATLAB + # MATLAB doesn't support passing args to scripts se we have to use ENV VARS instead + # These are proably already set in our scope but be explicit just in case + ! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI." && + SCANS_DIR="$SCANS_DIR" matlab -nosplash -sd "$SCANS_DIR" -r "run $script" # Use the function return code see if we succeeded get_easy_results "$SCANS_DIR" || return 1 diff --git a/workflow/templates/easy/DMPexcel2mat.m b/workflow/templates/easy/DMPexcel2mat.m index 716d9391..212cc9a8 100755 --- a/workflow/templates/easy/DMPexcel2mat.m +++ b/workflow/templates/easy/DMPexcel2mat.m @@ -1,21 +1,5 @@ %% CALLED BY EASYconsole.m %% -w = pwd; -%{ -cd .. -if exist('ExpJobs/') - cd('ExpJobs/'); -else - pwd -end -%} - -try - cd(ExpPath) -catch - cd(w) -end -pwd - +w=pwd numOfMPs=0; %GUI input for selecting a MasterPlate Excel file questdlg('\fontsize{20} Select Master Plate File','File Selection','OK', struct('Default','OK','Interpreter','tex')) @@ -26,7 +10,6 @@ else MPdir=fullfile(pathname,'/'); end - infile= Scanfiles(1,:); cd(MPdir) %fid=fopen(infile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector diff --git a/workflow/templates/easy/DgenResults.m b/workflow/templates/easy/DgenResults.m index 9481be1f..cd250105 100755 --- a/workflow/templates/easy/DgenResults.m +++ b/workflow/templates/easy/DgenResults.m @@ -6,7 +6,6 @@ global resDir global ExpOutmat global ImParMat -w=pwd; ln=1; @@ -403,8 +402,8 @@ catch ME errordlg(rep) end end %if DB -ln; -cd(w) +% ln; TODO removed by BCR, this doesn't seem necessary + %*********************************************************************** @@ -721,7 +720,6 @@ catch errorNstdResults='Catch at line720 for printing ResultsStd' end %try scan(1).plate(1).CFoutStd(1,1) to test for 2018 r_refined version -cd(w) scriptComplete= "line724 " msgbox(['Printing Script complete. Check !!Results sheets in ../PrintResults folder.']) \ No newline at end of file diff --git a/workflow/templates/easy/EASYconsole.m b/workflow/templates/easy/EASYconsole.m index 894c1de4..a629d32a 100644 --- a/workflow/templates/easy/EASYconsole.m +++ b/workflow/templates/easy/EASYconsole.m @@ -14,7 +14,9 @@ function varargout = EASYconsole(varargin) wCodeDir=pwd; % changing directory to wCodeDir - returnStartDir + % returnStartDir + + disp(getenv('SCANS_DIR')); %% GUI INTERFACE DESIGN %% % beginning of GUI formation & design, see help GUI or help GUIDE in @@ -102,12 +104,12 @@ end %% CONSOLE BUTTON INTERFACES %% % File Button Interface function FileMenu_Callback(~, ~, ~) - returnStartDir + %returnStartDir end % Load Experiment Button Interface function LoadExp_Callback(~, ~, ~) - returnStartDir + %returnStartDir end % New Experiment Button Interface @@ -123,7 +125,7 @@ function NewExpDat_Callback(~, ~, ~) global scan % put all users on same working directory - returnStartDir + %returnStartDir % Create a new experiment try @@ -177,7 +179,7 @@ function NewExpDat_Callback(~, ~, ~) sbdg= cell(1,scanMax); save((fullfile(resDir,'Fotos','Nbdg')),'sbdg'); catch ME - returnStartDir + % returnStartDir disp('Error Creating a New Experiment') end @@ -202,8 +204,6 @@ function LoadDatFile_Callback(~, ~, ~) global fhconsole %global ImParMat - returnStartDir - % TODO this entire try block needs work try % TODO this whole block is highly questionable @@ -265,11 +265,10 @@ end % callback for the 'Run' in the dropdown menu function run_Callback(~, ~, ~) - returnStartDir + end function runPlateMapPintool_Callback(~, ~, ~) - returnStartDir try NImapPT catch ME @@ -279,7 +278,6 @@ function runPlateMapPintool_Callback(~, ~, ~) end function NImCFcombo_Callback(~, ~, ~) - returnStartDir try par4Gbl_Main8c catch @@ -289,7 +287,6 @@ function NImCFcombo_Callback(~, ~, ~) end function runPlateImAnal_Callback(~, ~, ~) - returnStartDir try NImStartupOnly catch ME @@ -300,7 +297,6 @@ end function PlateCFit_Callback(~, ~, ~) %global ExpOutmat - returnStartDir try NCstart catch ME @@ -340,10 +336,8 @@ function Tools_Callback(~, ~, ~) end function runOverlayPlots_Callback(~, ~, ~) - returnStartDir try DoverlayPlots2 - returnStartDir EASYconsole catch ME returnStartDir @@ -352,10 +346,8 @@ function runOverlayPlots_Callback(~, ~, ~) end function runFotoStrip_Callback(~, ~, ~) - returnStartDir try F_NImStartup_CentCir - returnStartDir EASYconsole catch ME returnStartDir @@ -364,7 +356,6 @@ function runFotoStrip_Callback(~, ~, ~) end function runDisplayFig_Callback(~, ~, ~) - returnStartDir try UfigDisplay catch ME @@ -374,7 +365,6 @@ function runDisplayFig_Callback(~, ~, ~) end function runViewParameters_Callback(~, ~, ~) - returnStartDir try catch ME returnStartDir @@ -383,17 +373,7 @@ function runViewParameters_Callback(~, ~, ~) end function QkviewN_Callback(~, ~, ~) - returnStartDir try - try - cd(fullfile(ExpPath)) - catch - if ispc - cd('C:\') - else - cd(fullfile('~')); - end - end QkviewImages catch ME returnStartDir @@ -402,7 +382,6 @@ function QkviewN_Callback(~, ~, ~) end function CFdisplay_Callback(~, ~, ~) - returnStartDir try NCsingleDisplay returnStartDir diff --git a/workflow/templates/easy/par4Gbl_Main8c.m b/workflow/templates/easy/par4Gbl_Main8c.m index 155c9040..cd8e3d41 100755 --- a/workflow/templates/easy/par4Gbl_Main8c.m +++ b/workflow/templates/easy/par4Gbl_Main8c.m @@ -1,7 +1,9 @@ %% CALLED BY EASYconsole.m %% +w=pwd; + %function NImStartupImCF02par4Gbl -Fflg= 1; %0; +Fflg=1; %0; fclose('all'); %close all open files clear ('plate2', 'scanIntens','Scanfiles','pathname','tifFileLstP4') @@ -14,7 +16,6 @@ global ImParMat %global CSrchRng global expDir global SWnewExp -%Console globals******* global openExpfile global openExppath global newExpfile @@ -24,8 +25,7 @@ global fhconsole global ExpPath global resDir global wCodeDir -global matDir % - +global matDir global ImWidth global ImHeigth global numRows; @@ -35,48 +35,47 @@ global scan %global scanSize global scanMax global tptLength - +%global scanPar4x %global sols %global CFmeth + numRows=24; %for Single Vertical numCols=16; %for Single Vertical -%global scanPar4x %*************CIRCLE related************************* - doCircle=1; %use Circle area analysis 14_0807 radius=14; ImParMat(10)=radius; ImParMat(11)=doCircle; try -clf(fhconsole,'reset') + clf(fhconsole,'reset') catch ME end close + %****************************************** EASYconsole %****************************************** try -load(ExpOutmat) -copyfile(ExpOutmat,(fullfile(matDir,'BkUp',strcat((num2str(datenum(now))),'.mat')))) + load(ExpOutmat) + copyfile(ExpOutmat,(fullfile(matDir,'BkUp',strcat((num2str(datenum(now))),'.mat')))) catch end try load(fullfile(resDir,'Fotos','Nbdg')) %Modified to load from 'Fotos' 20_0819 catch - %Reloacated from 'PTmats' to prevent potential overwrite when PTmats is - %copied into new job when the PT template is about the same. We also - %now have a default template if one is not made. i.e., when the images - %from the new experiment are too sketchy to make a good pintool - %template. By moving it to 'Fotos' we avoid possible issues due to - %copying the Nbdg.mat file along with the default template '.mat' files. - %A copy of Ndbg.mat is placed also saved to the 'PTmats' directory - %after each run to allow previous version of EASY to access data made - %by EASY versions after 20_0819. - - load(fullfile(resDir,'PTmats','Nbdg')) %Left in to accomodate loads of work before 20_0819 + %Reloacated from 'PTmats' to prevent potential overwrite when PTmats is + %copied into new job when the PT template is about the same. We also + %now have a default template if one is not made. i.e., when the images + %from the new experiment are too sketchy to make a good pintool + %template. By moving it to 'Fotos' we avoid possible issues due to + %copying the Nbdg.mat file along with the default template '.mat' files. + %A copy of Ndbg.mat is placed also saved to the 'PTmats' directory + %after each run to allow previous version of EASY to access data made + %by EASY versions after 20_0819. + load(fullfile(resDir,'PTmats','Nbdg')) %Left in to accomodate loads of work before 20_0819 end %++++++++++++++Load Fotos stored data++++++++++++++++++++ try @@ -93,250 +92,193 @@ catch end %******autoImCF******************* try -load(fullfile(resDir,'PTmats','NCFparms')) + load(fullfile(resDir,'PTmats','NCFparms')) catch ME load parameters end -%******************************* + %************Get Print Times******************************* PrintTimes=[]; - w= cd; %Capture current dir in w - if ispc %Linux accommodation - expDir=fullfile(ExpPath,'\'); - else - if isunix, expDir= ExpPath;end - if ismac , expDir=ExpPath;end - end +if ispc + expDir=fullfile(ExpPath,'\'); +elseif (isunix || ismac) + expDir=ExpPath +end scLst={}; + %**************Parameter Entry****************** NImParamRadiusGui(expDir) %Ncode 122111replaced removed ,numOfPrtTimes) -%*********************************************** -%width=ImParMat(5); width=24; widthEx=width-1; %width extention from reference point dither=ImParMat(6); radius=ImParMat(10); -%>>>>>>>>>>>>>>>>>>>>>> NIcircle -%<<<<<<<<<<<<<<<<<<<<<<< %***************** Load Stuff************************* - lastPlateOnLastScan=1; %Ncode -if size(scLst,1)==1,SWsingleSc=1;else SWsingleSc=0;end -%**************************???????????????????????? +if size(scLst,1)==1 + SWsingleSc=1 +else + SWsingleSc=0 +end dvec=datevec(datestr(floor(now))); %method to get current offset year '01-Jan-"currentyr"' dvec(2)=1; dvec(3)=1; %yrOffset=datenum('01-Jan-2012');%(dvec); %('01-Jan-2009'); %time num default is currentyear jan1 -%******************+++++++++++++*****************+++++++++++++++*********** numScans=size(scLst,1); if(isequal(SWsingleSc,1)) - selScan=str2double(char(scLst(1))); - %numScans=selScan; - %startScan=selScan; + selScan=str2double(char(scLst(1))); else - %startScan=1; + % startScan=1; end -SWgrowthArea= ImParMat(9); +SWgrowthArea=ImParMat(9); load(fullfile(resDir,'PTmats','NPTmapSearch')) - PTmapPos= detPos; - -%************************************************************************** -selScanNumLst= []; - -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -%************************************************************************** -%*********Preallocation for Scan Loop************************************************** +PTmapPos=detPos; +selScanNumLst=[]; Scanfiles=[]; pathname=[]; -%++++++++++++++++++++++++++++++++ SETUP FOR GLOBAL PARFOR LOOP+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -%if SWsingleSc == 1 %if single scan else do expMultiTseries to execute multiple scans -%******Gui Select Scan -> *.tif files for Analysis***************** - w= cd; %Capture current dir in w + if ispc -cd(char(strcat(expDir,scLst(1)))) + cd(char(strcat(expDir,scLst(1)))) end if isunix -cd (fullfile(expDir,cell2mat(scLst(1)))); + cd(fullfile(expDir,cell2mat(scLst(1)))); end Scanfiles=[]; pathname=[]; +for ii=1:length(scLst) + if (SWsingleSc == 1) + [Scanfiles, pathname]=uigetfile('*.bmp', 'Select files','MultiSelect','on');% change '*hr*.bmp' 12/20/2011 + if ischar(Scanfiles) + scd=imread(char(Scanfiles)); + tptLength=1; + else + scd=imread(char(Scanfiles(1,1))); + tptLength=length(Scanfiles); + end + ImHeigth=size(scd,1); + ImWidth=size(scd,2); + sc=scd(1:ImHeigth,1:ImWidth); %?Not used RefOnly + end -for ii= 1:length(scLst) - if SWsingleSc == 1 -[Scanfiles, pathname]=uigetfile('*.bmp', 'Select files','MultiSelect','on');% change '*hr*.bmp' 12/20/2011 - if ischar(Scanfiles) - scd= imread(char(Scanfiles)); - tptLength=1; + cd(w); + numFiles=size(Scanfiles,2); + % Initialize tifFilesLst for parfor loop + dir(fullfile(expDir, char(scLst(ii)), '*.bmp')); + + numFiles=length(tifFileLst4MultiT); + tptLength=numFiles; + tifFileLstP4{ii}={tifFileLst4MultiT.name}; +end + +for jj=1:numScans %startScan:numScans + selScan=str2double(char(scLst(jj))); + selScanNumLst(jj)=selScan; +end +selScanNumLst2=selScanNumLst; %function passthrough, passback to par4gbl_Main 20_0205 + +% PREALLOCATION +scCount=[]; +TmpexpScanIntens00=cell(1); %cell(1,scanMax); +TmpFexpScanSpots00=cell(1); %cell(1,scanMax); +TmpFexpScanBMtp00=cell(1); %cell(1,scanMax); +TmpanlZoneRefs00=cell(1); %cell(1,scanMax); +Tmpsbdg00=cell(1); +TmpexpScanIntens4=cell(1,numScans); +TmpFexpScanSpots4=cell(1,numScans); +TmpFexpScanBMtp4=cell(1,numScans); +TmpanlZoneRefs4=cell(1,numScans); +Tmpsbdg4=cell(1,numScans); +TmpexpScanIntens5=cell(1,numScans); +TmpFexpScanSpots5=cell(1,numScans); +TmpFexpScanBMtp5=cell(1,numScans); +TmpanlZoneRefs5=cell(1,numScans); +Tmpsbdg5=cell(1,numScans); +p4L00=cell(18,1); +p4L0=p4L00; +p4L4=cell(18,numScans); +p4L5=p4L4; +Ag=ones(384); +CFscanIntens=zeros(16,24); + +[p4L4,TmpexpScanIntens5,TmpFexpScanSpots5,TmpFexpScanBMtp5,TmpanlZoneRefs5,Tmpsbdg5]= ... + p4loop8c(parMat,tptLength,numScans,selScanNumLst,SWsingleSc,Fflg,PTmapPos,optCirMask,diaExt,doCircle,cirPixA,cirMask,width, ... + TmpexpScanIntens00,TmpFexpScanSpots00,TmpFexpScanBMtp00,TmpanlZoneRefs00,scCount,tifFileLstP4,pathname,ImParMat, ... + numRows,numCols,scLst,resDir,expDir, p4L00,TmpexpScanIntens4,TmpFexpScanSpots4,TmpFexpScanBMtp4,TmpanlZoneRefs4, ... + Tmpsbdg00,Tmpsbdg4); + +for scanCnt=1:numScans + selScan=p4L4{16,scanCnt}; %determine the actual scan in the scanCnt parfor distributed "id" + scan(selScan).plate(1).tSeries=cell2mat(p4L4(1,scanCnt)); + scan(selScan).plate(1).t0Series=cell2mat(p4L4(2,scanCnt)); + scan(selScan).plate(1).printTm=cell2mat(p4L4(3,scanCnt)); + scan(selScan).plate(1).intens=cell2mat(p4L4(4,scanCnt)); + scan(selScan).plate(1).rc=p4L4(5,scanCnt); + scan(selScan).plate(1).pIndx=cell2mat(p4L4(6,scanCnt)); + scan(selScan).plate(1).Ag=cell2mat(p4L4(7,scanCnt)); + scan(selScan).plate(1).selIntens=p4L4(8,scanCnt); + scan(selScan).plate(1).selTimes=p4L4(9,scanCnt); + scan(selScan).plate(1).filterTimes=p4L4(10,scanCnt); + scan(selScan).plate(1).normIntens=p4L4(11,scanCnt); + %scan(selScan).plate(1).CFparameters=p4L4(12,scanCnt); %Need to convert to a matrix form like Old versions + CFparm(1:384)=p4L4{12,scanCnt}(1:384); + scan(selScan).plate(1).CFparameters=CFparm; + scan(selScan).plate(1).CFdate=p4L4(13,scanCnt); + scan(selScan).plate(1).CFout=cell2mat(p4L4(14,scanCnt)); + scan(selScan).plate(1).CFoutStd=cell2mat(p4L4(15,scanCnt)); + scan(selScan).Awindow=cell2mat(p4L4(17,scanCnt)); + scan(selScan).Idate=cell2mat(p4L4(18,scanCnt)); + expScanIntens(selScan)=TmpexpScanIntens5(scanCnt); + FexpScanSpots(selScan)=TmpFexpScanSpots5(scanCnt); + FexpScanBMtp(selScan)=TmpFexpScanBMtp5(scanCnt); + anlZoneRefs(selScan)=TmpanlZoneRefs5(scanCnt); + if ~isempty(Tmpsbdg5{scanCnt}) + sbdg(selScan)=Tmpsbdg5(scanCnt); else - scd= imread(char(Scanfiles(1,1))); - tptLength= length(Scanfiles); + sbdg{selScan}=uint8(zeros(24,16,4)); end - ImHeigth= size(scd,1); - ImWidth= size(scd,2); - sc=scd(1:ImHeigth,1:ImWidth); %?Not used RefOnly - end - -cd (w); -numFiles= size(Scanfiles,2); -%tifFileLst= Scanfiles; - -%Initialize tifFilesLst for parfor loop - if ispc %Linux and mac accomodation - tifFileLst4MultiT = dir(fullfile(expDir, char(scLst(ii)), '\*.bmp')); - end - if isunix || ismac - tifFileLst4MultiT = dir(fullfile(expDir, char(scLst(ii)), '*.bmp')); - end - numFiles=length(tifFileLst4MultiT); - tptLength= numFiles; - tifFileLstP4{ii}={tifFileLst4MultiT.name}; - %{ - dateTmStampP4{ii}= {tifFileLst4MultiT.date} - dateTmNum{ii}= datenum(dateTmStampP4{1}); - info{ii} = imfinfo(tifFileLstP4{ii}); - scTmNumericP4(ii)=datenum(info{ii}.FileModDate); - %} -end - - - - %************************************************************************** - %************************************************************************** - -for jj= 1:numScans %startScan:numScans - selScan= str2double(char(scLst(jj))); - selScanNumLst(jj)= selScan; -end - selScanNumLst2= selScanNumLst; %function passthrough, passback to par4gbl_Main 20_0205 -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -%PREALLOCATION PREALLOCATION PREALLOCATION PREALLOCATION PREALLOCATION -%****************************************************************************** -scCount= []; - -TmpexpScanIntens00= cell(1); %cell(1,scanMax); -TmpFexpScanSpots00= cell(1); %cell(1,scanMax); -TmpFexpScanBMtp00= cell(1); %cell(1,scanMax); -TmpanlZoneRefs00= cell(1); %cell(1,scanMax); -Tmpsbdg00= cell(1); - -TmpexpScanIntens4= cell(1,numScans); -TmpFexpScanSpots4= cell(1,numScans); -TmpFexpScanBMtp4= cell(1,numScans); -TmpanlZoneRefs4= cell(1,numScans); -Tmpsbdg4= cell(1,numScans); -TmpexpScanIntens5= cell(1,numScans); -TmpFexpScanSpots5= cell(1,numScans); -TmpFexpScanBMtp5= cell(1,numScans); -TmpanlZoneRefs5= cell(1,numScans); -Tmpsbdg5= cell(1,numScans); - -p4L00= cell(18,1); -p4L0= p4L00; - -p4L4= cell(18,numScans); -p4L5= p4L4; - - Ag= ones(384); - CFscanIntens= zeros(16,24); - - - [p4L4,... - TmpexpScanIntens5,TmpFexpScanSpots5,TmpFexpScanBMtp5,TmpanlZoneRefs5,Tmpsbdg5]= ... - p4loop8c(parMat,tptLength,numScans,selScanNumLst,SWsingleSc,Fflg,PTmapPos,optCirMask,diaExt,doCircle,cirPixA,cirMask,width, ... - TmpexpScanIntens00,TmpFexpScanSpots00,TmpFexpScanBMtp00,TmpanlZoneRefs00,scCount,tifFileLstP4,pathname,ImParMat, ... - numRows,numCols,scLst,resDir,expDir, p4L00,TmpexpScanIntens4,TmpFexpScanSpots4,TmpFexpScanBMtp4,TmpanlZoneRefs4, ... - Tmpsbdg00,Tmpsbdg4); - - - -for scanCnt= 1:numScans -selScan= p4L4{16,scanCnt}; %determine the actual scan in the scanCnt parfor distributed "id" - scan(selScan).plate(1).tSeries= cell2mat(p4L4(1,scanCnt)); - scan(selScan).plate(1).t0Series= cell2mat(p4L4(2,scanCnt)); - scan(selScan).plate(1).printTm= cell2mat(p4L4(3,scanCnt)); - scan(selScan).plate(1).intens= cell2mat(p4L4(4,scanCnt)); - scan(selScan).plate(1).rc= p4L4(5,scanCnt); - scan(selScan).plate(1).pIndx= cell2mat(p4L4(6,scanCnt)); - scan(selScan).plate(1).Ag= cell2mat(p4L4(7,scanCnt)); - - scan(selScan).plate(1).selIntens= p4L4(8,scanCnt); - scan(selScan).plate(1).selTimes= p4L4(9,scanCnt); - scan(selScan).plate(1).filterTimes= p4L4(10,scanCnt); - scan(selScan).plate(1).normIntens= p4L4(11,scanCnt); - - %scan(selScan).plate(1).CFparameters= p4L4(12,scanCnt); %Need to convert to a matrix form like Old versions - CFparm(1:384)=p4L4{12,scanCnt}(1:384); - scan(selScan).plate(1).CFparameters= CFparm; - scan(selScan).plate(1).CFdate= p4L4(13,scanCnt); - scan(selScan).plate(1).CFout= cell2mat(p4L4(14,scanCnt)); - scan(selScan).plate(1).CFoutStd= cell2mat(p4L4(15,scanCnt)); - - - scan(selScan).Awindow= cell2mat(p4L4(17,scanCnt)); - scan(selScan).Idate= cell2mat(p4L4(18,scanCnt)); - - - expScanIntens(selScan)= TmpexpScanIntens5(scanCnt); - FexpScanSpots(selScan)= TmpFexpScanSpots5(scanCnt); - FexpScanBMtp(selScan)= TmpFexpScanBMtp5(scanCnt); - anlZoneRefs(selScan)= TmpanlZoneRefs5(scanCnt); - if ~isempty(Tmpsbdg5{scanCnt}) - sbdg(selScan)= Tmpsbdg5(scanCnt); - else - sbdg{selScan}= uint8(zeros(24,16,4)); - end end %SAVE DATA in .mat files save(ExpOutmat,'scan'); -save((fullfile(resDir,'PTmats','Nbdg')), 'sbdg'); %legacy location can probably get rid of in time +% save((fullfile(resDir,'PTmats','Nbdg')), 'sbdg'); %legacy location can probably get rid of in time save((fullfile(resDir,'Fotos','Nbdg')), 'sbdg'); - save((fullfile(resDir,'Fotos','Coordinates')),'FexpScanSpots') %Saves frames at each tPt save((fullfile(resDir,'Fotos','BGatTpts')),'FexpScanBMtp') save((fullfile(resDir,'Fotos','anlZones')),'anlZoneRefs')%Saves anl Positions at each tPt %Print FitResults ******************************************************* -fileExt = '.txt'; -filePrefix = 'FitResults_'; -for scanCnt= 1:numScans -selScan= p4L4{16,scanCnt}; %determine the actual scan in the scanCnt parfor distributed "id" +fileExt='.txt'; +filePrefix='FitResults_'; +for scanCnt=1:numScans + selScan=p4L4{16,scanCnt}; %determine the actual scan in the scanCnt parfor distributed "id" + fileSuffix=strcat('Scan', num2str(selScan),'_Plate', num2str(1)); + fileNamePlate=[filePrefix fileSuffix fileExt]; + fileName=fullfile(resDir,'PrintResults', fileNamePlate); %[outputDirectory fileNamePlate]; -fileSuffix= strcat('Scan', num2str(selScan),'_Plate', num2str(1)); -fileNamePlate = [filePrefix fileSuffix fileExt]; -fileName= fullfile(resDir,'PrintResults', fileNamePlate); %[outputDirectory fileNamePlate]; + %This,fprint for loop,is an very old legacy feature which slows processing. Could be + %removed but allows easy observation of how a run is progressing and can be + %used as a diagnostic tool. + outCprint=p4L4; -%This,fprint for loop,is an very old legacy feature which slows processing. Could be -%removed but allows easy observation of how a run is progressing and can be -%used as a diagnostic tool. - - -outCprint= p4L4; - -fid = fopen(fileName,'w'); -fprintf(fid, 'Num.\tAUC\tMSR\tK\tr\tl\tR-squared\tK-lower\tK-upper\tr-lower\tr-upper\tl-upper\tl-lower\tArea\tLastInten\tSpineMaxRateTimePt\tLastFitTimePt\n'); -for n=1:384 %startCount:numCultures - fprintf(fid,'%d\t',n); - fprintf(fid, '%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\n',... - outCprint{14,scanCnt}(n,1),outCprint{14,scanCnt}(n,2),outCprint{14,scanCnt}(n,3),outCprint{14,scanCnt}(n,4),... - outCprint{14,scanCnt}(n,5),outCprint{14,scanCnt}(n,6),outCprint{14,scanCnt}(n,7),outCprint{14,scanCnt}(n,8),... - outCprint{14,scanCnt}(n,9),outCprint{14,scanCnt}(n,10),outCprint{14,scanCnt}(n,11),outCprint{14,scanCnt}(n,12),... - outCprint{14,scanCnt}(n,13),outCprint{14,scanCnt}(n,14),outCprint{14,scanCnt}(n,15),outCprint{14,scanCnt}(n,16)); + fid=fopen(fileName,'w'); + fprintf(fid, 'Num.\tAUC\tMSR\tK\tr\tl\tR-squared\tK-lower\tK-upper\tr-lower\tr-upper\tl-upper\tl-lower\tArea\tLastInten\tSpineMaxRateTimePt\tLastFitTimePt\n'); + for n=1:384 %startCount:numCultures + fprintf(fid,'%d\t',n); + fprintf(fid, '%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\n',... + outCprint{14,scanCnt}(n,1),outCprint{14,scanCnt}(n,2),outCprint{14,scanCnt}(n,3),outCprint{14,scanCnt}(n,4),... + outCprint{14,scanCnt}(n,5),outCprint{14,scanCnt}(n,6),outCprint{14,scanCnt}(n,7),outCprint{14,scanCnt}(n,8),... + outCprint{14,scanCnt}(n,9),outCprint{14,scanCnt}(n,10),outCprint{14,scanCnt}(n,11),outCprint{14,scanCnt}(n,12),... + outCprint{14,scanCnt}(n,13),outCprint{14,scanCnt}(n,14),outCprint{14,scanCnt}(n,15),outCprint{14,scanCnt}(n,16)); + end + fclose(fid); end -fclose(fid); -end - + EASYconsole; - - - %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file