Commit fa727990 authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

add function to collect results (close issue #10)

parent e8d6bdb1
function DMA_collectdir(dirs)
% pick up defaults
param = DMA_labconfig;
% parse arguments
if nargin == 0
param.dir = uigetdir(pwd, 'Which directory do you wish to process?');
elseif ischar(dirs)
param.dir = dirs;
else
param = dirs;
end
% full name of parameter file in dir
pname = fullfile(param.dir, 'DMAlab_param.m');
% pick up local settings
if exist(pname, 'file')
run(pname);
else
warning('file %s not found, using defaults throughout.\n', pname)
end
if isempty(param.dir), param.dir = pwd; end % JiC
if param.paramcheck > 0, param = DMA_checkparam(param); end
fprintf('* Collecting results in %s/%s\n', param.dir, param.odir);
for s = 1:numel(param.collect)
list = dir(fullfile(param.dir, param.odir, ...
strcat('*.', param.collect{s})));
fid = fopen(fullfile(param.dir, strcat('all', param.collect{s}, ...
'.csv')), 'w+');
for l = 1:numel(list)
fprintf('\t ** parsing %s\n', list(l).name)
fprintf(fid, '%% %s\n', list(l).name);
data = load(fullfile(param.dir, param.odir, list(l).name));
if strcmp(param.collect{s}, 'ncel')
fprintf(fid, ['%i, %i, %i, %i, %i, %i, %i, %i, %i, ', ...
'%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, ', ...
'%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i\n'], ...
data');
elseif strcmp(param.collect{s}, 'dcel')
fprintf(fid, ['%i, %i, %i, %i, %i, %i, %i, %i, %i, ', ...
'%i, %i, %i\n'], data');
end
end
fclose(fid);
fprintf('\t * %s results written to %s\n', param.collect{s}, ...
fullfile(param.dir, strcat('all', param.collect{s}, '.csv')));
end
fprintf('* Done collecting results in %s/%s\n', param.dir, param.odir);
% part of DMAlab: https://gitlab.tue.nl/STEM/DMAlab
end
......@@ -391,6 +391,9 @@ labdef = DMA_labconfig; % Courtesy of Douglas
labdef.maxgapn = 2; % fill up to a maximum of n gaps in cell detection over time
labdef.maxgapw = 2; % only fill gaps when smaller than w frames
% collecting results
labdef.collect = {'ncel', 'dcel'}; % extensions to collect
%%% GUIs %%%
labdef.iscale = 100; % set cellminI threshhold in traceGUI at 100 pixels
......@@ -404,11 +407,11 @@ labdef = DMA_labconfig; % Courtesy of Douglas
'maxcells', 'cellminA', 'cellmaxA', 'celltophat', ...
'cellminIrel', 'cellminIraw', 'iscale', 'maxgapn', ...
'maxgapw', 'paramcheck'};
% and finally:
labdef.DMAlabUrl = 'https://gitlab.tue.nl/STEM/DMAlab';
labdef.DMAlabBranch = 'testing'; % Update to 'master' before merge!
labdef.DMAlabVersion = '0.03a3u1+'; % Update *before* merge!
labdef.DMAlabVersion = '0.03-beta'; % Update *before* merge!
end
......
% written by DMA_writeparam
% https://gitlab.tue.nl/STEM/DMAlab
% @ 01-Apr-2020 19:44:20
param.dir = '/home/mark/git/DMAlab/data';
param.nbit = 14;
param.BF = 1;
param.fluo = [2, 3, 4];
param.nchan = 4;
param.odir = 'DMout';
param.BFstretch = [0.010000, 0.700000];
param.BFgamma = 1.000000e+00;
param.circrad = [25, 45];
param.maxmove = 5.000000e-01;
param.maxcells = 4;
param.cellminI = [0.550000, 0.550000, 0.550000];
param.cellminIraw = 0;
param.cellminIrel = 0;
param.cellminA = [10, 10, 10];
param.cellmaxA = [1000, 1000, 1000];
param.celltophat = [8, 8, 8];
param.cellthresh = [-1.000000, -1.000000, -1.000000];
param.cellstretch = [0.010000, 0.300000;
0.010000, 0.300000;
0.010000, 0.300000];
param.maxgapn = 2;
param.maxgapw = 2;
param.iscale = 100;
param.instpath = '/home/mark/git/DMAlab/';
param.paramcheck = 1;
param.intvars = {'nbit', 'circrad', 'nchan', 'BF', 'fluo', 'maxcells', 'cellminA', 'cellmaxA', 'celltophat', 'cellminIrel', 'cellminIraw', 'iscale', 'maxgapn', 'maxgapw', 'paramcheck'};
param.DMAlabUrl = 'https://gitlab.tue.nl/STEM/DMAlab';
param.DMAlabBranch = 'testing';
param.DMAlabVersion = '0.02u3+';
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment