-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyse_single_measurements.m
66 lines (53 loc) · 2.14 KB
/
analyse_single_measurements.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function analyse_single_measurements()
% Analyses all contained single measurements (data for main text figures
% and data for measurement series for supplementary figures) and outputs a
% standardized analysis (localization precision, crude visualization) for
% every dataset.
%
% This file is part of the supplementary software for "DNA-PAINT MINFLUX
% nanoscopy", 2021 by Lynn M. Ostersehlt, Daniel C. Jans, Anna Wittek,
% Jan Keller-Findeisen, Steffen J. Sahl, Stefan W. Hell, and Stefan Jakobs
fprintf('analyse all single measurements\n');
if ~exist('get_root_folder.m', 'file')
initialize();
end
% determine file locations
root_folder = get_root_folder();
data_folder = [root_folder, filesep, 'data'];
output_folder = [root_folder, filesep, 'results', filesep, 'single-dataset'];
if ~exist(output_folder, 'dir')
mkdir(output_folder);
end
% get all subfolders of data_folder
folders = dir(data_folder);
for i = 1 : numel(folders)
folder = folders(i);
if ~folder.isdir || strcmp(folder.name, '.') || strcmp(folder.name, '..') || strcmp(folder.name, 'psf')
continue; % need to ignore the PSF folder
end
folder_name = folder.name;
fprintf('work on folder %s\n', folder_name);
folder = [data_folder, filesep, folder_name];
files = dir([folder, filesep, '*.mat']);
Nf = numel(files);
for j = 1 : Nf
file_name = files(j).name;
fprintf(' work on file %s (%d/%d)\n', file_name, j, Nf);
file = [folder, filesep, file_name];
% load Minflux file
minflux = load(file);
minflux = minflux.minflux;
% calculate extended statistics
minflux = calculate_extended_statistics(minflux);
% show as figure
figs = display_single_measurement(minflux);
% store images
out_folder = [output_folder, filesep, folder_name];
if ~exist(out_folder, 'dir')
mkdir(out_folder);
end
exportgraphics(figs(1), [out_folder, filesep, file_name(1:end-4), '.render-xy.png']);
exportgraphics(figs(2), [out_folder, filesep, file_name(1:end-4), '.properties.png']);
end
end
end