-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpredict_arg_scald_silver.m
More file actions
43 lines (37 loc) · 1.59 KB
/
Copy pathpredict_arg_scald_silver.m
File metadata and controls
43 lines (37 loc) · 1.59 KB
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
%segmRes = objectOrientedSegmentation ('hepg2f_1.jpg', 5, 20, 0.1, 400);
addpath('z:\ARGraphs\x64\Release');
addpath('z:\ARGraphs');
addpath('Z:\ARGraphs\arggraphs_segmentation\natsort');
plot_results = 1;
name = 'tiles_scaled_silver';
% Non-scaled samples
% 20x :
%results = ['tarea' 'dSize' 'gAngle' 'offset' 'F1 score' 'AJI'];
folder_name = 'results_tiles_scaled_silver';
folder_inference = 'C:\dataset\data\tiles_scaled_silver_revision\test\';
actual_folders = dir(folder_inference);
image_files = [];
for x=3:length(actual_folders)
curr_files = dir(strcat(folder_inference,actual_folders(x).name,'\images\', '*_dlm_img'));
curr_files = natsortfiles({curr_files.name});
for t=1:length(curr_files)
image_files = [image_files; {strcat(folder_inference,actual_folders(x).name,'\images\',curr_files(t))}];
end
end
load(strcat('Z:\ARGraphs\results\',folder_name,'\results_chosen_fine.mat'));
a=erg(1);
b=erg(2);
c=erg(3);
d=erg(4);
prediction_results = cell(length(image_files),1);
for i=1:length(image_files)
img = image_files{i};
mask = strrep(img,'dlm_img','dlm_mask');
ARGraphs_Mex_NEU('1',img,mask,'prim',num2str(a),num2str(b),num2str(c),'-1','2');
ARGraphs_Mex_NEU('2','prim',mask,num2str(d),'segmented_cells','2');
prediction = dlmread('segmented_cells');
prediction = prediction(2:257,:);
prediction_results{i} = compute_final_mask(prediction);
disp (strcat('Running crop ' , num2str(i) , ' from ' , num2str(length(image_files))))
end
save(strcat('arg_',folder_name,'_predictions_updated'),'prediction_results');