⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 periodontal_diagnosis_system.m

📁 基于贝叶斯分类器的牙周病诊断系统
💻 M
📖 第 1 页 / 共 2 页
字号:
function varargout = periodontal_diagnosis_system(varargin)
% PERIODONTAL_DIAGNOSIS_SYSTEM M-file for periodontal_diagnosis_system.fig
%      PERIODONTAL_DIAGNOSIS_SYSTEM, by itself, creates a new PERIODONTAL_DIAGNOSIS_SYSTEM or raises the existing
%      singleton*.
%
%      H = PERIODONTAL_DIAGNOSIS_SYSTEM returns the handle to a new PERIODONTAL_DIAGNOSIS_SYSTEM or the handle to
%      the existing singleton*.
%
%      PERIODONTAL_DIAGNOSIS_SYSTEM('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in PERIODONTAL_DIAGNOSIS_SYSTEM.M with the given input arguments.
%
%      PERIODONTAL_DIAGNOSIS_SYSTEM('Property','Value',...) creates a new PERIODONTAL_DIAGNOSIS_SYSTEM or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before periodontal_diagnosis_system_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to periodontal_diagnosis_system_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

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help periodontal_diagnosis_system

% Last Modified by GUIDE v2.5 06-Oct-2007 15:09:28

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @periodontal_diagnosis_system_OpeningFcn, ...
                   'gui_OutputFcn',  @periodontal_diagnosis_system_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before periodontal_diagnosis_system is made visible.
function periodontal_diagnosis_system_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 periodontal_diagnosis_system (see VARARGIN)

% Choose default command line output for periodontal_diagnosis_system
handles.output = hObject;

axes(handles.axes_dicease);
pie3 off
set(handles.axes_dicease,'XMinorTick','on');
grid off
legend off

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes periodontal_diagnosis_system wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = periodontal_diagnosis_system_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)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox1


% --- Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox2


% --- Executes on button press in checkbox3.
function checkbox3_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox3


% --- Executes on button press in checkbox4.
function checkbox4_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox4


% --- Executes on button press in checkbox5.
function checkbox5_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox5

% --- Executes on button press in checkbox6.
function checkbox6_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox6


% --- Executes on button press in checkbox8.
function checkbox8_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox8


% --- Executes on button press in checkbox9.
function checkbox9_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox9


% --- Executes on button press in checkbox11.
function checkbox11_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox11

% --- Executes on button press in checkbox17.
function checkbox17_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox17 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox17


% --- Executes on button press in checkbox18.
function checkbox18_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox18 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox18


% --- 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)
% checkbox callback
list=zeros(1,11);
if (get(handles.checkbox1,'Value') == get(hObject,'Max'))
    list(1)=1;
else
    list(1)=0;
end

if (get(handles.checkbox2,'Value') == get(hObject,'Max'))
    list(2)=1;
else
    list(2)=0;
end
if (get(handles.checkbox3,'Value') == get(hObject,'Max'))
    list(3)=1;
else
    list(3)=0;
end
if (get(handles.checkbox4,'Value') == get(hObject,'Max'))
    list(4)=1;
else
    list(4)=0;
end
if (get(handles.checkbox5,'Value') == get(hObject,'Max'))
    list(5)=1;
else
    list(5)=0;
end
if (get(handles.checkbox6,'Value') == get(hObject,'Max'))
    list(6)=1;
else
    list(6)=0;
end
if (get(handles.checkbox17,'Value') == get(hObject,'Max'))
    list(7)=1;
else
    list(7)=0;
end
if (get(handles.checkbox8,'Value') == get(hObject,'Max'))
    list(8)=1;
else
    list(8)=0;
end
if (get(handles.checkbox9,'Value') == get(hObject,'Max'))
    list(9)=1;
else
    list(9)=0;
end
if (get(handles.checkbox18,'Value') == get(hObject,'Max'))
    list(10)=1;
else
    list(10)=0;
end
if (get(handles.checkbox11,'Value') == get(hObject,'Max'))
    list(11)=1;
else
    list(11)=0;
end

%matrix of class-conditional probability
ccp=[0.32,0.3,0.03,0.01,0.34,0.15,0,0,0.12,0.01,0.72;...
    0.46,0.45,0,0.01,0.08,0.42,0,0,0.39,0.02,0.17;...
    0.13,0.12,0.03,0.71,0.01,0.08,0.07,0.01,0.42,0.08,0.34;...
    0.03,0.06,0.04,0,0.87,0.05,0.03,0.01,0.04,0.65,0.22;...
    0.24,0.12,0.01,0,0.63,0.04,0.01,0.01,0.01,0,0.93;...
    0.26,0.23,0.35,0.01,0.15,0.19,0.39,0.35,0,0,0.07];
