To segment a specific region in an image

2 views (last 30 days)
Aik Hong
Aik Hong on 11 Nov 2014
Hi all, i need help with this task. I'm very new to Matlab and currently trying to do some image segmentation work here. I have an image in DICOM format. I have now able to read it, and convert it to binary image using bwlabel function. But now i'm stuck at how to segment and get only the specific region that i want in the image.. My code as in below. How if i only want to segment and obtain the round shape object (lumen, at the middle of the image)? Need your help and advice so that i can proceed. Thanks a lot.
info = dicominfo('C:\Users\aho3\Desktop\Matlab\CT Data\IM-0001-0001.dcm');
i = dicomread(info);
HU = i*1 - 1024;
[nx ny] = size(HU);
for i = 1:nx
for j = 1:ny
if (HU(i,j) < 230)
ucut(i,j) = 0;
end
if ((HU(i,j) >= 230) && (HU(i,j) <= 580))
ucut(i,j) = 1;
end
end
end
Lumen = bwlabel(ucut);
figure; imshow(Lumen);

Answers (0)

Community Treasure Hunt

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

Start Hunting!