0% found this document useful (1 vote)
358 views

Brain Tumor Detection

This document summarizes a student project to detect brain tumors in MRI images. The objectives are to detect if a tumor is present in an MRI image and, if so, specify the tumor's location. The project uses Matlab's graphical user interface to apply image processing techniques like filtering, segmentation, and morphological operations to identify tumors. Anisotropic diffusion filtering is applied as a pre-processing step before thresholding and segmentation to isolate the tumor region. Region properties are then analyzed to classify tumors based on metrics like density and area.

Uploaded by

BHARATH BELIDE
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
358 views

Brain Tumor Detection

This document summarizes a student project to detect brain tumors in MRI images. The objectives are to detect if a tumor is present in an MRI image and, if so, specify the tumor's location. The project uses Matlab's graphical user interface to apply image processing techniques like filtering, segmentation, and morphological operations to identify tumors. Anisotropic diffusion filtering is applied as a pre-processing step before thresholding and segmentation to isolate the tumor region. Region properties are then analyzed to classify tumors based on metrics like density and area.

Uploaded by

BHARATH BELIDE
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Project by:

Bharath kumar -17BIS0024


Ali khan - 17BIS0023
Ishal abhishek-17BIS0048
Ruthwik – 17BIS0101
Objectives:

There are two main objectives of our project:


1. To detect if there is a tumor in a given MRI Image
2. If there is, specify the location of the tumor
Abstract:

Engineers have been actively developing tools to detect tumors and to process
medical images. Medical image segmentation is a powerful tool that is often
used to detect tumors. Many scientists and researchers are working to develop
and add more features to this tool. This project is about detecting Brain tumors
from MRI images using an interface of GUI in Matlab. Using the GUI, this
program can use various combinations of segmentation, filters, and other
image processing algorithms to achieve the best results. We start with filtering
the image using Prewitt horizontal edge-emphasizing filter. The next step for
detecting tumor is "watershed pixels." The most important part of this project
is that all the Matlab programs work with GUI “Matlab guide”. This allows us to
use various combinations of filters, and other image processing techniques to
arrive at the best result that can help us detect brain tumors in their early
stages.
Introduction:

In these days, the interest in digital biomedical image processing methods


takes a most important position in two principal and important areas. The
most important one is an improvement of pictorial information for human
studies and processing of biomedical image data for storage. A biomedical
image sometimes is defined as a two-dimensional function, Ϝ (x,y), where x and
y are the value or gray level of a biomedical image at a specific point. Ϝ are all
finite, discrete quantities. We should know that to say an image is a digital
image is when it is composed of a finite number of elements, each of which has
a particular location and valueThey have reported the MRI results of patients
who were diagnosed with multiple sclerosis in childhood. They take MRI
images during the year to diagnose and study the progress of brain disease .
Biomedical images are as different as the areas of the human body. For
example, to study soft tissue in the human body, we have to use the MRI scan
for soft tissue images such as Brain liver and other soft tissue in the human
body. However, those interested in studying hard tissue such as bone or
cartilage should use X-ray for a hard tissue image rather than the MRI. The
difference in the biomedical image is not just in the area but also different in
the manner of processing. To process an MRI image it is necessary to use a
different method than for processing an X-ray image.
Literature survey:

With the help of anisotripic diffusion filter algorithm we made a new


algorithm to make the mri image blur so that it will be easy to detect the
tumor.

We also created a gui so that it shows different stages of the tumor detection.

Medical image processing is the most challenging and emerging field now a
days. Processing of MRI images is one of the part of this field. This code makes
MRI image analysis accessible to more people who need not have to be
specialist on MRI imaging.

MRI imaging is less harmful than X-ray . It is less attenuated by bones. This
project can make MRI image processing and tumor detection process faster
and cheaper.

The below links are references which helped us in this project.

1. http://stackexchange.com/
2. https://www.mathworks.com/matlabcentral/fileexchange/55107-brain-
mri-tumor-detection-and-classification
3. http://researchgate.in/ “perona malik” research paper.
4. https://itk.org/ITKExamples/src/Filtering/AnisotropicSmoothing/Compute
PeronaMalikAnisotropicDiffusion/Documentation.html
5. http://www.ijircce.com/upload/2017/march/293_An_Efficient.pdf
About project:

Algorithm:

Prerequisites:

Mean
Mean is most basic of all statistical measure. Means are often used in
geometry and analysis; a wide range of means have been developed for these
purposes. In contest of image processing filtering using mean is classified as
spatial filtering and used for noise reduction. In this section we have discussed
about various type of mean and analysed their use for removing various type
of noise in image processing.

Arithmetic Mean
The arithmetic mean filter [2], also known as averaging filter, operates
on an sliding ‘m×n’ window by calculating the average of all pixel values
within the window and replacing the center pixel value in the
destination image with the result. Its mathematical formulation is given
as follows

Where ‘g’ is the noisy image, f(x,y) is the restored image, and ‘r’ and ‘c’
are the row and column coordinates respectively, within a window ‘W’
of size ‘m×n’ where the operation takes place.The arithmetic mean filter
causes a certain amount of blurring (proportional to the window size) to
the image, thereby reducing the effects of noise and local variations. It
can be used to reduce noise of different types, but works best for
Gaussian, uniform, or Erlang noise. Fig. 2 (C) shows the image after
arithmetic mean filtering of Gaussian noise added image.

STANDARD DEVIATION

It is a most widely used measure of variability or diversity used in


statistics. In terms of image processing it shows how much variation or
"dispersion" exists from the average (mean, or expected value). A low
standard deviation indicates that the data points tend to be very close to
the mean, whereas high standard deviation indicates that the data
points are spread out over a large range of values. Mathematically
standard deviation is given

A standard deviation filter calculates the standard deviation and assigns


this value to the center pixel in the output map. As it has capability in
measuring the variability, it can be used in edge sharpening, as intensity
level get changes at the edge of image by large value. Standard deviation
filters [10] can be useful for radar images. The interpretation of radar
images is often difficult: you cannot rely on spectral values because of
back scatter (return of the pulse sent by the radar). This often causes a
lot of 'noise'. By using a standard deviation filter, you may be able to
recognize some patterns.

The variance
It is a measure of how far a set of numbers is spread out. It is one of
several descriptors of a probability distribution, describing how far the
numbers lie from the mean (expected value). In particular, the variance
is one of the moments of a distribution. In that context, it forms part of a
systematic approach to distinguishing between probability distributions.
While other such approaches have been developed, those based on
moments are advantageous in terms of mathematical and
computational simplicity. Mathematically variance is given by

SKEWNESS
In statistics, skewness [8] is a measure of the asymmetry of the
probability distribution of a real-valued random variable. The skewness
value can be positive or negative, or even undefined. Qualitatively, a
negative skew indicates that the tail on the left side of the probability
density function is longer than the right side and the bulk of the values
(possibly including the median) lie to the right of the mean. A positive
skew indicates that the tail on the right side is longer than the left side
and the bulk of the values lie to the left of the mean. A zero value
indicates that the values are relatively evenly distributed on both sides
of the mean, typically but not necessarily implying a symmetric
distribution. Mathematically skewness can be given by
Figure:

Under the push button -1

We need to get the image in matlab so we use

Uigetfile function to input the file path

Of the image.

[I,path]=uigetfile('*.jpg','select a input image');


str=strcat(path,I);
s=imread(str);
axes(handles.axes1);
imshow(s);title('Input image','FontSize',15)
Under the push button -2

Under the second pushbutton we put the functions of anisotropic diffusion


filter , functions which are required to calculate the density, area etc.

The comparisons which are necessary to identify the tumor. We have given the
function such that if the area is lass than 100 mm sq , it neglects the tumor. It
also neglects if the density is less than 0.6 g/cc .

The function is designed such that depending on the tumor size it will be
highlighted in three different colors.

Even there are parameters of tumor like skewness , mean , variance standard
deviation etc.

The function is developed such that if there is no tumor in the given mri it will
stop execution of the further function after implementing anisotropic diffusion
filter part. Library functions for morphological operation were used to segment
the binary image & detect the tumor area.The Binary image was eroded, i.e, all
the points in the neighborhood of a black point was turned black. Finally we get
the border by subtracting the eroded image from original binary image.

