% % Brain Tumor Detection and Segmentation from MRI
%% For getting the function anisodiff, click on this link anisodiff
% % Brain Tumor is a fatal disease which cannot be confidently detected without MRI.
% In the project, it is tried to detect whether patient’s brain has tumor or not from MRI
% image using MATLAB simulation.
% To pave the way for morphological operation on MRI image, the image was first
% filtered using Anisotropic Diffusion Filter to reduce contrast between consecutive
% pixels. After that the image was resized and utilizing a threshold value image was
% converted to a black and white image manually. This primary filter the plausible
% locations for tumor presence.
% On this semi processed image morphological operations have been applied and
% information on solidity and areas of the plausible locations was obtained. A
% minimum value of both of this characters has been determined from statistical
% average of different MRI images containing tumor. Then it was used to deliver final
% Though this simulation routine can give correct result most of the time, it fails to
% perform when tumor’s size is too small or tumor is hollow.
% The larger goal of the project is to build a data base of 2D image data of tumor from
% the MRI images taken from different angle of a particular human and by analyzing
% them to point out the exact 3D location of the tumor . To fulfill this, 2D tumor
% detection and segmentation have been developed to better accuracy so that 3D
% detection can be more reliable. This is the primary target of the project. %%%
disp('Preprocessing image please wait . . .');
inp = anisodiff(s,num_iter,delta_t,kappa,option);
h = msgbox('No Tumor!!','status');
box = stats(tumor_label);
wantedBox = box.BoundingBox;
rad = floor(dilationAmount);
filledImage = imfill(tumor, 'holes');
erodedImage(i,j) = min(min(filledImage(x1:x2,y1:y2)));
tumorOutlineInserted(:,:,1) = red;
tumorOutlineInserted(:,:,2) = green;
tumorOutlineInserted(:,:,3) = blue;
hold on;rectangle('Position',wantedBox,'EdgeColor','y');hold off;