clear all
clc
sad = dir('D:\Project\DB1\test\');
cell_array_of_folder_names = {sad([sad.isdir]).name};
cell_array_of_folder_names( strncmp( cell_array_of_folder_names, ".", 1 ) ) = [];
sorted_cell_array_of_folder_names = sort_nat( cell_array_of_folder_names );
[mp1, np] = size(sorted_cell_array_of_folder_names);
csf1=0;
t=1;
for i=1:mp1
P = strfind(sorted_cell_array_of_folder_names(i).name,'.');
if isempty(strfind(sorted_cell_array_of_folder_names(i).name,'.'))
csf1 = csf1 +1;
SFN = sorted_cell_array_of_folder_names(i).name ;
tifList = ls(sprintf('%s%s%s%s',PF,SFN,'\','*.tif'));
[ms1, ns] = size(tifList);
for j=1:ms1
tifFileName = tifList(j,:);
IM=imread([PF SFN '\' tifFileName]);
Group_Test1(t)={i-2};
t=t+1;
end
end
PF_SFN_imgName = sprintf('%s%s%s',PF,SFN,'\',tifFileName);
end
save('Group_Test','Group_Test1');