num_iter=10;
delta_t = 1/7;
kappa = 15;
option = 2;
disp('Preprocessing image please wait . . .');
inp = anisodiff(s,num_iter,delta_t,kappa,option);
inp = uint8(inp);
inp=imresize(inp,[256,256]);
if size(inp,3)>1
inp=rgb2gray(inp);
end
axes(handles.axes2)
imshow(inp)
title('Filtered image','FontSize',10);
sout=imresize(inp,[256,256]);
t0=60;
th=t0+((max(inp(:))+min(inp(:)))./2);
for i=1:1:size(inp,1)
for j=1:1:size(inp,2)
if inp(i,j)>th
sout(i,j)=1;
else
sout(i,j)=0;
end
end
end
label=bwlabel(sout);
stats=regionprops(logical(sout),'Solidity','Area','Boundi
ngBox');
density=[stats.Solidity];
disp("density:")
area=[stats.Area];
disp("area:")
high_dense_area=density>0.6;
max_area=max(area(high_dense_area));
tumor_label=find(area==max_area);
tumor=ismember(label,tumor_label);
if max_area>100
axes(handles.axes4);
imshow(tumor)
title('tumor alone','FontSize',10);
else
h = msgbox('No Tumor!!','status');
% disp('no tumor');
return;
end
box = stats(tumor_label);
wantedBox = box.BoundingBox;
axes(handles.axes3);
imshow(inp);
title('Bounding Box','FontSize',10);
rectangle('Position',wantedBox,'EdgeColor','y');
dilationAmount = 5;
rad = floor(dilationAmount);
[r,c] = size(tumor);
filledImage = imfill(tumor, 'holes');
for i=1:r
for j=1:c
x1=i-rad;
x2=i+rad;
y1=j-rad;
y2=j+rad;
if x1<1
x1=1;
end
if x2>r
x2=r;
end
if y1<1
y1=1;
end
if y2>c
y2=c;
end
erodedImage(i,j) =
min(min(filledImage(x1:x2,y1:y2)));
end
end
tumorOutline=tumor;
tumorOutline(erodedImage)=0;
axes(handles.axes5)
imshow(tumorOutline)
title('Tumor Outline','FontSize',10);
rgb = inp(:,:,[1 1 1]);
red = rgb(:,:,1);
red(tumorOutline)=255;
green = rgb(:,:,2);
green(tumorOutline)=255;
blue = rgb(:,:,3);
blue(tumorOutline)=255;
tumorOutlineInserted(:,:,1) = red;
tumorOutlineInserted(:,:,2) = green;
tumorOutlineInserted(:,:,3) = blue;
axes(handles.axes6)
imshow(tumorOutlineInserted)
%img2=tumoroutlineinserted;
img2=im2bw(s);
title('Detected Tumor','FontSize',15);
handles.imgdata2=img2;
guidata(hObject,handles);
signal1=img2(:,:);
[cA1,~,~,~] = dwt2(signal1,'db4');
[cA2,~,~,~] = dwt2(cA1,'db4');
[cA3,cH3,cV3,cD3] = dwt2(cA2,'db4');
DWT_feat = [cA3,cH3,cV3,cD3];
G = pca(DWT_feat);
whos DWT_feat
whos G
g = graycomatrix(G);
stats = graycoprops(g,'Contrast Correlation Energy
Homogeneity');
Contrast = stats.Contrast;
Correlation = stats.Correlation;
Energy = stats.Energy;
Homogeneity = stats.Homogeneity;
Mean = mean2(G);
Standard_Deviation = std2(G);
Variance = mean2(var(double(G)));
Skewness = skewness(double(G(:)));
set(handles.edit1,'string',Mean);
set(handles.edit2,'string',Standard_Deviation);
set(handles.edit3,'string',Variance);
set(handles.edit4,'string',Skewness);
set(handles.edit5,'string',Contrast);
set(handles.edit6,'string',Correlation);
Results:

If there is a tumor

If there no tumor
Observations:

Challenges:

1.Blurry & Grainy Image


2.Small Tumor
3. May give false positive if the section of bones are too thick.

Scope of improvement:

The process can be extended to 3D image.


The proper anatomical position may be detected.
Fixed thresholds were used. Machine Learning may be implemented
to train the system dynamically change the thresholds.
Conclusion:

We see that using the GUI based program, we obtain far superior
results than the traditional techniques for tumor detection. Using the
GUI based programs allows us to change the parameters without
rewriting the program and allows fast and efficient detection of
tumors. The results are clearly more accurate and faster.

You might also like