How can i segment lung fiels in x ray images?

1 view (last 30 days)
Ahmed
Ahmed on 15 Nov 2013
Answered: ahlam hamla on 17 Jan 2020
Hello,
i am working on X ray images, and i want to segment the lung field accurately i want to use ASM or Good pixel classification.
i attached one image from database. ( x ray image )
my code based on pixel classification and active contour
here is the code : code

Answers (5)

Image Analyst
Image Analyst on 15 Nov 2013
I couldn't see your image. It's in a rar archive - too much work for me to try to get the image. You can find an algorithm here: http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models then come back when you have MATLAB code you need help with.
Also see the FAQ: FAQ

Akila Rajini
Akila Rajini on 16 Sep 2014
Sir, I need a code for artery/vein segmentation of retinal images using graph based method. Can you guide me in this regard

Ahmed
Ahmed on 16 Nov 2013
Hello,
thanks for ur fast replay. here i want to segment the lung filed
to be something like that:
i want an automatic technique to help me, in my matlab file i start to normalize all image by:
if true
%Identify avarage filter for noise removal
w =(1/9)*[1 1 1 , 1 1 1 , 1 1 1];%avarage mask
[filename, pathname] = uigetfile({'*.bmp', 'Image Files'},'Select Image' );...%browse for image
File = fullfile(pathname,filename);
f = imread(File);%%%%%%%%%%%%%%
%Applay Imadjust to image (Stretching gray level)
j = imadjust(f,[],[1; 0]);%//get the negative%%%%%%%%%%%%%%%%5
%%%Convert Image to Double then resize it to
%512*512 (This reduce the processing time)
ggg=im2double(j);%covert to double
L = imresize(ggg,[512 512]);% Resize image to (512*512)102013(File)
L11=L(1:512,1:256);
L12=L(1:512,257:512);
w= fspecial('gaussian',99,16); %filtro gaussiano de sigma 16
[x,y]=size(L);
%local normalization
L2=L.^2; %imagem original ao quadrado
L_blurred=imfilter(L,w); %imagem original filtrada
L2_blurred=imfilter(L2,w); %imagem original ao quadrado filtrada
L_blurred_2=L_blurred.^2; %imagem original filtrada ao quadrado
t=(L-L_blurred)./((sqrt(L2_blurred-L_blurred_2))); % expressão da local normalization
t=mat2gray(t);
smask = fspecial('gaussian', ceil(3*.9), .9);
t = filter2(smask, t, 'same');
%imtool(t)
%
t1=t(1:512,1:256);
me1=mean2(t);%mean of image
st1=std2(t);%standerd deviation of image
t=(t-me1)*(1/st1);
imtool(t)
end
this code give me a normalized image like this one
so i want to make a code to segment lung by any method.
thanks in advance
  1 Comment
Image Analyst
Image Analyst on 16 Nov 2013
To improve your algorithm would take more time that anyone normally spends on answering an Answers forum question. After all, it might be your Masters or Ph.D. project that will take years. Sorry, but I'm not able to spend that much time helping you perfect the algorithm.

Sign in to comment.


Javier Naranjo
Javier Naranjo on 5 Mar 2016
Did you get the solution?

ahlam hamla
ahlam hamla on 17 Jan 2020
hi
I'm looking for graph cut technique
can someone help me about this progam
i want to use this technique to detect lungs on CT -scan images

Community Treasure Hunt

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

Start Hunting!