clear all close all clc orig_gen gen type Berea types sr types 166 158

  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
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
clear all; close all; clc
% orig_gen = 'gen';
% type = 'Berea';
types = ["sr"];
% types = ["166", "158"];
orig_gen_all = ["gen", "orig"];
for i = 1:length(types)
for j = 1:length(orig_gen_all)
type = types(i);
orig_gen = orig_gen_all(j);
% ours, berea, ketton
myFolder = sprintf('../Documents/128/%s/', type);
myFiles = dir(sprintf('../Documents/128/%s/%s*.hdf5', type, orig_gen)); %gets all wav files in struct
disp(myFiles);
meanbreadth = zeros(size(myFiles));
volume = zeros(size(myFiles));
surface = zeros(size(myFiles));
euler = zeros(size(myFiles));
for k = 1:length(myFiles)
baseFileName = myFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
obj = h5read(fullFileName, '/data');
meanbreadth(k) = mb(obj);
volume(k) = vol(obj);
surface(k) = surf(obj);
euler(k) = eu(obj);
% mb(obj)
% all of your actions for filtering and plotting go here
end
meanbreadth
dlmwrite(sprintf('../Documents/mink128/%s_mean_breadth_%s.txt',orig_gen, type), meanbreadth)
volume
dlmwrite(sprintf('../Documents/mink128/%s_volume_%s.txt',orig_gen, type),volume)
surface
dlmwrite(sprintf('../Documents/mink128/%s_surface_%s.txt',orig_gen, type),surface)
euler
dlmwrite(sprintf('../Documents/mink128/%s_euler_%s.txt',orig_gen, type),euler)
end
end
function f = eu(obj)
% i = 1;
% while 1
% subimage = obj.read();
% % size(subimage)
% subimages(i,:,:) = subimage;
% if (obj.lastDirectory())
% break;
% end
% obj.nextDirectory()
% i = i+1;
% end
% size(subimages)
f = imEuler3d(obj);
end
function f = vol(obj)
% i = 1;
% while 1
% subimage = obj.read();
% % size(subimage)
% subimages(i,:,:) = subimage;
% if (obj.lastDirectory())
% break;
% end
% obj.nextDirectory()
% i = i+1;
% end
% size(subimages)
f = imVolume(obj);
end
function f = surf(obj)
% i = 1;
% while 1
% subimage = obj.read();
% % size(subimage)
% subimages(i,:,:) = subimage;
% if (obj.lastDirectory())
% break;
% end
% obj.nextDirectory()
% i = i+1;
% end
% size(subimages)
f = imSurface(obj);
end
function f = mb(obj)
% i = 1;
% while 1
% subimage = obj.read();
% % size(subimage)
% subimages(i,:,:) = subimage;
% if (obj.lastDirectory())
% break;
% end
% obj.nextDirectory()
% i = i+1;
% end
% size(subimages)
f = imMeanBreadth(obj, 13);
end