Clear Filters
Clear Filters

How to determine whether the tumour present in brain is malign or benign using MATLAB.

4 views (last 30 days)
The project is on BRAIN TUMOUR EXTRACTION USING MRI IMAGES using MATLAB and further determining whether the extracted tumour is MALIGN or BENIGN.
The project has been completed upto the point of brain tumour extraction.
The problem arising now is how to determine as to in which category this extracted tumour falls... MALIGN or BENIGN.
What should be its coding and how is it implemented in MATLAB is the required area of concern.
The MRI scanned images being used by me for this project can be seen at http://www.flickr.com/photos/77172895@N08/?saved=1
The code written by me so far for the extraction of tumour is given below. It shows the output on a graphical user interface.
function varargout = PROJECT(varargin)
% PROJECT M-file for PROJECT.fig
% PROJECT, by itself, creates a new PROJECT or raises the existing
% singleton*.
%
% H = PROJECT returns the handle to a new PROJECT or the handle to
% the existing singleton*.
%
% PROJECT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PROJECT.M with the given input arguments.
%
% PROJECT('Property','Value',...) creates a new PROJECT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before PROJECT_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to PROJECT_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 PROJECT
% Last Modified by GUIDE v2.5 09-Apr-2012 15:06:22
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @PROJECT_OpeningFcn, ...
'gui_OutputFcn', @PROJECT_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 PROJECT is made visible.
function PROJECT_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 PROJECT (see VARARGIN)
% Choose default command line output for PROJECT
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes PROJECT wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = PROJECT_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 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 img;
global bw;
global img_gray;
img_gray=rgb2gray(img);
axes(handles.axes2);
imshow(img_gray);
[r c]=size(img_gray);
b=zeros(r,c);
hp_fil=[-1 2 -1;0 0 0;1 -2 1];
b=imfilter(img_gray,hp_fil);
axes(handles.axes4);
imshow(b);
c=b+img_gray+25;
medfilt2(c);
axes(handles.axes6);
imshow(c);
T = graythresh(c);
bw = im2bw(c,T+0.3);
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- 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 img;
global bw;
global bw5;
global img_gray;
global bw3;
fs = get(0,'ScreenSize');
figure('Position',[0 0 fs(3)/2 fs(4)])
SE = strel('disk',0);
bw1 = imerode(bw,SE);
subplot(3,2,1);
imshow(bw1);
SE = strel('disk',0);
bw1 = imdilate(bw1,SE);
subplot(3,2,2);
imshow(bw1);
SE2 = strel('disk',1);
bw2 = imerode(bw1,SE2);
subplot(3,2,3);
imshow(bw2)
SE2 = strel('disk',1);
bw2 = imerode(bw2,SE2);
subplot(3,2,4);
imshow(bw2)
SE3 = strel('disk',6);
bw3 = imerode(bw2,SE3);
subplot(3,2,5);
imshow(bw3)
SE3 = strel('disk',6);
bw3 = imdilate(bw3,SE3);
subplot(3,2,6);
imshow(bw3)
% --- 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 img;
global bw;
global bw5;
global img_gray;
global bw3;
fs = get(0,'ScreenSize');
figure('Position',[round(fs(3)/2) 0 fs(3)/2 fs(4)])
[r2 c2]=size(bw3);
for i=1:1:r2
for j=1:1:c2
if bw3(i,j)==1
img_gray(i,j)=255;
else
img_gray(i,j)=img_gray(i,j)*0.3;
end;
end;
end;
subplot(2,1,1);
imshow(img);
subplot(2,1,2);
imshow(img_gray);
% --- Executes on slider movement.
function slider3_Callback(hObject, eventdata, handles)
% hObject handle to slider3 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
ts=get(handles.slider3,'value');
global img;
if (ts==.05)
img=imread('img3.jpg');
end
if (ts== .1)
img= imread('img5.jpg')
end
if (ts== .15)
img= imread('img6.jpg')
end
if (ts== .2)
img= imread('img8.jpg')
end
if (ts== .25)
img= imread('img9.jpg')
end
if (ts== .3)
img= imread('img10.jpg')
end
if (ts== .35)
img= imread('img14.jpg')
end
axes(handles.axes1);
imshow(img);
% --- Executes during object creation, after setting all properties.
function slider3_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- 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 e;
fs = get(0,'ScreenSize');
figure('Position',[0 0 fs(3)/2 fs(4)])
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('db2');
[LL1,HL1,LH1,HH1] = dwt2(e,Lo_D,Hi_D);
[LL,HL,LH,HH] = dwt2(LL1,Lo_D,Hi_D);
subplot(2,2,1)
imshow(LL/1000)
title('Approximate image')
subplot(2,2,2)
imshow(HL/1000)
title('Horizontal detail')
subplot(2,2,3)
imshow(LH/1000)
title('Vertical detail')
subplot(2,2,4)
imshow(HH/1000);
title('Diagonal detail')
% --- 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 img;
global I1;
global e;
I1=rgb2gray(img);
x=adapthisteq(I1);
se=strel('disk',35);
a=imopen(x,se);
se1=strel('disk',25);
b=imerode(a,se1);
axes(handles.axes2)
imshow(b)
c = fspecial('gaussian', [3 3], .5);
d=imfilter(b,c);
axes(handles.axes4)
imshow(d);
e=d+I1;
axes(handles.axes6)
imshow(e);
  3 Comments
tarun Advani
tarun Advani on 13 Apr 2012
Mr Walter. thnx for the knowledge point regarding the MRS thing.
Regarding the project.. i am still in waiting for a genuine solution and i am in quick need of it as the submission dates are nearing by.
Walter Roberson
Walter Roberson on 13 Apr 2012
There is no meaningful solution when you are training with only 5 images, each of unknown class.

Sign in to comment.

Answers (1)

fatom fafa
fatom fafa on 10 Mar 2016
Its a good question, same problem faces my in my project brain tumor have many types and categories please if you find the solution please contact with me and tell me how did you overcome such problem.

Community Treasure Hunt

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

Start Hunting!