Unable to select seed points manually in region growing algorithm

9 views (last 30 days)
Warid Islam
Warid Islam on 24 Mar 2021
Commented: Warid Islam on 24 Mar 2021
Hi,
I am trying to implement a multilayer region growing algorithm for breast tumor segmentation. I am trying to select the initial seed point manually. I left clicked on the center point on the image once and pressed enter, but it is showing me an error message. Any suggestions would be appreciated.
I= rgb2gray((imread('TM25.jpg')));
figure,imshow(I)
[x,y]=getpts;
% x=300; y=340;
a=imgaussfilt(I,2);
b=adapthisteq(a);
m=regiongrowing_MLT(b,x,y,12);
m=imfill(m,'holes');
figure,imshow(m)
The following error message is displayed.
Index in position 2 is invalid. Array indices must be positive integers or logical values.
Error in regiongrowing_MLT (line 6)
A1 = double(img(x,y));
Error in segm (line 8)
m=regiongrowing_MLT(b,x,y,12);

Accepted Answer

Rik
Rik on 24 Mar 2021
Edited: Rik on 24 Mar 2021
getpts will return decimal values, so you will have to use round.
I= rgb2gray((imread('TM25.jpg')));
figure,imshow(I)
[x,y]=getpts;x=round(x);y=round(y);
% x=300; y=340;
a=imgaussfilt(I,2);
b=adapthisteq(a);
m=regiongrowing_MLT(b,x,y,12);
m=imfill(m,'holes');
figure,imshow(m)
Also, you might be interested in RegGrow, which doesn't require any toolbox and produces the same result on a wide range of runtimes (it works GNU Octave, and every release of Matlab of the past 2 decades).

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!