找回密码
 注册
关于网站域名变更的通知
查看: 290|回复: 2
打印 上一主题 下一主题

基于matlab FCM和改进的FCM脑部CT图像聚类

[复制链接]
  • TA的每日心情

    2019-11-20 15:22
  • 签到天数: 2 天

    [LV.1]初来乍到

    跳转到指定楼层
    1#
    发表于 2021-4-22 13:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

    EDA365欢迎您登录!

    您需要 登录 才可以下载或查看,没有帐号?注册

    x

    - r- @8 F( s/ \' g一、源代码
    # C+ m9 {' V5 F! @9 @5 R: O
    • function varargout = CT_image_FCM(varargin)
    • % CT_IMAGE_FCM MATLAB code for CT_image_FCM.fig
    • %      CT_IMAGE_FCM, by itself, creates a new CT_IMAGE_FCM or raises the existing
    • %      singleton*.
    • %
    • %      H = CT_IMAGE_FCM returns the handle to a new CT_IMAGE_FCM or the handle to
    • %      the existing singleton*.
    • %
    • %      CT_IMAGE_FCM('CALLBACK',hObject,eventData,handles,...) calls the local
    • %      function named CALLBACK in CT_IMAGE_FCM.M with the given input arguments.
    • %
    • %      CT_IMAGE_FCM('Property','Value',...) creates a new CT_IMAGE_FCM or raises the
    • %      existing singleton*.  Starting from the left, property value pairs are
    • %      applied to the GUI before CT_image_FCM_OpeningFcn gets called.  An
    • %      unrecognized property name or invalid value makes property application
    • %      stop.  All inputs are passed to CT_image_FCM_OpeningFcn via varargin.
    • %
    • %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
    • %      instance to run (singleton)".
    • %
    • % See also: GUIDE, GUIDATA, GUIHANDLES

    • 9 G) }5 {* D' |' ]
    • % Edit the above text to modify the response to help CT_image_FCM

    • / S, F% c% U1 P4 P
    • % Last Modified by GUIDE v2.5 17-Apr-2020 00:06:23

    • / k0 Q  S, F3 e( y4 g) `7 z
    • % Begin initialization code - DO NOT EDIT
    • gui_Singleton = 1;
    • gui_State = struct('gui_Name',       mfilename, ...
    •                    'gui_Singleton',  gui_Singleton, ...
    •                    'gui_OpeningFcn', @CT_image_FCM_OpeningFcn, ...
    •                    'gui_OutputFcn',  @CT_image_FCM_OutputFcn, ...
    •                    'gui_LayoutFcn',  [] , ...
    •                    'gui_Callback',   []);
    • if nargin && ischar(varargin{1})
    •     gui_State.gui_Callback = str2func(varargin{1});
    • end

    • 5 S8 u8 [1 j* c& y; v
    • if nargout
    •     [varargout{1:nargout}] = gui_maiNFCn(gui_State, varargin{:});
    • else
    •     gui_mainfcn(gui_State, varargin{:});
    • end
    • % End initialization code - DO NOT EDIT
    • # l3 }, z7 r# f- a* J  g; {

    • : S$ B! Z/ |& @* h$ m6 U7 `, x! k9 n
    • % --- Executes just before CT_image_FCM is made visible.
    • function CT_image_FCM_OpeningFcn(hObject, eventdata, handles, varargin)
    • % This function has no output args, see OutputFcn.
    • % hObject    handle to figure
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • % varargin   command line arguments to CT_image_FCM (see VARARGIN)
    • ; \% x3 p7 e5 ]( h& Q1 n" ^6 G0 s3 ?
    • % Choose default command line output for CT_image_FCM
    • handles.output = hObject;
    • ! ~4 |3 ^  h2 j  w7 ]. ?8 K  n
    • % Update handles structure
    • guidata(hObject, handles);
    • : N/ `: r$ c- |  m7 N  R2 ?
    • % UIWAIT makes CT_image_FCM wait for user response (see UIRESUME)
    • % uiwait(handles.figure1);

    • 4 ]( H9 I" [; [0 g7 S
    • 1 w/ ]5 e" F: \& l8 D7 D
    • % --- Outputs from this function are returned to the command line.
    • function varargout = CT_image_FCM_OutputFcn(hObject, eventdata, handles)
    • % varargout  cell array for returning output args (see VARARGOUT);
    • % hObject    handle to figure
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • ) K0 i6 q9 e  J1 h! v' @7 z
    • % Get default command line output from handles structure
    • varargout{1} = handles.output;
    • : x7 x8 n6 f2 X# z4 F3 \* H
    • : u- z- x! N, d" `  |2 {) b
    • % --- Executes on button press in pushbutton1.
    • function pushbutton1_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton1 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I
    • [filename, pathname]= ...
    •     uigetfile({'*.*';'*.bmp';'*.tif';'*.png';'*.jpg'},'select picture');
    • str= [pathname filename];
    • I= imread(str);
    • axes(handles.axes1);
    • imshow(I);
    • title('原图');

    • " p! \( O& k" {9 |' T
    • % --- Executes on button press in pushbutton2.
    • function pushbutton2_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton2 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • 9 G3 x7 {* h& V  |
    • $ s9 M8 f# h) i/ Z; F2 z3 M% x
    • % --- Executes on button press in pushbutton3.
    • function pushbutton3_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton3 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I I0 A
    • [I2,clusterResult] = FCM1(I, 4,[0 80 160 255],2,150,1e-5);
    • axes(handles.axes3);
    • imshow(I2)
    • I0=I2;
    • A=unique(I0);

    • 6 f; }# E! c4 K% ]. }- d7 Z" f
    • 4 ^- {. _; T) \4 S0 @8 g2 U
    • % --- Executes on button press in pushbutton4.
    • function pushbutton4_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton4 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I0 A
    • I0_2=zeros(size(I0,1),size(I0,2));
    • for i=1:size(I0,1)
    •      for j=1:size(I0,2)
    •          if I0(i,j)==A(2)
    •              I0_2(i,j)=255;
    •          else I0_2(i,j)=0;
    •          end
    •      end
    • end
    • I0_2=uint8(I0_2);
    • axes(handles.axes4);
    • imshow(I0_2);

    • ' o* @* l% j! Y+ f8 A
    • ( L. h- y2 T% s* D
    • % --- Executes on button press in pushbutton5.
    • function pushbutton5_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton5 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I0 A
    • I0_3=zeros(size(I0,1),size(I0,2));
    • for i=1:size(I0,1)
    •      for j=1:size(I0,2)
    •          if I0(i,j)==A(3)
    •              I0_3(i,j)=255;
    •          else I0_3(i,j)=0;
    •          end
    •      end
    • end
    • I0_3=uint8(I0_3);
    • axes(handles.axes5);
    • imshow(I0_3);
    • 2 D# g' j: F& [; }: a
    • 5 |9 L  J0 V2 Z, `9 g
    • % --- Executes on button press in pushbutton6.
    • function pushbutton6_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton6 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I0 A
    • I0_4=zeros(size(I0,1),size(I0,2));
    • for i=1:size(I0,1)
    •      for j=1:size(I0,2)
    •          if I0(i,j)==A(4)
    •              I0_4(i,j)=255;
    •          else I0_4(i,j)=0;
    •          end
    •      end
    • end
    • I0_4=uint8(I0_4);
    • axes(handles.axes6);
    • imshow(I0_4);
      2 ~" K8 m6 O; [
                           
    & z/ c) ]8 W* }* s* ]' k. M: F# w. p5 M# i, i5 J9 m
    5 w1 ~: g5 ]0 x9 ?* k3 k! [# J, n
    • function varargout = CT_image_GFCM(varargin)
    • % CT_IMAGE_GFCM MATLAB code for CT_image_GFCM.fig
    • %      CT_IMAGE_GFCM, by itself, creates a new CT_IMAGE_GFCM or raises the existing
    • %      singleton*.
    • %
    • %      H = CT_IMAGE_GFCM returns the handle to a new CT_IMAGE_GFCM or the handle to
    • %      the existing singleton*.
    • %
    • %      CT_IMAGE_GFCM('CALLBACK',hObject,eventData,handles,...) calls the local
    • %      function named CALLBACK in CT_IMAGE_GFCM.M with the given input arguments.
    • %
    • %      CT_IMAGE_GFCM('Property','Value',...) creates a new CT_IMAGE_GFCM or raises the
    • %      existing singleton*.  Starting from the left, property value pairs are
    • %      applied to the GUI before CT_image_GFCM_OpeningFcn gets called.  An
    • %      unrecognized property name or invalid value makes property application
    • %      stop.  All inputs are passed to CT_image_GFCM_OpeningFcn via varargin.
    • %
    • %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
    • %      instance to run (singleton)".
    • %
    • % See also: GUIDE, GUIDATA, GUIHANDLES

    • ; f* K5 ~; d: k9 ]6 C0 i& M. z# `% z
    • % Edit the above text to modify the response to help CT_image_GFCM
    • ; ]2 w. J6 l' W* x- x
    • % Last Modified by GUIDE v2.5 13-Apr-2020 21:47:11

    • 5 h; r5 J: _# a. N8 Z
    • % Begin initialization code - DO NOT EDIT
    • gui_Singleton = 1;
    • gui_State = struct('gui_Name',       mfilename, ...
    •                    'gui_Singleton',  gui_Singleton, ...
    •                    'gui_OpeningFcn', @CT_image_GFCM_OpeningFcn, ...
    •                    'gui_OutputFcn',  @CT_image_GFCM_OutputFcn, ...
    •                    'gui_LayoutFcn',  [] , ...
    •                    'gui_Callback',   []);
    • if nargin && ischar(varargin{1})
    •     gui_State.gui_Callback = str2func(varargin{1});
    • end

    • 8 D0 q( m% V9 _# T
    • if nargout
    •     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
    • else
    •     gui_mainfcn(gui_State, varargin{:});
    • end
    • % End initialization code - DO NOT EDIT
    • - _, c/ v  S7 ?& @

    • * {) C- w4 _. k+ z- w) g
    • % --- Executes just before CT_image_GFCM is made visible.
    • function CT_image_GFCM_OpeningFcn(hObject, eventdata, handles, varargin)
    • % This function has no output args, see OutputFcn.
    • % hObject    handle to figure
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • % varargin   command line arguments to CT_image_GFCM (see VARARGIN)

    • ' @$ L6 K# S, |* Y
    • % Choose default command line output for CT_image_GFCM
    • handles.output = hObject;

    •   K: ]. C" \- M/ X7 a% D% l
    • % Update handles structure
    • guidata(hObject, handles);
    • + ]! N' I) l& J0 K+ J9 l, J
    • % UIWAIT makes CT_image_GFCM wait for user response (see UIRESUME)
    • % uiwait(handles.figure1);

    • 8 l2 f: j* m& L& S
    • 0 W/ v' W) R( U$ g' [
    • % --- Outputs from this function are returned to the command line.
    • function varargout = CT_image_GFCM_OutputFcn(hObject, eventdata, handles)
    • % varargout  cell array for returning output args (see VARARGOUT);
    • % hObject    handle to figure
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • 2 A4 J7 D0 U' V3 ^
    • % Get default command line output from handles structure
    • varargout{1} = handles.output;

    • 5 s- v$ I" A4 }
    • ) c+ ?- e  M0 B) V! N6 T. B" H, i
    • % --- Executes on button press in pushbutton1.
    • function pushbutton1_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton1 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I
    • [filename, pathname]= ...
    •     uigetfile({'*.*';'*.bmp';'*.tif';'*.png';'*.jpg'},'select picture');
    • str= [pathname filename];
    • I= imread(str);
    • axes(handles.axes1);
    • imshow(I);
    • title('原图');

    • 4 k; V8 I- ?, q' r. [8 g- k
    • % --- Executes on button press in pushbutton2.
    • function pushbutton2_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton2 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I
    • I=medfilt2(I,[3,3]);
    • axes(handles.axes2);
    • imshow(I)
    • 9 ]% W) }# X1 m

    • ) M' P5 M2 E. f
    • % --- Executes on button press in pushbutton3.
    • function pushbutton3_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton3 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I r c U
    • [r,c] = size(I);
    • data = zeros(r*c,1);
    • for i = 1:r
    •     for j = 1:c
    •         data((i-1)*c+j,1) = double(I(i,j));
    •     end
    • end
    • [center, U, obj_fcn] = GFCM(data,4,0.9);

    • : X6 \; p- O5 J8 Y  T
    • for i = 1 : r
    •     for j = 1 : c
    •         temp = (double(I(i, j)) - center) .^ 2;
    •         [fmin pos] = min(temp);
    •         I(i, j) = uint8(pos * 255 / 4);
    •     end
    • end
    • axes(handles.axes3);
    • imshow(I)

    • & a; W* u+ n* s% `( G( v+ C8 N
    • % --- Executes on button press in pushbutton4.
    • function pushbutton4_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton4 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I r c U
    • I_seg2 = I*0;
    • for i = 1:r
    •     for j = 1:c
    •         if U(1,(i-1)*c+j)<U(2,(i-1)*c+j)
    •             I_seg2(i,j) =0 ;
    •         else
    •             I_seg2(i,j) =255;
    •         end
    •     end
    • end
    • axes(handles.axes4);
    • imshow(I_seg2)

    • + G/ @% r) q6 G: @' g. ?+ e: Y
    • % --- Executes on button press in pushbutton5.
    • function pushbutton5_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton5 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I r c U
    • I_seg3 = I*0;
    • for i = 1:r
    •     for j = 1:c
    •         if U(1,(i-1)*c+j)<U(3,(i-1)*c+j)
    •             I_seg3(i,j) =0 ;
    •         else
    •             I_seg3(i,j) =255;
    •         end
    •     end
    • end
    • axes(handles.axes5);
    • imshow(I_seg3)
    • * T! e% m2 \4 o4 e& Q" N- f
    • % --- Executes on button press in pushbutton6.
    • function pushbutton6_Callback(hObject, eventdata, handles)
    • % hObject    handle to pushbutton6 (see GCBO)
    • % eventdata  reserved - to be defined in a future version of MATLAB
    • % handles    structure with handles and user data (see GUIDATA)
    • global I r c U
    • I_seg4 = I*0;
    • for i = 1:r
    •     for j = 1:c
    •         if U(1,(i-1)*c+j)<U(4,(i-1)*c+j)
    •             I_seg4(i,j) =0 ;
    •         else
    •             I_seg4(i,j) =255;
    •         end
    •     end
    • end
    • axes(handles.axes6);
    • imshow(I_seg4)" l; [( F& K5 f2 i
                         
    / T# t2 }0 O4 ]9 _; u0 p5 y  L  P! @0 A0 I

    & f6 Z3 X6 Q( b+ p% l% {二、运行结果0 |- m. W, W1 ?" [6 K. x1 |

    ' u+ U. D' i' Y2 k  c
    ; M2 }6 _9 s* f2 E8 t* y0 y6 K+ K& S0 l5 {) V" u
    3 v- U$ M# u2 x% t! S7 n- M

    该用户从未签到

    2#
    发表于 2021-4-22 14:50 | 只看该作者
    基于matlab FCM和改进的FCM脑部CT图像聚类

    该用户从未签到

    3#
    发表于 2021-4-25 17:05 | 只看该作者
    收藏到源代码库9 X  ]% j# q5 v, u
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-10-5 17:44 , Processed in 0.171875 second(s), 26 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

    快速回复 返回顶部 返回列表