function varargout = MAIN_GUI(varargin)
% MAIN_GUI MATLAB code for MAIN_GUI.fig
% MAIN_GUI, by itself, creates a new MAIN_GUI or raises the existing
% singleton*.
%
% H = MAIN_GUI returns the handle to a new MAIN_GUI or the handle to
% the existing singleton*.
%
% MAIN_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAIN_GUI.M with the given input arguments.
%
% MAIN_GUI('Property','Value',...) creates a new MAIN_GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before MAIN_GUI_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to MAIN_GUI_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
% Edit the above text to modify the response to help MAIN_GUI
% Last Modified by GUIDE v2.5 23-Mar-2018 18:56:59
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MAIN_GUI_OpeningFcn, ...
'gui_OutputFcn', @MAIN_GUI_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 MAIN_GUI is made visible.
function MAIN_GUI_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 MAIN_GUI (see VARARGIN)
% Choose default command line output for MAIN_GUI
handles.output = hObject;
a = ones(256,256);
axes(handles.axes1);
imshow(a);
axes(handles.axes8);
imshow(a);
axes(handles.axes9);
imshow(a);
axes(handles.axes10);
imshow(a);
axes(handles.axes11);
imshow(a);
axes(handles.axes12);
imshow(a);
set(handles.text2,'string',' ');
set(handles.text3,'string',' ');
set(handles.text4,'string',' ');
set(handles.text6,'string',' ');
set(handles.text7,'string',' ');
set(handles.text8,'string',' ');
% set(handles.axes3, 'Visible', 'off');
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MAIN_GUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MAIN_GUI_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;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- 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)
handles.output = hObject;
for i=1:2
[file,path]= uigetfile('*.*','Select Image');
if file~=0
I=imread(strcat(path,file));
I=imresize(I,[256,256]);
% if size(T,3)>1
% T=rgb2gray(T);
% end
% if i==2
% h = fspecial('gaussian',5,5);
% if size(I,3)>1
% I(:,:,1)=imfilter(I(:,:,1),h);
% I(:,:,2)=imfilter(I(:,:,2),h);
% I(:,:,3)=imfilter(I(:,:,3),h);
% else
% I=imfilter(I,h);
% end
% end
T(:,:,:,i)=I;
% end
else
warndlg('User pressed cancel');
end
end
%%
[r2,c2,d]=size(T(:,:,:,1));
im1=T(:,:,:,1);
im2=T(:,:,:,2);
% subplot(3,2,1),
axes(handles.axes1),imshow(im1,[]);
set(handles.text2,'string','ORIGINAL IMAGE1');
%%
axes(handles.axes8),imshow(im2,[]);
set(handles.text3,'string','ORIGINAL IMAGE2');
%%
handles.T=T;
handles.im=im2;
guidata(hObject, handles);
% --- 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)
% handles.output = hObject;
% I=handles.test;
% %training
% A=questdlg('Which is your choise?', 'Type','training','already trained ','training');
% % a=input('You want to train new feature press 1 or 2 for already trained features');
% if strcmp(A,'training')
a=input('You want to train new feature press 1 or 2 for already trained features');
if a==1
%%
diry=[pwd '\' 'with_disease'];
disp('training disease image features.....');
feature1=training(diry);
diry=[pwd '\' 'without_disease'];
disp('training without disease image features.....');
feature2=training(diry);
l1=size(feature1,1);
l2=size(feature2,1);
traindata(:,1:l1)=feature1';
traindata(:,(l1+1):l1+l2)=feature2';
traindata1(:,1:l1)=feature1';
traindata1=traindata1+10;
traindata1(:,(l1+1):l1+l2)=feature2';
g1=ones(1,l1);
g2=ones(1,l2)*2;
traingroup1=[repmat('1',[1,l1]),repmat('2',[1,l2])];
traingroup=[g1 g2];
clear diry
clear g1
clear g2
clear l2
clear l1
clear feature1
clear feature2
handles.in=traindata;
handles.gp=traingroup;
handles.in1=traindata1;
handles.gp1=traingroup1;
save trained
else
load trained;
% handles.in=traindata;
% handles.gp=traingroup;
% handles.in1=traindata1;
% handles.gp1=traingroup1;
end
guidata(hObject,handles);
% --- 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)
a = ones(256,256);
axes(handles.axes1);
imshow(a);
axes(handles.axes8);
imshow(a);
axes(handles.axes9);
imshow(a);
axes(handles.axes10);
imshow(a);
axes(handles.axes11);
imshow(a);
axes(handles.axes12);
imshow(a);
set(handles.text2,'string',' ');
set(handles.text3,'string',' ');
set(handles.text4,'string',' ');
set(handles.text6,'string',' ');
set(handles.text7,'string',' ');
set(handles.text8,'string',' ');
% --- 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)
close all;
% --- Executes on button press in pushbutton8.
fu
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
医学图像融合是将两幅不同形态的图像合并为一幅图像的过程。生成的图像可以帮助医生提取在单个模态图像中不容易识别的特征。本文旨在展示一种从大脑CT和MRI图像中检测脑肿瘤的有效方法,包含gui界面
资源推荐
资源详情
资源评论
收起资源包目录
An-Enhancement-in-Detection-of-Brain-Tumor-through-Image-Fusion-and-ANN--main.zip (68个子文件)
An-Enhancement-in-Detection-of-Brain-Tumor-through-Image-Fusion-and-ANN--main
kmeans_clustering.m 1KB
thresholdLocally.m 5KB
trained.mat 227KB
wavegray.m 1KB
idwt_code.m 367B
feature10.mat 234B
MAIN_GUI.fig 16KB
otsu.m 5KB
feature5.mat 229B
fusion_image.m 973B
psnr.m 472B
idwt_manual.m 541B
step7.m 2KB
fea final.1.mat 648B
training.m 744B
fea final.mat 665B
feature7.mat 228B
feature9.mat 229B
feature6.mat 228B
feature8.mat 229B
feature1.mat 229B
otsuregion.m 598B
detcoef_manual.m 422B
pixel_level_fusion.m 1KB
dwt_manual.m 589B
PCA_fusion_gray.m 2KB
PCA_fusion.m 3KB
main.m 3KB
feature4.mat 229B
MAIN_GUI.m 11KB
dwt_code.m 453B
wavework.m 1KB
Tr.mat 177B
testset_MRI
MRIset3.png 307KB
MRIset2.png 161KB
MRIset1.png 114KB
MRIset6.png 66KB
mri set 10.jpg 9KB
mri set 9.jpg 7KB
MRIset4.png 389KB
MRIset7.gif 27KB
Thumbs.db 130KB
MRIset8.gif 18KB
MRIset5.png 310KB
testset_CT
CTset 4.png 460KB
CTset4.png 460KB
Ottawa after.jpg 55KB
Bern2small.jpg 9KB
Bern1small.jpg 9KB
1993.jpg 48KB
CTset8.gif 14KB
CTset3.png 271KB
CTset7.gif 21KB
Ottawa before.jpg 47KB
san_1.bmp 192KB
CTset5.png 225KB
san_2.bmp 192KB
CTset 9.png 460KB
Thumbs.db 241KB
CTset1.png 116KB
1999.jpg 40KB
CTset2.png 160KB
CTset6.png 70KB
regon.m 3KB
GLCM_Features.m 5KB
feature2.mat 230B
hysteresis.m 512B
main_code.m 2KB
共 68 条
- 1
自不量力的A同学
- 粉丝: 47
- 资源: 2711
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页