0001 function copySample()
0002
0003 fid = fopen('_sample/WBC_FP_PROBLEMS.txt');
0004 C = textscan(fid,'%u %s');
0005 headers = {'id','type'};
0006 S = cell2struct(C,headers,2);
0007
0008
0009 types = unique(S.type);
0010 for t=1: length(types)
0011 if ~exist(strcat('_sample/FP/', char(types(t))),'dir')
0012 mkdir(strcat('_sample/FP/', char(types(t))));
0013 end
0014 end
0015
0016
0017 for i = 1: length(S.id)
0018
0019
0020 source = strcat('_sample/FP/FP_', num2str(S.id(i)),'.png');
0021 destination = strcat('_sample/FP/', char(S.type(i)),'/');
0022
0023 copyfile(source, destination);
0024
0025
0026
0027 end
0028
0029
0030 end