%matrix of prior probability
pp=[0.09,0.43,0.11,0.01,0.03,0.33];
xw=[1.0,1.0,1.0,1.0,1.0,1.0];
wx=[1,0,0,0,0,0];
px=0;  %sum
m=0;

for i=1:6
    for j=1:11
        ccp0(i,j)=list(j)*ccp(i,j); %ccp0 check whether select the checkbox
    end
end

for i=1:6
    for j=1:11
        if ccp0(i,j)
            xw(i)=xw(i).*ccp0(i,j); % get column value
        end
    end
end


for i=1:6
    px=px+xw(i).*pp(i);
end
for i=1:6
    wx(i)=xw(i).*pp(i)./px;
end


j=0;
for i=1:6
    if wx(i)>m;
        m=wx(i);
        j=i;
    end
end

% display the diagnosis result
switch (j)
    case 1
        set(handles.edit1,'String','急性牙龈炎');
        set(handles.edit9,'String','1.口腔卫生宣教');
        set(handles.edit10,'String','2.清除窝沟,去除食物残渣以软化牙本质');
        set(handles.edit11,'String','3.以氧化锌-丁香油酚糊剂充填沟窝');
        set(handles.edit12,'String','4.感染的牙髓组织应作根管治疗或拔除牙齿');
    case 2
        set(handles.edit1,'String','慢性龈缘炎');
        set(handles.edit9,'String','1.口腔卫生宣教');
        set(handles.edit10,'String','2.洁治');
        set(handles.edit11,'String','3.去除一切造成菌斑滞留和刺激牙龈的因素');
        set(handles.edit12,'String','4.辅助消炎药物作全身或局部治疗,如甲硝唑');
    case 3
        set(handles.edit1,'String','牙龈增生');
        set(handles.edit9,'String','1.去除局部刺激因素');
        set(handles.edit10,'String','2.局部药物治疗');
        set(handles.edit11,'String','3.手术切除并修整牙龈外形');
        set(handles.edit12,'String','4.严格控制菌斑,减少手术后的复发');
    case 4
        set(handles.edit1,'String','牙龈肿瘤及瘤样病变');
        set(handles.edit9,'String','1.去除一切可能的刺激');
        set(handles.edit10,'String','2.戒烟');
        set(handles.edit11,'String','3.较小病变,局部广泛切除');
        set(handles.edit12,'String','4.较大病变,放射治疗配合外科手术');
    case 5
        set(handles.edit1,'String','脱落性龈炎');
        set(handles.edit9,'String','1.洁治');
        set(handles.edit10,'String','2.控制或去除牙菌斑及局部全身因素');
        set(handles.edit11,'String','3.去除悬突物的充填物及外形不良的修复体');
        set(handles.edit12,'String','4.除去过多牙龈');
    case 6
        set(handles.edit1,'String','牙周炎'); 
        set(handles.edit9,'String','1.口腔科医生纠正或消除局部刺激');
        set(handles.edit10,'String','2.异常的牙龈形态为能矫正,需外科手术治疗');
        set(handles.edit11,'String','3.有深牙周袋及牙齿松动晚期,需外科手术');
        set(handles.edit12,'String','4.晚期时,需拔牙处理');
    otherwise
        set(handles.edit1,'String','???');
end






for i=1:6
    wx1(i)=wx(i)*100;
end
set(handles.edit2,'String',strcat(num2str(wx1(1)),'%'));
set(handles.edit3,'String',strcat(num2str(wx1(2)),'%'));
set(handles.edit4,'String',strcat(num2str(wx1(3)),'%'));
set(handles.edit5,'String',strcat(num2str(wx1(4)),'%'));
set(handles.edit6,'String',strcat(num2str(wx1(5)),'%'));
set(handles.edit7,'String',strcat(num2str(wx1(6)),'%'));
axes(handles.axes_dicease);
pie(wx);
set(handles.axes_dicease,'XMinorTick','on');
grid on
legend('急性牙龈炎','慢性龈缘炎','牙龈增生','牙龈肿瘤及瘤样病变','脱落性龈炎','牙周炎','Location','BestOutside');


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -