-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathshallowSave.m
74 lines (52 loc) · 1.99 KB
/
shallowSave.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
67
68
69
70
71
72
73
74
function shallowSave(shallowObj,option,progress)
[path,file]=shallowObj.getPath;
reverseStr='';
cc=1;
shallowObjOnly=0;
if nargin>=2
if strcmp(option,'shallowObj') % load only the results
shallowObjOnly=1;
disp(['Saving only shallowObj ' obj.id]);
end
end
fprintf('\n');
if shallowObjOnly==0
for i=1:numel(shallowObj.fov)
if nargin==3
progress.Message=['Saving position' num2str(i) ' /' num2str(numel(shallowObj.fov)) '...'];
progress.Value= i./numel(shallowObj.fov);
pause(0.01);
end
for j=1:numel(shallowObj.fov(i).roi)
% tic
shallowObj.fov(i).roi(j).save;
%toc
% tic
shallowObj.fov(i).roi(j).clear;
% toc
end
msg = sprintf('Writing ROIs for FOV %d / %d for FOV %s', cc,numel(shallowObj.fov)); %Don't forget this semicolon
fprintf([reverseStr, msg]);
reverseStr = repmat(sprintf('\b'), 1, length(msg));
cc=cc+1;
end
for i=1:numel(shallowObj.processing.classification)
if nargin==3
progress.Message=['Saving classifier' num2str(i) ' /' num2str(numel(shallowObj.processing.classification)) '...'];
progress.Value= i./numel(shallowObj.processing.classification);
pause(0.01);
end
classiSave( shallowObj.processing.classification(i) );
end
for i=1:numel(shallowObj.processing.processor)
if nargin==3
progress.Message=['Saving processor' num2str(i) ' /' num2str(numel(shallowObj.processing.processor)) '...'];
progress.Value= i./numel(shallowObj.processing.processor);
pause(0.01);
end
processSave( shallowObj.processing.processor(i) );
end
end
fprintf('\n');
save(fullfile(path,[file '.mat']),'shallowObj');
disp(['Shallow project ' fullfile(path,[file '.mat']) ' is saved !']);