segmenting the lung region

2 vues (au cours des 30 derniers jours)
ANUSHA H P
ANUSHA H P le 10 Jan 2022
Commenté : ANUSHA H P le 11 Jan 2022
i have converted the CXR to binary image, my aim is to obtain only those lung region,
i have used the same code as lung segmentation.m posted by @Image Analyst which was off great help, i would like further asisst in extracting only the lung region.
Any help is appreciated. Thankyou
  2 commentaires
Simon Chan
Simon Chan le 10 Jan 2022
Did you try function imclearborder?
ANUSHA H P
ANUSHA H P le 10 Jan 2022
l=imread('E:\project\dataset\CHNCXR_0042_0.png');
k=imresize(l,[256,256]);
p=imnoise(k,'salt & pepper',0.04);
h=medfilt2(p);
d=adapthisteq(h);
e=imbinarize(d);
f = imclearborder(e);
f = bwareafilt(e,5);
f = ~bwareaopen(~f, 1000);
i have used this code..

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 10 Jan 2022
Try
mask = imclearborder(mask); % Get rid of blobs touching the edge of the image.
mask = bwareafilt(mask, 2); % Take the largest 2 of the remaining blobs.
  5 commentaires
ANUSHA H P
ANUSHA H P le 11 Jan 2022
Thankyou sir for the reference.

Connectez-vous pour commenter.

Plus de réponses (1)

KSSV
KSSV le 10 Jan 2022
rgbImage = imread('https://in.mathworks.com/matlabcentral/answers/uploaded_files/858110/image.jpg') ;
% Removing the extra white background around the image (credit to Image
% Analyst)
grayImage = min(rgbImage, [], 3);
binaryImage = grayImage < 200;
binaryImage = bwareafilt(binaryImage, 1);
[rows, columns] = find(binaryImage);
row1 = min(rows);
row2 = max(rows);
col1 = min(columns);
col2 = max(columns);
% Crop
croppedImage = rgbImage(row1:row2, col1:col2, :);
BW = imbinarize(rgb2gray(croppedImage)) ;
[B,L] = bwboundaries(BW,'noholes');
imshow(label2rgb(L, @jet, [.5 .5 .5]))
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'w', 'LineWidth', 2)
end
  1 commentaire
ANUSHA H P
ANUSHA H P le 10 Jan 2022
hi, Thankyou for the response, this was of great help.
One more clarification,
I need the output to be in binary form i.e ROI.
I have attached a reference image named as ROI.png.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Medical Physics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by