Cleanup par4Gbl_Main8c.m
This commit is contained in:
@@ -533,13 +533,19 @@ easy() {
|
|||||||
'NoGrowth_.txt', and 'GrowthOnly_.txt' files will be generated in the 'PrintResults' folder.
|
'NoGrowth_.txt', and 'GrowthOnly_.txt' files will be generated in the 'PrintResults' folder.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
script="EASYConsole.m"
|
script="$EASY_TEMPLATE_DIR/EASYConsole.m"
|
||||||
|
|
||||||
pushd "$EASY_TEMPLATE_DIR" || return 1
|
# Add EASY directory to the Matlab path
|
||||||
# Launch graphical matlab if the user wants
|
# If this does not work we can try changing the -sd argument and if that fails then pushing/popping
|
||||||
! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI." &&
|
debug "Adding EASY directory to the Matlab path"
|
||||||
matlab -nosplash -sd ~/downloads -r "$script"
|
hash matlab &>/dev/null &&
|
||||||
popd || return 1
|
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
|
# Use the function return code see if we succeeded
|
||||||
get_easy_results "$SCANS_DIR" || return 1
|
get_easy_results "$SCANS_DIR" || return 1
|
||||||
|
|||||||
@@ -1,21 +1,5 @@
|
|||||||
%% CALLED BY EASYconsole.m %%
|
%% CALLED BY EASYconsole.m %%
|
||||||
w = pwd;
|
w=pwd
|
||||||
%{
|
|
||||||
cd ..
|
|
||||||
if exist('ExpJobs/')
|
|
||||||
cd('ExpJobs/');
|
|
||||||
else
|
|
||||||
pwd
|
|
||||||
end
|
|
||||||
%}
|
|
||||||
|
|
||||||
try
|
|
||||||
cd(ExpPath)
|
|
||||||
catch
|
|
||||||
cd(w)
|
|
||||||
end
|
|
||||||
pwd
|
|
||||||
|
|
||||||
numOfMPs=0;
|
numOfMPs=0;
|
||||||
%GUI input for selecting a MasterPlate Excel file
|
%GUI input for selecting a MasterPlate Excel file
|
||||||
questdlg('\fontsize{20} Select Master Plate File','File Selection','OK', struct('Default','OK','Interpreter','tex'))
|
questdlg('\fontsize{20} Select Master Plate File','File Selection','OK', struct('Default','OK','Interpreter','tex'))
|
||||||
@@ -26,7 +10,6 @@ else
|
|||||||
MPdir=fullfile(pathname,'/');
|
MPdir=fullfile(pathname,'/');
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
infile= Scanfiles(1,:);
|
infile= Scanfiles(1,:);
|
||||||
cd(MPdir)
|
cd(MPdir)
|
||||||
%fid=fopen(infile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector
|
%fid=fopen(infile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ global resDir
|
|||||||
global ExpOutmat
|
global ExpOutmat
|
||||||
global ImParMat
|
global ImParMat
|
||||||
|
|
||||||
w=pwd;
|
|
||||||
ln=1;
|
ln=1;
|
||||||
|
|
||||||
|
|
||||||
@@ -403,8 +402,8 @@ catch ME
|
|||||||
errordlg(rep)
|
errordlg(rep)
|
||||||
end
|
end
|
||||||
end %if DB
|
end %if DB
|
||||||
ln;
|
% ln; TODO removed by BCR, this doesn't seem necessary
|
||||||
cd(w)
|
|
||||||
|
|
||||||
|
|
||||||
%***********************************************************************
|
%***********************************************************************
|
||||||
@@ -721,7 +720,6 @@ catch
|
|||||||
errorNstdResults='Catch at line720 for printing ResultsStd'
|
errorNstdResults='Catch at line720 for printing ResultsStd'
|
||||||
end %try scan(1).plate(1).CFoutStd(1,1) to test for 2018 r_refined version
|
end %try scan(1).plate(1).CFoutStd(1,1) to test for 2018 r_refined version
|
||||||
|
|
||||||
cd(w)
|
|
||||||
|
|
||||||
scriptComplete= "line724 "
|
scriptComplete= "line724 "
|
||||||
msgbox(['Printing Script complete. Check !!Results sheets in ../PrintResults folder.'])
|
msgbox(['Printing Script complete. Check !!Results sheets in ../PrintResults folder.'])
|
||||||
@@ -14,7 +14,9 @@ function varargout = EASYconsole(varargin)
|
|||||||
wCodeDir=pwd;
|
wCodeDir=pwd;
|
||||||
|
|
||||||
% changing directory to wCodeDir
|
% changing directory to wCodeDir
|
||||||
returnStartDir
|
% returnStartDir
|
||||||
|
|
||||||
|
disp(getenv('SCANS_DIR'));
|
||||||
|
|
||||||
%% GUI INTERFACE DESIGN %%
|
%% GUI INTERFACE DESIGN %%
|
||||||
% beginning of GUI formation & design, see help GUI or help GUIDE in
|
% beginning of GUI formation & design, see help GUI or help GUIDE in
|
||||||
@@ -102,12 +104,12 @@ end
|
|||||||
%% CONSOLE BUTTON INTERFACES %%
|
%% CONSOLE BUTTON INTERFACES %%
|
||||||
% File Button Interface
|
% File Button Interface
|
||||||
function FileMenu_Callback(~, ~, ~)
|
function FileMenu_Callback(~, ~, ~)
|
||||||
returnStartDir
|
%returnStartDir
|
||||||
end
|
end
|
||||||
|
|
||||||
% Load Experiment Button Interface
|
% Load Experiment Button Interface
|
||||||
function LoadExp_Callback(~, ~, ~)
|
function LoadExp_Callback(~, ~, ~)
|
||||||
returnStartDir
|
%returnStartDir
|
||||||
end
|
end
|
||||||
|
|
||||||
% New Experiment Button Interface
|
% New Experiment Button Interface
|
||||||
@@ -123,7 +125,7 @@ function NewExpDat_Callback(~, ~, ~)
|
|||||||
global scan
|
global scan
|
||||||
|
|
||||||
% put all users on same working directory
|
% put all users on same working directory
|
||||||
returnStartDir
|
%returnStartDir
|
||||||
|
|
||||||
% Create a new experiment
|
% Create a new experiment
|
||||||
try
|
try
|
||||||
@@ -177,7 +179,7 @@ function NewExpDat_Callback(~, ~, ~)
|
|||||||
sbdg= cell(1,scanMax);
|
sbdg= cell(1,scanMax);
|
||||||
save((fullfile(resDir,'Fotos','Nbdg')),'sbdg');
|
save((fullfile(resDir,'Fotos','Nbdg')),'sbdg');
|
||||||
catch ME
|
catch ME
|
||||||
returnStartDir
|
% returnStartDir
|
||||||
disp('Error Creating a New Experiment')
|
disp('Error Creating a New Experiment')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -202,8 +204,6 @@ function LoadDatFile_Callback(~, ~, ~)
|
|||||||
global fhconsole
|
global fhconsole
|
||||||
%global ImParMat
|
%global ImParMat
|
||||||
|
|
||||||
returnStartDir
|
|
||||||
|
|
||||||
% TODO this entire try block needs work
|
% TODO this entire try block needs work
|
||||||
try
|
try
|
||||||
% TODO this whole block is highly questionable
|
% TODO this whole block is highly questionable
|
||||||
@@ -265,11 +265,10 @@ end
|
|||||||
|
|
||||||
% callback for the 'Run' in the dropdown menu
|
% callback for the 'Run' in the dropdown menu
|
||||||
function run_Callback(~, ~, ~)
|
function run_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function runPlateMapPintool_Callback(~, ~, ~)
|
function runPlateMapPintool_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
NImapPT
|
NImapPT
|
||||||
catch ME
|
catch ME
|
||||||
@@ -279,7 +278,6 @@ function runPlateMapPintool_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function NImCFcombo_Callback(~, ~, ~)
|
function NImCFcombo_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
par4Gbl_Main8c
|
par4Gbl_Main8c
|
||||||
catch
|
catch
|
||||||
@@ -289,7 +287,6 @@ function NImCFcombo_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function runPlateImAnal_Callback(~, ~, ~)
|
function runPlateImAnal_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
NImStartupOnly
|
NImStartupOnly
|
||||||
catch ME
|
catch ME
|
||||||
@@ -300,7 +297,6 @@ end
|
|||||||
|
|
||||||
function PlateCFit_Callback(~, ~, ~)
|
function PlateCFit_Callback(~, ~, ~)
|
||||||
%global ExpOutmat
|
%global ExpOutmat
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
NCstart
|
NCstart
|
||||||
catch ME
|
catch ME
|
||||||
@@ -340,10 +336,8 @@ function Tools_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function runOverlayPlots_Callback(~, ~, ~)
|
function runOverlayPlots_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
DoverlayPlots2
|
DoverlayPlots2
|
||||||
returnStartDir
|
|
||||||
EASYconsole
|
EASYconsole
|
||||||
catch ME
|
catch ME
|
||||||
returnStartDir
|
returnStartDir
|
||||||
@@ -352,10 +346,8 @@ function runOverlayPlots_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function runFotoStrip_Callback(~, ~, ~)
|
function runFotoStrip_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
F_NImStartup_CentCir
|
F_NImStartup_CentCir
|
||||||
returnStartDir
|
|
||||||
EASYconsole
|
EASYconsole
|
||||||
catch ME
|
catch ME
|
||||||
returnStartDir
|
returnStartDir
|
||||||
@@ -364,7 +356,6 @@ function runFotoStrip_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function runDisplayFig_Callback(~, ~, ~)
|
function runDisplayFig_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
UfigDisplay
|
UfigDisplay
|
||||||
catch ME
|
catch ME
|
||||||
@@ -374,7 +365,6 @@ function runDisplayFig_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function runViewParameters_Callback(~, ~, ~)
|
function runViewParameters_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
catch ME
|
catch ME
|
||||||
returnStartDir
|
returnStartDir
|
||||||
@@ -383,17 +373,7 @@ function runViewParameters_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function QkviewN_Callback(~, ~, ~)
|
function QkviewN_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
try
|
|
||||||
cd(fullfile(ExpPath))
|
|
||||||
catch
|
|
||||||
if ispc
|
|
||||||
cd('C:\')
|
|
||||||
else
|
|
||||||
cd(fullfile('~'));
|
|
||||||
end
|
|
||||||
end
|
|
||||||
QkviewImages
|
QkviewImages
|
||||||
catch ME
|
catch ME
|
||||||
returnStartDir
|
returnStartDir
|
||||||
@@ -402,7 +382,6 @@ function QkviewN_Callback(~, ~, ~)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function CFdisplay_Callback(~, ~, ~)
|
function CFdisplay_Callback(~, ~, ~)
|
||||||
returnStartDir
|
|
||||||
try
|
try
|
||||||
NCsingleDisplay
|
NCsingleDisplay
|
||||||
returnStartDir
|
returnStartDir
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
%% CALLED BY EASYconsole.m %%
|
%% CALLED BY EASYconsole.m %%
|
||||||
|
|
||||||
|
w=pwd;
|
||||||
|
|
||||||
%function NImStartupImCF02par4Gbl
|
%function NImStartupImCF02par4Gbl
|
||||||
Fflg= 1; %0;
|
Fflg=1; %0;
|
||||||
|
|
||||||
fclose('all'); %close all open files
|
fclose('all'); %close all open files
|
||||||
clear ('plate2', 'scanIntens','Scanfiles','pathname','tifFileLstP4')
|
clear ('plate2', 'scanIntens','Scanfiles','pathname','tifFileLstP4')
|
||||||
@@ -14,7 +16,6 @@ global ImParMat
|
|||||||
%global CSrchRng
|
%global CSrchRng
|
||||||
global expDir
|
global expDir
|
||||||
global SWnewExp
|
global SWnewExp
|
||||||
%Console globals*******
|
|
||||||
global openExpfile
|
global openExpfile
|
||||||
global openExppath
|
global openExppath
|
||||||
global newExpfile
|
global newExpfile
|
||||||
@@ -24,8 +25,7 @@ global fhconsole
|
|||||||
global ExpPath
|
global ExpPath
|
||||||
global resDir
|
global resDir
|
||||||
global wCodeDir
|
global wCodeDir
|
||||||
global matDir %
|
global matDir
|
||||||
|
|
||||||
global ImWidth
|
global ImWidth
|
||||||
global ImHeigth
|
global ImHeigth
|
||||||
global numRows;
|
global numRows;
|
||||||
@@ -35,48 +35,47 @@ global scan
|
|||||||
%global scanSize
|
%global scanSize
|
||||||
global scanMax
|
global scanMax
|
||||||
global tptLength
|
global tptLength
|
||||||
|
%global scanPar4x
|
||||||
%global sols
|
%global sols
|
||||||
%global CFmeth
|
%global CFmeth
|
||||||
|
|
||||||
numRows=24; %for Single Vertical
|
numRows=24; %for Single Vertical
|
||||||
numCols=16; %for Single Vertical
|
numCols=16; %for Single Vertical
|
||||||
|
|
||||||
%global scanPar4x
|
|
||||||
%*************CIRCLE related*************************
|
%*************CIRCLE related*************************
|
||||||
|
|
||||||
doCircle=1; %use Circle area analysis 14_0807
|
doCircle=1; %use Circle area analysis 14_0807
|
||||||
radius=14;
|
radius=14;
|
||||||
ImParMat(10)=radius;
|
ImParMat(10)=radius;
|
||||||
ImParMat(11)=doCircle;
|
ImParMat(11)=doCircle;
|
||||||
|
|
||||||
try
|
try
|
||||||
clf(fhconsole,'reset')
|
clf(fhconsole,'reset')
|
||||||
catch ME
|
catch ME
|
||||||
end
|
end
|
||||||
close
|
close
|
||||||
|
|
||||||
%******************************************
|
%******************************************
|
||||||
EASYconsole
|
EASYconsole
|
||||||
%******************************************
|
%******************************************
|
||||||
try
|
try
|
||||||
load(ExpOutmat)
|
load(ExpOutmat)
|
||||||
copyfile(ExpOutmat,(fullfile(matDir,'BkUp',strcat((num2str(datenum(now))),'.mat'))))
|
copyfile(ExpOutmat,(fullfile(matDir,'BkUp',strcat((num2str(datenum(now))),'.mat'))))
|
||||||
catch
|
catch
|
||||||
end
|
end
|
||||||
|
|
||||||
try
|
try
|
||||||
load(fullfile(resDir,'Fotos','Nbdg')) %Modified to load from 'Fotos' 20_0819
|
load(fullfile(resDir,'Fotos','Nbdg')) %Modified to load from 'Fotos' 20_0819
|
||||||
catch
|
catch
|
||||||
%Reloacated from 'PTmats' to prevent potential overwrite when PTmats is
|
%Reloacated from 'PTmats' to prevent potential overwrite when PTmats is
|
||||||
%copied into new job when the PT template is about the same. We also
|
%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
|
%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
|
%from the new experiment are too sketchy to make a good pintool
|
||||||
%template. By moving it to 'Fotos' we avoid possible issues due to
|
%template. By moving it to 'Fotos' we avoid possible issues due to
|
||||||
%copying the Nbdg.mat file along with the default template '.mat' files.
|
%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
|
%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
|
%after each run to allow previous version of EASY to access data made
|
||||||
%by EASY versions after 20_0819.
|
%by EASY versions after 20_0819.
|
||||||
|
load(fullfile(resDir,'PTmats','Nbdg')) %Left in to accomodate loads of work before 20_0819
|
||||||
load(fullfile(resDir,'PTmats','Nbdg')) %Left in to accomodate loads of work before 20_0819
|
|
||||||
end
|
end
|
||||||
%++++++++++++++Load Fotos stored data++++++++++++++++++++
|
%++++++++++++++Load Fotos stored data++++++++++++++++++++
|
||||||
try
|
try
|
||||||
@@ -93,250 +92,193 @@ catch
|
|||||||
end
|
end
|
||||||
%******autoImCF*******************
|
%******autoImCF*******************
|
||||||
try
|
try
|
||||||
load(fullfile(resDir,'PTmats','NCFparms'))
|
load(fullfile(resDir,'PTmats','NCFparms'))
|
||||||
catch ME
|
catch ME
|
||||||
load parameters
|
load parameters
|
||||||
end
|
end
|
||||||
%*******************************
|
|
||||||
%************Get Print Times*******************************
|
%************Get Print Times*******************************
|
||||||
PrintTimes=[];
|
PrintTimes=[];
|
||||||
w= cd; %Capture current dir in w
|
if ispc
|
||||||
if ispc %Linux accommodation
|
expDir=fullfile(ExpPath,'\');
|
||||||
expDir=fullfile(ExpPath,'\');
|
elseif (isunix || ismac)
|
||||||
else
|
expDir=ExpPath
|
||||||
if isunix, expDir= ExpPath;end
|
end
|
||||||
if ismac , expDir=ExpPath;end
|
|
||||||
end
|
|
||||||
scLst={};
|
scLst={};
|
||||||
|
|
||||||
%**************Parameter Entry******************
|
%**************Parameter Entry******************
|
||||||
NImParamRadiusGui(expDir) %Ncode 122111replaced removed ,numOfPrtTimes)
|
NImParamRadiusGui(expDir) %Ncode 122111replaced removed ,numOfPrtTimes)
|
||||||
%***********************************************
|
|
||||||
%width=ImParMat(5);
|
|
||||||
width=24;
|
width=24;
|
||||||
widthEx=width-1; %width extention from reference point
|
widthEx=width-1; %width extention from reference point
|
||||||
dither=ImParMat(6);
|
dither=ImParMat(6);
|
||||||
radius=ImParMat(10);
|
radius=ImParMat(10);
|
||||||
%>>>>>>>>>>>>>>>>>>>>>>
|
|
||||||
NIcircle
|
NIcircle
|
||||||
%<<<<<<<<<<<<<<<<<<<<<<<
|
|
||||||
|
|
||||||
%***************** Load Stuff*************************
|
%***************** Load Stuff*************************
|
||||||
|
|
||||||
lastPlateOnLastScan=1; %Ncode
|
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=datevec(datestr(floor(now))); %method to get current offset year '01-Jan-"currentyr"'
|
||||||
dvec(2)=1;
|
dvec(2)=1;
|
||||||
dvec(3)=1;
|
dvec(3)=1;
|
||||||
%yrOffset=datenum('01-Jan-2012');%(dvec); %('01-Jan-2009'); %time num default is currentyear jan1
|
%yrOffset=datenum('01-Jan-2012');%(dvec); %('01-Jan-2009'); %time num default is currentyear jan1
|
||||||
%******************+++++++++++++*****************+++++++++++++++***********
|
|
||||||
numScans=size(scLst,1);
|
numScans=size(scLst,1);
|
||||||
|
|
||||||
if(isequal(SWsingleSc,1))
|
if(isequal(SWsingleSc,1))
|
||||||
selScan=str2double(char(scLst(1)));
|
selScan=str2double(char(scLst(1)));
|
||||||
%numScans=selScan;
|
|
||||||
%startScan=selScan;
|
|
||||||
else
|
else
|
||||||
%startScan=1;
|
% startScan=1;
|
||||||
end
|
end
|
||||||
|
|
||||||
SWgrowthArea= ImParMat(9);
|
SWgrowthArea=ImParMat(9);
|
||||||
load(fullfile(resDir,'PTmats','NPTmapSearch'))
|
load(fullfile(resDir,'PTmats','NPTmapSearch'))
|
||||||
PTmapPos= detPos;
|
PTmapPos=detPos;
|
||||||
|
|
||||||
%**************************************************************************
|
|
||||||
selScanNumLst= [];
|
|
||||||
|
|
||||||
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
%**************************************************************************
|
|
||||||
%*********Preallocation for Scan Loop**************************************************
|
|
||||||
|
|
||||||
|
selScanNumLst=[];
|
||||||
Scanfiles=[];
|
Scanfiles=[];
|
||||||
pathname=[];
|
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
|
if ispc
|
||||||
cd(char(strcat(expDir,scLst(1))))
|
cd(char(strcat(expDir,scLst(1))))
|
||||||
end
|
end
|
||||||
if isunix
|
if isunix
|
||||||
cd (fullfile(expDir,cell2mat(scLst(1))));
|
cd(fullfile(expDir,cell2mat(scLst(1))));
|
||||||
end
|
end
|
||||||
Scanfiles=[];
|
Scanfiles=[];
|
||||||
pathname=[];
|
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)
|
cd(w);
|
||||||
if SWsingleSc == 1
|
numFiles=size(Scanfiles,2);
|
||||||
[Scanfiles, pathname]=uigetfile('*.bmp', 'Select files','MultiSelect','on');% change '*hr*.bmp' 12/20/2011
|
|
||||||
if ischar(Scanfiles)
|
|
||||||
scd= imread(char(Scanfiles));
|
|
||||||
tptLength=1;
|
|
||||||
|
|
||||||
|
% 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
|
else
|
||||||
scd= imread(char(Scanfiles(1,1)));
|
sbdg{selScan}=uint8(zeros(24,16,4));
|
||||||
tptLength= length(Scanfiles);
|
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
%SAVE DATA in .mat files
|
%SAVE DATA in .mat files
|
||||||
save(ExpOutmat,'scan');
|
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','Nbdg')), 'sbdg');
|
||||||
|
|
||||||
save((fullfile(resDir,'Fotos','Coordinates')),'FexpScanSpots') %Saves frames at each tPt
|
save((fullfile(resDir,'Fotos','Coordinates')),'FexpScanSpots') %Saves frames at each tPt
|
||||||
save((fullfile(resDir,'Fotos','BGatTpts')),'FexpScanBMtp')
|
save((fullfile(resDir,'Fotos','BGatTpts')),'FexpScanBMtp')
|
||||||
save((fullfile(resDir,'Fotos','anlZones')),'anlZoneRefs')%Saves anl Positions at each tPt
|
save((fullfile(resDir,'Fotos','anlZones')),'anlZoneRefs')%Saves anl Positions at each tPt
|
||||||
|
|
||||||
%Print FitResults *******************************************************
|
%Print FitResults *******************************************************
|
||||||
fileExt = '.txt';
|
fileExt='.txt';
|
||||||
filePrefix = 'FitResults_';
|
filePrefix='FitResults_';
|
||||||
for scanCnt= 1:numScans
|
for scanCnt=1:numScans
|
||||||
selScan= p4L4{16,scanCnt}; %determine the actual scan in the scanCnt parfor distributed "id"
|
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));
|
%This,fprint for loop,is an very old legacy feature which slows processing. Could be
|
||||||
fileNamePlate = [filePrefix fileSuffix fileExt];
|
%removed but allows easy observation of how a run is progressing and can be
|
||||||
fileName= fullfile(resDir,'PrintResults', fileNamePlate); %[outputDirectory fileNamePlate];
|
%used as a diagnostic tool.
|
||||||
|
outCprint=p4L4;
|
||||||
|
|
||||||
%This,fprint for loop,is an very old legacy feature which slows processing. Could be
|
fid=fopen(fileName,'w');
|
||||||
%removed but allows easy observation of how a run is progressing and can be
|
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');
|
||||||
%used as a diagnostic tool.
|
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= p4L4;
|
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),...
|
||||||
fid = fopen(fileName,'w');
|
outCprint{14,scanCnt}(n,9),outCprint{14,scanCnt}(n,10),outCprint{14,scanCnt}(n,11),outCprint{14,scanCnt}(n,12),...
|
||||||
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');
|
outCprint{14,scanCnt}(n,13),outCprint{14,scanCnt}(n,14),outCprint{14,scanCnt}(n,15),outCprint{14,scanCnt}(n,16));
|
||||||
for n=1:384 %startCount:numCultures
|
end
|
||||||
fprintf(fid,'%d\t',n);
|
fclose(fid);
|
||||||
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
|
end
|
||||||
fclose(fid);
|
|
||||||
end
|
|
||||||
|
|
||||||
EASYconsole;
|
EASYconsole;
|
||||||
|
|
||||||
|
|
||||||
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
Reference in New Issue
Block a user