Creating a 5*5 window around the initial seed point in a region growing algorithm?

3 views (last 30 days)
Hi,
I am trying to implement a region growing algorithm to segment tumor in gastric. I would select the initial seed point manually. Then a 5*5 window would be created around the initial seed point. The minimum value inside the window would be selected as the first seed point of the region growing algorithm. Another new 5*5 window would be created around the the first seed point and the algorithm would be applied within that window. My problem is that I am unable to create the window around the initial seed point. I tried the code below but I don't get the correct result. The original image is attached as Original_Image.png and the tumor region would supposedly look as shown in Tumor.png. Any suggestions would be helpful. Thank you.
i=rgb2gray(imread('Original_Image.png'));
figure, imshow(i,[])
% gg = uint8(255 * mat2gray(i));
[x,y]=getpts;x=round(x);y=round(y);
a=imgaussfilt(i,2);
% a=rgb2gray(a);
b=adapthisteq(a);
m=regMLT(b,x,y,12);
m=imfill(m,'holes');
bw=imbinarize(m);
bw=bwareafilt(bw,1);
seg = region_seg(m, bw, 30);
seg=double(Y).*double(seg);
figure, imshow(seg,[])

Answers (0)

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!