I have a list of images in a folder where num
denotes the index of image and I used num
to run the iterations in a "for loop". The code is supposed to segment brain part from the brain CT images. Here is the link for region growing algorithm.
How do I increase the performance of my region-growing algorithm?
% CORD_XY(1),CORD_XY(2) is the seed point
% LEN Denotes the number of images in a folder
% num is used to iterate in "for loop"
% "img" here is single image from the folder in DICOM format
for num= 1:LEN
img = dicomread(files(num,1).name);
[row, col] = size(img);
th = 20;
diff = 10;
J = regiongrowing(img, CORD_XY(1), CORD_XY(2), th);
value1 = sum(sum(J > 0));
if num > 10)
th = 55;
elseif num <= 10
while diff < 0.2 * value1 && diff ~= 0 && th < 60
value1 = sum(sum(J > 0));
th = th + 10;
J = regiongrowing(double(img), CORD_XY(1), CORD_XY(2), th);
value2 = sum(sum(J > 0));
diff = value2 - value1;
end
end
end
J = regiongrowing(img, CORD_XY(1), CORD_XY(2), th-10);