Fuzzy C Means for tumor segmentation using Matlab MATLAB Answers MATLAB Central

0 votes

Fuzzy C Means for tumor segmentation using Matlab
Asked by Gomathi C on 2 Mar 2012
Latest activity Commented on by YASSER on 6 Mar 2014
I have a segmented liver. I need to segment the tumor in it. I used the FCM method. It is a 3 level FCM
thresholding. When I apply it to the images, I need the tumor region(the region that is darker than the
remaining parts) alone to get segmented. But am getting the reverse. All the region surrounding the
tumor gets segmented. Kindly help me out. The program has two files. testfcmthresh.m and a function
fcmthresh.m
I tried complementing the image obtained by using imcomplement() But I got the entire background also
as white, since the background was originally dark. Kindly help me out.

function [bw,level]=fcmthresh IM,sw
%FCMTHRESH Thresholding by  ‐class fuzzy c‐means clustering
%  [bw,level]=fcmthresh IM,sw  outputs the binary image bw and threshold level of
%  image IM using a  ‐class fuzzy c‐means clustering. It often works better
%  than Otsu's methold which outputs larger or smaller threshold on
%  fluorescence images.
%  sw is 0 or  , a switch of cut‐off position.
%  sw=0, cut between the small and middle class

%  sw= , cut between the middle and large class
%
%  Contributed by Guanglei Xiong  xgl99@mails.tsinghua.edu.cn
%  at Tsinghua University, Beijing, China.

% check the parameters
if  nargin<
    error 'You must provide an image.' ;
elseif  nargin==
    sw=0;
elseif  sw~=0 && sw~=
    error 'sw must be 0 or  .' ;
end
data=reshape IM,[], ;
[center,member]=fcm data, ;
[center,cidx]=sort center ;
member=member';
member=member :,cidx ;
[maxmember,label]=max member,[], ;
if sw==0

    level= max data label==
+min data label==
else
    level= max data label==
+min data label==
end
bw=im bw IM,level ;
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

/ ;
/ ;

%testfcmthresh.m
clear;clc;
im=imread 'mliver .jpg' ;
fim=mat gray im ;
level=graythresh fim ;
bwfim=im bw fim,0. ;
[bwfim0,level0]=fcmthresh fim,0 ;
[bwfim ,level ]=fcmthresh fim, ;

subplot , , ;
imshow fim ;title 'Original' ;
subplot , , ;
imshow bwfim ;title sprintf 'Otsu,level=%f',level ;
subplot , , ;
imshow bwfim0 ;title sprintf 'FCM0,level=%f',level0 ;
subplot , , ;
imshow bwfim ;title sprintf 'FCM ,level=%f',level
;
% imwrite bwfim ,'fliver6.jpg' ;

 1 Comment
YASSER on 6 Mar 2014
 Link
you say that you have 3 class images, but in the result you have 2 Images why? and
how to get the third imge?

Tags
fuzzy segmentation


Products
No products are associated with this question.

 1 Answer

0 votes

 Link
Answer by Nerea Zubiaurre on 2 Mar 2012
Where did you find the FCM method?

 1 Comment
Gomathi C on 2 Mar 2012
 Link
matlab central file exchange as FCM Thresholding

Discover what MATLAB® can do for your career.
Opportunities for recent engineering grads.
 Apply today