You are on page 1of 65

DETECTION OF LIVER CANCER USING IMAGE

PROCESSING TECHNIQUES

A PROJECT REPORT
Submitted by

AKSHAYA G (210616104002)

ANU PRIYA E (210616104005)

ISHWARIYA M (210616104021)

in the partial fulfillment for the award of the degree


of
BACHELOR OF ENGINEERING

in

COMPUTER SCIENCE AND ENGINEERING

JEPPIAAR INSTITUTE OF TECHNOLOGY


ANNA UNIVERSITY: CHENNAI 600025
APRIL 2020

i
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE

Certified that this project report “DETECTION OF LIVER CANCER USING


IMAGE PROCESSING TECHNIQUES " is the bonafide work of “AKSHAYA G

(210616104002), ANUPRIYA E (210616104005), ISHWARIYA M


(210616104021) “who carried out the project work under my supervision.

SIGNATURE SIGNATURE
Mrs.N.R GLADISS MERLIN M.E., Dr. J. FARITHA BANU M.E., Ph.D.,
Associate Professor Professor,
SUPERVISOR HEAD OF THE DEPARTMENT
Computer Science and Engineering Computer Science and Engineering
Jeppiaar Institute of Technology Jeppiaar Institute of Technology
Sriperumbudur, Chennai. Sriperumbudur, Chennai.

This project report is submitted for viva voice examination to be


held on 22.09.2020

INTERNAL EXAMINER EXTERNAL EXAMINER

JEPPIAAR INSTITUTE OF TECHNOLOGY,


SRIPERUMBUDUR, CHENNAI - 631 604.
ii
ACKNOWLEDGEMENT

We express our deep sense of gratitude to Lord Almighty for the blessings to
complete this project work successfully.

We would like to express our deepest gratitude and respect to honorable


Col. Dr. JEPPIAAR, M.A., B.L., Ph.D., Chairman for having given the
opportunity to pursue the education in this premier institution.

We take this opportunity to express our deepest and special thanks to


Dr. N. MARIE WILSON, B.Tech. MBA, Ph.D., Managing Director for
providing all the facilities and continuous encouragement for carrying out this
project work.

We express our sincere gratitude to Dr. L. M. MERLIN LIVINGSTON


B.E., M.E., Ph.D., Principal and Dr. J. FARITHA BANU, B.E., M.E., Ph.D.,
Head (Department of Computer Science and Engineering) for their guidance
and advice throughout the project.

We convey our sincere and in-depth gratitude to our Internal guide


Mrs. GLADISS MERLIN N R, B.E., M.E., for her valuable guidance throughout
the duration of this project.

We would also like to thank our parents and friends for the support they
extended during this course of the project.

iii
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO.


ABSTRACT vii
LIST OF FIGURES viii
LIST OF ABBRIEVATIONS ix
1 INTRODUCTION 1
1.1 About the project 1
2 SYSTEM ANALYSIS 2
2.1 Existing System 2
2.1.1 Literature Survey 2
2.2 Proposed System 7
3 REQUIREMENT SPECIFICATION 8
3.1 Introduction 8
3.2 Hardware and Software Specification 9
3.2.1 Hardware Requirement 9
3.2.2 Software Requirement 9
3.3 Technologies Used 10
3.3.1 Introduction to MATLAB 10
3.3.2 Toolboxes 10
3.3.3 The MATLAB system 11
3.3.4 Development Environment 12
3.3.5 Manipulating Matrices 17

iv
3.3.6 Image Processing techniques 20
3.3.6.1 Definition 20
3.3.6.2 Advantages 21
3.3.6.3 Disadvantages 21
4 SYSTEM DESIGN 22
4.1 Architecture Diagram 22
4.2 Sequence Diagram 23
4.3 Use Case Diagram 24
4.4 Activity Diagram 25
4.5 Collaboration Diagram 26
5 SYSTEM DESIGN - IMPLEMENTATION 27
5.1 Modules 27
5.2 Module Explanation 28
6 CODING AND TESTING 31
6.1 Coding Standards 31
6.2 Test Procedure 33
6.3 Test data and output 33
7 SNAP SHOTS 41
8 CONCLUSION AND FUTURE ENHANCEMENTS 47
8.1 Conclusion 47
8.2 Future Enhancements 47
9 REFERENCES 48
9.1 Appendiz_Coding 50

10 PUBLICATION 53

v
ABSTRACT

The hepar is the extensive internal organ in the human body. The liver is the
second organ most generic involved by metastatic disease being liver cancer one of
the prominent causes of death worldwide. Without healthy liver a person cannot
survive. It is life threatening disease which is very challenging perceptible for both
medical and engineering technologists. Image processing is a processing technique
with the help of mathematical operations. It uses any of the form of signal
processing. Here the input is an image or video and the output is also an image or a
set of images. This technique is also used in medical applications for various
detection and treatment. In proposed system, it has been used to detect cancer cell
of the liver. Here Otsu’s method is used for enhancing the MRI image and
watershed method is used to segment the cancer cell from the image.

vi
LIST OF FIGURES

FIGURE NO FIGURE NAME PAGE NO

4.1 Architecture Diagram 9

4.2 Sequence Diagram 10

4.3 Use Case Diagram 11

4.4 Activity Diagram 12

4.5 Collaboration Diagram 13

vii
LIST OF ABBREVATIONS

DWT Discrete Wavelet Transform

MRI Magnetic Resonance Imaging

MATLAB Matrix Laboratory

SVM Support Vector Machine

viii
CHAPTER 1

INTRODUCTION

In our project, we adopted Haar wavelet transform to analyses the images. The Haar technique
has two advantages over other techniques. Firstly, Haar automatically converts a greyscale image
to RGB image and secondly it considers any discontinuous image and compresses it accordingly.
The methodology followed in this paper can be explained as follows. Firstly, we consider a
greyscale image of the liver. To get better knowledge about the image we convert it to an RGB
image. The liver part is extracted from the image and clusters are formed using the k-means
clustering technique. The most appropriate cluster is selected from these clusters and the number
of pixels for the cancer part is calculated. These values are compared with the theoretical values.
Finally, a mean is computed based on calculated and theoretical value. If all the three values fall
in the same range, it is identified as liver cancer, and this is explained clearly about first step is to
find an image to do the further processing. MRI is a high-quality imaging technique which
produces the structure of human organ in more defined manner and useful for diagnosis of
diseases and Biological Research The results of an MRI image are greatly enhanced by
automotive and accurate classification of image. The second step includes several enhancement
techniques to get best quality of the image by removing the unwanted noise from the image. The
third stage segment or detect the cancer cell using segmentation. Block diagram of input image.
The rest of this paper describes the Material and method.

About the Project:

The image processing segments 2D image and it has numerous applications in the field of
medical. This may include visualization, estimation of volume of the interest object, detecting
abnormalities like tumors, polyps etc. and tissue qualification and much more. The project is of
the process of segmentation is to make the image more useful by changing the representation and
simplifying the image due to which it will be easier to analyze the image.

1
CHAPTER 2

SYSTEM ANALYSIS

2.1 EXISTING SYSTEM

2..1.1 LITERATURE SURVEY:

Paper 1: A pragmatic approach for detecting liver cancer using image processing and data
mining techniques
(Author: P R Anisha ; C Kishor Kumar Reddy ; L V Narasimha Prasad IEEE 2016)

Abstract:

Cancer diagnosis and treatment has a great significance due to the prevalent episodes of the
diseases, high death rate and reappearance after treatment. On the world scale, cancer stands in
the fifth position which causes death. Among the various cancers, liver cancer stands in the third
position. Liver cancer is generally diagnosed by three different tests like blood test, image test
and biopsy. To make the task of detecting the liver cancer simpler, less time consuming, an
effective and efficient approach is adopted for the same. In this research a computer aided
diagnostic system for detecting liver cancer is put forward. The proposed detection methodology
makes use of MRI, CT and USG scan imagery. K-means clustering technique is adopted so as to
segment the images in order to capture the region of interest. Later, Haar wavelet transform is
considered to compute the threshold values for the region of interest. The experiment put forth
gave an average accuracy of 82% besides reducing the time complexity and computational
complexity of the test.

Drawbacks:

Cancer diagnosis and treatment of cancer by analyzing image but the accuracy of the picture is
less.

2
Paper 2: Imaging of liver cancer of both hepatocellular carcinoma and cholangiocarcinoma

(Author: Adrian KP Lim et.al IEEE 2010)

Abstract:

Improvements in imaging technology allow exploitation of the dual blood supply of the liver to
aid in the identification and characterisation of both malignant and benign liver lesions. Imaging
techniques available include contrast enhanced ultrasound, computed tomography and magnetic
resonance imaging. This review discusses the application of several imaging techniques in the
diagnosis and staging of both hepatocellular carcinoma and cholangiocarcinoma and outlines
certain characteristics of benign liver lesions. The advantages of each imaging technique are
highlighted, while underscoring the potential pitfalls and limitations of each imaging modality.

Drawbacks:

Cancer diagnosis and treatment of cancer by improving in imaging technology but it has less
computational complex.

Paper 3: Change in diffusion weighted MRI during liver cancer radiotherapy: Preliminary
observations

( Author : Cynthia L. Eccles et.al ICCART 2018)

Abstract:

To evaluate diffusion weighted magnetic resonance imaging (DWI) in liver and liver cancers
during and following conformal radiotherapy (RT). To determine the feasibility of using changes
in apparent diffusion coefficients (ADC) as a potential surrogate for tumor control or normal
tissue injury. Materials and methods. Patients on a six-fraction conformal liver RT protocol
underwent DW-MRI at the time of treatment planning, during RT (week one and two) and one
month following RT. Diffusion weighted MR images were acquired in exhale breath hold, using
b-values of 0 and 600. Regions of interest (ROIs) corresponding to maximal tumour dose, high-
dose peri-tumour liver, irradiated normal liver, non-irradiated liver, and spleen were analyzed on

3
ADC maps. Results. Eleven patients (four hepatocellular carcinoma, five liver metastases, two
cholangiocarcinoma) were evaluated. The baseline median tumour ADC of 1.56×10−3mm2/sec
increased to 1.89×10-3 mm2/sec at RT week one, to1.91x10-3 mm2/sec during week two and to
2.01×10-3mm2/sec at one month following treatment (p < 0.0001). Early increases in mean ADC
were correlated with higher dose and sustained tumour response, whereas RECIST and volume
changes on T2 images were not. Peri-tumour mean ADC also increased, from 1.40×10−3 mm2/sec
(baseline) to 1.55×10−3mm2/sec (RT week 2) and 1.64 × 10−3mm2/sec (follow-up). Small ADC
changes were seen in the irradiated liver, and no significant changes were seen in the un-
irradiated liver. Conclusions. Changes in tumour ADC were seen during RT. Larger increases
were correlated with higher doses and increased likelihood of response.

Drawbacks:

Cancer diagnosis and treatment of cancer by analyzing image by using DWT, but the time
complexity is high

Paper 4: Diagnosis of hepatic nodules 20 mm or smaller in cirrhosis: Prospective validation


of the noninvasive diagnostic criteria for hepatocellular carcinoma

(Author: Alejandro Former et.al ICCSRT- 2007)

Abstract:

Evaluates the accuracy of contrast‐enhanced ultrasound (CEUS) and dynamic magnetic


resonance imaging (MRI) for the diagnosis of nodules 20 mm or smaller detected during
ultrasound (US) surveillance. We included 89 patients with cirrhosis [median age, 65 years; male
53, hepatitis C virus 68, Child‐Pugh A 80] without prior hepatocellular carcinoma (HCC) in
whom US detected a small solitary nodule (mean diameter, 14 mm). Hepatic MRI, CEUS, and
fine‐needle biopsy (gold standard) (FNB) were performed at baseline. Non‐HCC cases were
followed (median 23 months) by CEUS/3 months and MRI/6 months. FNB was repeated up to 3
times and on detection of change in aspect/size. Intense arterial contrast uptake followed by
washout in the delayed/venous phase was registered as conclusive for HCC. Final diagnoses

4
were HCC (n = 60), cholangiocarcinoma (n = 1), and benign lesions (regenerative/dysplastic
nodule, hemangioma, focal nodular hyperplasia) (n = 28). Sex, cirrhosis cause, liver function,
and alpha‐fetoprotein (AFP) levels were similar between HCC and non‐HCC groups. HCC
patients were older and their nodules significantly larger (P < 0.0001). First biopsy was positive
in 42 of 60 HCC patients. Sensitivity, specificity, and positive and negative predictive values of
conclusive profile were 61.7%, 96.6%, 97.4%, and 54.9%, for MRI, 51.7%, 93.1%, 93.9%, and
50.9%, for CEUS. Values for coincidental conclusive findings in both techniques were 33.3%,
100%, 100%, and 42%. Thus, diagnosis of HCC 20 mm or smaller can be established without a
positive biopsy if both CEUS and MRI are conclusive. However, sensitivity of these noninvasive
criteria is 33% and, as occurs with biopsy, absence of a conclusive pattern does not rule out
malignancy. These results validate the American Association for the Study of Liver Disease
(AASLD) guidelines.

Drawbacks:

Cancer diagnosis and treatment of cancer by ultrasound of the image, but it has less accuracy.

Paper 5: MRI bests ultrasound for cancer screening of cirrhotic livers, but is it fiscally
feasible

(Author: Dave Pearson IEEE- 2016)

Abstract:

MRI showed a significantly lower rate of false-positive findings than ultrasound (3.0 percent vs.
5.6 percent, respectively). Of the 43 patients with HCC, 32 (74.4 percent) had very early-stage
HCC, and 29 (67.4 percent) received curative treatments. The three-year survival rate of the
patients with HCC (86.0 percent) was not inferior to those without HCC (94.2 percent; hazard
ratio, 2.26).While the authors urge readers to interpret the study within its limitations, which
included an inability to obtain pathological confirmation for all patients, they also suggest liver
MRI deserves greater consideration as a screening tool than it’s gotten up to this point. “Since
the annual risk of developing HCC is not uniform across all patients with cirrhosis, the tailored
5
surveillance strategy based on the individual HCC risks may enable delivery of precision
medicine to patients and improve their clinical outcomes,” Kim et al. write, adding that further
investigation is needed to establish whether surveillance with liver-specific contrast-enhanced
MRI would reduce HCC mortality in high-risk patients.

Drawbacks:

In this paper is for cancer screening of cirrhotic livers. But it does not find the shortest path to
analyze the cancer.

2.2 PROPOSED SYSTEM

 In proposed system Preprocessing is the first step to enhance the input images. The
purpose of the process of image enhancement is to improve the image quality for the
human eye.
 Marker-Controlled Watershed Segmentation process is used to enhance the region
which indicate the presence of the required object
 Image feature extraction is one of the most important technique of image processing
Watershed ridge and boundaries images. The wavelet transform is used for feature
extraction. This includes creating a GUI and enabling a single click feature extraction
using wavelet transform, with the accuracy. For classification K-knn to be used.

ADVANTAGES

 Accuracy is improved
 Increases the Segmentations Efficiency
 It also has a high sensitivity detecting boundaries.

6
CHAPTER 3

REQUIREMENTS SPECIFICATION

3.1 INTRODUCTION

The requirements specification is a technical specification of requirements for the software


products. It is the first step in the requirements analysis process it lists the requirements of a
software system including functional, performance and security requirements. The requirements
also provide usage scenarios from a user, an operational and an administrative perspective. The
purpose of software requirements specification is to provide a detailed overview of the software
project, its parameters and goals. This describes the project target audience and its user interface,
hardware and software requirements. It defines how the client, team and audience see the project
and its functionality.

3.2. INPUT DESIGN

The input design is the link between the information system and the user. It comprises the
developing specification and procedures for data preparation and those steps are necessary to put
transaction data in to a usable form for processing can be achieved by inspecting the computer to
read data from a written or printed document or it can occur by having people keying the data
directly into the system. The design of input focuses on controlling the amount of input required,
controlling the errors, avoiding delay, avoiding extra steps and keeping the process simple. The
input is designed in such a way so that it provides security and ease of use with retaining the
privacy. Input Design considered the following things:

 What data should be given as input?


 How the data should be arranged or coded?
 The dialog to guide the operating personnel in providing input.
 Methods for preparing input validations and steps to follow when error occur.

7
3.2.1. OBJECTIVES

1. Input Design is the process of converting a user-oriented description of the input into a
computer-based system. This design is important to avoid errors in the data input process and
show the correct direction to the management for getting correct information from the
computerized system.
2. It is achieved by creating user-friendly screens for the data entry to handle large
volume of data. The goal of designing input is to make data entry easier and to be free from
errors. The data entry screen is designed in such a way that all the data manipulates can be
performed. It also provides record viewing facilities.
3. When the data is entered it will check for its validity. Data can be entered with the help
of screens. Appropriate messages are provided as when needed so that the user will not be in
maize of instant. Thus, the objective of input design is to create an input layout that is easy to
follow
3.3 HARDWARE AND SOFTWARE SPECIFICATION

3.3.1 HARDWARE REQUIREMENTS

 Processor Type : Pentium -IV


 Speed : 2.4 GHZ
 Ram : 128 MB RAM
 Hard disk : 20 GB HD

3.3.2 SOFTWARE REQUIREMENTS

 Operating System : Windows 7


 Software Programming Package : MATLAB R2018a

8
3.4 TECHNOLOGIES USED
3.4.1 MATLAB
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where problems and
solutions are expressed in familiar mathematical notation. Typical uses include:
• Math and computation
• Algorithm development
• Modeling, simulation, and prototyping
• Data analysis, exploration, and visualization
• Scientific and engineering graphics
• Application development, including graphical user interface building

MATLAB is an interactive system whose basic data element is an array that does not
require dimensioning. This allows you to solve many technical computing problems, especially
those with matrix and vector formulations, in a fraction of the time it would take to write a
program in a scalar no interactive language such as C or Fortran.

The name MATLAB stands for matrix laboratory. MATLAB was originally written to
provide easy access to matrix software developed by the LINPACK and EISPACK projects.
Today, MATLAB uses software developed by the LAPACK and ARPACK projects, which
together represent the state-of-the-art in software for matrix computation.
MATLAB has evolved over a period of years with input from many users. In university
environments, it is the standard instructional tool for introductory and advanced courses in
mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-
productivity research, development, and analysis.

9
3.4.2 Toolboxes
MATLAB features a family of application-specific solutions called toolboxes. Very
important to most users of MATLAB, toolboxes allow you to learn and apply specialized
technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that
extend the MATLAB environment to solve particular classes of problems. Areas in which
toolboxes are available include signal processing, control systems, neural networks, fuzzy logic,
wavelets, simulation, and many others.

3.4.3 The MATLAB System


The MATLAB system consists of five main parts:

Development Environment.
This is the set of tools and facilities that help you use MATLAB functions and files.
Many of these tools are graphical user interfaces. It includes the MATLAB desktop and
Command Window, a command history, and browsers for viewing help, the workspace, files,
and the search path.

The MATLAB Mathematical Function Library.


This is a vast collection of computational algorithms ranging from elementary functions
like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix
inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms.

The MATLAB language.


This is a high-level matrix/array language with control flow statements, functions, data
structures, input/output, and object-oriented programming features. It allows both “programming
in the small” to rapidly create quick and dirty throw-away programs, and “programming in the
large” to create complete large and complex application programs.

10
Handle Graphics®.
This is the MATLAB graphics system. It includes high-level commands for two-
dimensional and three-dimensional data visualization, image processing, animation, and
presentation graphics. It also includes low-level commands that allow you to fully customize the
appearance of graphics as well as to build complete graphical user interfaces on your MATLAB
applications.

The MATLAB Application Program Interface (API).


This is a library that allows you to write C and Fortran programs that interact with
MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling
MATLAB as a computational engine, and for reading and writing MAT-files. Image processing
in MATLAB Images and pictures as we mentioned in the preface, human beings are
predominantly visual creatures: we rely heavily on our vision to make sense of the world around
us. We not only look at things to identify and classify them, but we can scan for divergences, and
obtain an overall rough feeling for a scene with a quick glance.
Humans have evolved very precise visual skills: we can identify a face in an instant; we can
differentiate colors; we can process a large amount of visual information very quickly.
However, the world is in constant motion: stare at something for long enough and it will change
in some way. Even a large solid structure, like a building or a mountain, will change its
appearance depending on the time of day (day or night); amount of sunlight (clear or cloudy), or
various shadows falling upon it. We are concerned with single images: snapshots, if you like, of
a visual scene. Although image processing can deal with changing scenes, we shall not discuss it
in any detail in this text. For our purposes, an image is a single picture which represents
something. It may be a picture of a person, of people or animals, or of an outdoor scene, or a
microphotograph of an electronic component, or the result of medical imaging. Even if the
picture is not immediately recognizable, it will not be just a random blur.

11
3.3.4. DEVELOPMENT ENVIRONMENT
This chapter provides a brief introduction to starting and quitting MATLAB, and
the tools and functions that help you to work with MATLAB variables and files. For more
information about the topics covered here, see the corresponding topics under Development
Environment in the MATLAB documentation, which is available online as well as in print.

Starting and Quitting MATLAB


Starting MATLAB
On a Microsoft Windows platform, to start MATLAB, double-click the
MATLAB shortcut icon on your Windows desktop.
On a UNIX platform, to start MATLAB, type MATLAB at the operating system
prompt. After starting MATLAB, the MATLAB desktop opens - see MATLAB Desktop.
We can change the directory in which MATLAB starts, define startup options including running
a script upon startup, and reduce startup time in some situations.
Quitting MATLAB
To end your MATLAB session, select Exit MATLAB from the File menu in the
desktop, or type quit in the Command Window. To execute specified functions each time
MATLAB quits, such as saving the workspace, you can create and run a finish script.
MATLAB Desktop
When you start MATLAB, the MATLAB desktop appears, containing tools
(graphical user interfaces) for managing files, variables, and applications associated with
MATLAB.
The first time MATLAB starts, the desktop appears as shown in the following
illustration, although your Launch Pad may contain different entries. Change the way your
desktop looks by opening, closing, moving, and resizing the tools in it. You can also move tools
outside of the desktop or return them back inside the desktop (docking). All the desktop tools
provide common features such as context menus and keyboard shortcuts.
We can specify certain characteristics for the desktop tools by selecting
Preferences from the File menu. For example, you can specify the font characteristics for

12
Command Window text. For more information, click the Help button in the Preferences dialog
box.

Desktop Tools
This section provides an introduction to MATLAB's desktop tools. You can also
use MATLAB functions to perform most of the features found in the desktop tools. The tools
are:
 Current Directory Browser
 Workspace Browser
 Array Editor
 Editor/Debugger
 Command Window
 Command History
 Launch Pad
 Help Browser
Command Window
Use the Command Window to enter variables and run functions and M-files.
Command History
Lines you enter in the Command Window are logged in the Command History
window. In the Command History, you can view previously used functions, and copy and
execute selected lines. To save the input and output from a MATLAB session to a file, use the
diary function.
Running External Programs
You can run external programs from the MATLAB Command Window. The
exclamation point character! is a shell escape and indicates that the rest of the input line is a
command to the operating system. This is useful for invoking utilities or running other programs
without quitting MATLAB. On Linux, for example, emacs magik.m invokes an editor called
emacs for a file named magik.m. When you quit the external program, the operating system
returns control to MATLAB.

13
Launch Pad
MATLAB's Launch Pad provides easy access to tools, demos, and
documentation.
Help Browser
Use the Help browser to search and view documentation for all your Math Works
products. The Help browser is a Web browser integrated into the MATLAB desktop that
displays HTML documents.
To open the Help browser, click the help button in the toolbar, or type help
browser in the Command Window. The Help browser consists of two panes, the Help Navigator,
which you use to find information, and the display pane, where you view the information.
Help Navigator
Use to Help Navigator to find information. It includes:
Product filter - Set the filter to show documentation only for the products.
Contents tab - View the titles and tables of contents of documentation for your products.
Index tab - Find specific index entries (selected keywords) in the MathWorks documentation
for your products.
Search tab - Look for a specific phrase in the documentation. To get help for a specific function,
set the Search type to Function Name.
Favorites tab - View a list of documents you previously designated as favorites.
Display Pane - After finding documentation using the Help Navigator, view it in the display
pane. While viewing the documentation, you can:
Browse to other pages - Use the arrows at the tops and bottoms of the pages or use the back
and forward buttons in the toolbar.
Bookmark pages - Click the Add to Favorites button in the toolbar.
Print pages - Click the print button in the toolbar.
Find a term in the page - Type a term in the Find in page field in the toolbar and click Go.
Other features available in the display pane are: copying information, evaluating a selection, and
viewing Web pages.

14
Current Directory Browser
MATLAB file operations use the current directory and the search path as
reference points. Any file you want to run must either be in the current directory or on the search
path.
Search Path
To determine how to execute functions you call, MATLAB uses a search path to
find M-files and other MATLAB-related files, which are organized in directories on your file
system. Any file you want to run in MATLAB must reside in the current directory or in a
directory that is on the search path. By default, the files supplied with MATLAB and
MathWorks toolboxes are included in the search path.
Workspace Browser
The MATLAB workspace consists of the set of variables (named arrays) built up
during a MATLAB session and stored in memory. You add variables to the workspace by using
functions, running M-files, and loading saved workspaces.
To view the workspace and information about each variable, use the Workspace
browser, or use the functions who and whos.
To delete variables from the workspace, select the variable and select Delete from
the Edit menu. Alternatively, use the clear function.
The workspace is not maintained after you end the MATLAB session. To save the
workspace to a file that can be read during a later MATLAB session, select Save Workspace As
from the File menu, or use the save function. This saves the workspace to a binary file called a
MAT-file, which has a. mat extension. There are options for saving to different formats. To read
in a MAT-file, select Import Data from the File menu, or use the load function.
Array Editor
Double-click on a variable in the Workspace browser to see it in the Array Editor.
Use the Array Editor to view and edit a visual representation of one- or two-dimensional numeric
arrays, strings, and cell arrays of strings that are in the workspace.

15
Editor/Debugger

Use the Editor/Debugger to create and debug M-files, which are programs you
write to run MATLAB functions. The Editor/Debugger provides a graphical user interface for
basic text editing, as well as for M-file debugging.
You can use any text editor to create M-files, such as Emacs, and can use
preferences (accessible from the desktop File menu) to specify that editor as the default. If you
use another editor, you can still use the MATLAB Editor/Debugger for debugging, or you can
use debugging functions, such as dB stop, which sets a breakpoint.
If you just need to view the contents of an M-file, you can display it in the
Command Window by using the type function.
3.3.5. MANIPULATING MATRICES
Entering Matrices
The best way for you to get started with MATLAB is to learn how to handle
matrices. Start MATLAB and follow along with each example.
You can enter matrices into MATLAB in several different ways:
 Enter an explicit list of elements.
 Load matrices from external data files.
 Generate matrices using built-in functions.
 Create matrices with your own functions in M-files.
Start by entering Dürer's matrix as a list of its elements. You have only to follow a few basic
conventions:
 Separate the elements of a row with blanks or commas.
 Use a semicolon, ; , to indicate the end of each row.
 Surround the entire list of elements with square brackets, [ ].
To enter Dürer's matrix, simply type in the Command Window

A = [16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1]


MATLAB displays the matrix you just entered.

16
A= 16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1

This exactly matches the numbers in the engraving. Once you have entered the matrix, it is
automatically remembered in the MATLAB workspace. You can refer to it simply as A.
Expressions
Like most other programming languages, MATLAB provides mathematical
expressions, but unlike most programming languages, these expressions involve entire matrices.
The building blocks of expressions are:
 Variables
 Numbers
 Operators
 Functions
Variables
MATLAB does not require any type declarations or dimension statements. When
MATLAB encounters a new variable name, it automatically creates the variable and allocates the
appropriate amount of storage. If the variable already exists, MATLAB changes its contents and,
if necessary, allocates new storage. For example,
num_students = 25
Creates a 1-by-1 matrix named num_students and stores the value 25 in its single element.
Variable names consist of a letter, followed by any number of letters, digits, or underscores.
MATLAB uses only the first 31 characters of a variable name. MATLAB is case sensitive; it
distinguishes between uppercase and lowercase letters. A and a are not the same variable. To
view the matrix assigned to any variable, simply enter the variable name.
Numbers
MATLAB uses conventional decimal notation, with an optional decimal point and
leading plus or minus sign, for numbers. Scientific notation uses the letter e to specify a power-

17
of-ten scale factor. Imaginary numbers use either i or j as a suffix. Some examples of legal
numbers are

3 -99 0.0001
9.6397238 1.60210e-20 6.02252e23
1i -3.14159j 3e5i

All numbers are stored internally using the long format specified by the IEEE
floating-point standard. Floating-point numbers have a finite precision of roughly 16 significant
decimal digits and a finite range of roughly 10-308 to 10+308.
Operators
Expressions use familiar arithmetic operators and precedence rules.
+ Addition
- Subtraction
* Multiplication
/ Division
\ Left division (described in "Matrices and Linear Algebra" in
Using MATLAB)
^ Power
' Complex conjugate transpose
() Specify evaluation order

Functions
MATLAB provides a large number of standard elementary mathematical
functions, including abs, sqrt, exp, and sin. Taking the square root or logarithm of a negative
number is not an error; the appropriate complex result is produced automatically. MATLAB also
provides many more advanced mathematical functions, including Bessel and gamma functions.
Most of these functions accept complex arguments. For a list of the elementary mathematical
functions, type Some of the functions, like sqrt and sin, are built in. They are part of the
MATLAB core, so they are very efficient, but the computational details are not readily

18
accessible. Other functions, like gamma and sin, are implemented in M-files. You can see the
code and even modify it if you want. Several special functions provide values of useful
constants.
Pi 3.14159265...
I Imaginary unit, √-1
I Same as i
Eps Floating-point relative precision, 2-52
Realmin Smallest floating-point number, 2-1022
Realmax Largest floating-point number, (2- ε)21023
Inf Infinity
NaN Not-a-number

3.3.6. IMAGE PROCESSING

3.3.6.1. Definition

Image processing involves changing the nature of an image in order to either

1. Improve its pictorial information for human interpretation,

2. Render it more suitable for autonomous machine perception.

Image processing finds applications in such fields as photography, satellite imaging, medical
imaging, and image compression, just to name a few. In the past, image processing was largely
done using analog devices. However, as computers have become more powerful, processing
shifted toward the digital domain. Like one-dimensional digital signal processing, digital image
processing overcomes traditional analog “problems” such as noise, distortion during processing,
inflexibility of system to change, and difficulty of implementation.

Generally, image processing consists of several stages: image import, analysis, manipulation and
image output. There are two methods of image processing: digital and analogue. In particular,
digital image processing and its techniques is what this article is about. Computer algorithms play
a crucial role in digital image processing. Developers use multiple algorithms to solve different
tasks, including digital image detection, analysis, reconstruction, restoration, image data
compression, image enhancement, image estimation and image spectral estimation.

Major techniques of digital image processing are as follows:

Image Editing, which basically means altering digital images by means of graphic software tools.
19
Image Restoration, which refers to the estimation of a clean original image out of the corrupt
image taken in order to get back the information lost.

Independent Component Analysis, which separates a multivariate signal computationally into


additive subcomponents.

Anisotropic Diffusion, which is often known as Perona-Malik Diffusion, makes it possible to


reduce image noise without having to remove important parts of the image.

Linear Filtering. It’s another digital image processing technique, which refers to processing
time-varying input signals and producing output signals that are subject to the constraint of
linearity.

Neural Networks, which are computational models widely used in machine learning for solving
various tasks.

Pixilation, which often refers to turning printed images into digitized ones (such as GIF).

Principal Components Analysis, a digital image processing technique that can be used
for feature extraction.

Partial Differential Equations, which also is dealing with effectively de-noising images.

Hidden Markov Models, a technique used for image analysis in two dimensions.

Wavelets, which stands for a mathematical function that’s used in image compression.

Self-organizing Maps, a digital image processing technique for classifying images into a number
of classes.

3.3.6.2. Advantages of image processing:

1) Remove noises.
2) Correct image density and contrast.
3) Helps to easily store and retrieve in computers.
4) Image can be made available in any desired formats like black and white, negative image.

3.3.6.3. Disadvantage of image processing:

1) Initial cost is high depending upon the system used.


2) Once the system is damaged the image will be lost.

20
CHAPTER 4

SYSTEM DESIGN

4.1 ARCHITECTURE DIAGRAM:

Fig 4.1 Architecture diagram

21
4.2 Sequence Diagram:

User System Processor Segmentation

Input MRI CONVERT LOW AND


image HIGH PIXEL AS LOW

GREYSCALE
IMAGE INTO
BINARY IMAGE

Enhancement
techniques

NOISELESS
IMAGE

Results based on knn classification

Display of affected region with an accuracy

Fig 4.2 Sequence diagram

22
4.3 Use Case Diagram:

Fig 4.3 Use case diagram

23
4.4 Activity Diagram:

Start

Input image

Image acquisition

Image preprocessing

Image enhancement

Image segmentation

Future extraction

Counting algorithm

Output noiseless image

End

Fig 4.4 Activity diagram

24
4.5 Collaboration Diagram:

User System
Input MRI images

Enhancement techniques
Noiseless image
Processor

Enhanced image
Segmentation

Fig 4.5 Collaboration Diagram

25
CHAPTER 5

SYSTEM DESIGN - IMPLEMENTATION

5.1 MODULES:

1. Pre-processing - Ostu’s method


2. Image Segmentation - Watershed Segmentation
3. Feature Extraction - Wavelet transform
4. Classification - KNN

5.2 Module Explanation

5.2.1 PREPROCESSING (ostu’s method)


 This method uses clustering-based technique, it converts greyscale image into binary
image. It assumes that the image contains two level of pixel which are foreground pixel
and background pixel (bi-modal histogram). It calculates the optimum threshold by
separating two classes. The result gives minimum combined-spread and maximum inter-
class variance. The ostu’s method can roughly said to be one-dimensional method. The
ostu’s method search for the threshold which minimizes the interclass variance.

26
5.2.2 WATERSHED MANAGEMENT
 This process is use for detecting the boundaries and objects of an image. More precisely
we could define image segmentation as the process of assigning a name or label to each
pixel of that particular image which share certain visual characteristics.
 The result of a segmentation of an image is basically the entire image which will be
formed by combining each segmented part.
 The characteristics and the properties will also be same as contour, intensity or texture.
Watershed Segmentation process enhance the region which indicate the presence of the
required object.
 The location which are extracted by this process are then set to the minimum position
within the same topological surface.
 The watershed algorithm is applied afterwards. Separating objects of an image is one of
the difficult methods which watershed segmentation makes it easier.
 Watershed Segmentation Approach is of two types: External associated with Background
and Internal associated with the object of interest. The watershed transformation of the
Gradient image. Image segmentation use watershed transform to locate the foreground
and background object location.
 Opening and Closing Reconstruction results and this locate the “catchment basins” and
“watershed ringe line” of an image by treating its surface with light pixel
 Classified as high and low pixel classified as low. This shows the results of watershed
segmentation

27
5.2.3 DISCRETE WAVELET TRANSFOM (HAAR TRANSFORM)

• The feature extraction is done in Images.


• The feature extraction from image is added in the suggested system.
• DWT with Haar transform is used to collects different feature values of segmented
images and then Classification is done for segmented images.

5.2.4. KNN CLASSIFICATION

• DWT is used to collects different feature values of segmented images and then
Classification is done for segmented images.
• An identification of whether tumour is present or not was classified based on k-knn
Classification and the accuracy for overall process was calculated.

28
CHAPTER 6

CODING STANDARDS

6.1 CODING STANDARDS

Coding standards are guidelines to programming that focuses on the physical structure and
appearance of the program. They make the code easier to read, understand and maintain. This
phase of the system actually implements the blueprint developed during the design phase. The
coding specification should be in such a way that any programmer must be able to understand the
code and can bring about changes whenever felt necessary. Some of the standard needed to
achieve the above-mentioned objectives are as follows:

 Program should be simple, clear and easy to understand.

 Naming conventions

 Value conventions

 Script and comment procedure

 Message box format

 Exception and error handling

6.1.1 NAMING CONVENTIONS

Naming conventions of classes, data member, member functions, procedures


etc., should be self-descriptive. One should even get the meaning and scope of the variable by
its name. The conventions are adopted for easy understanding of the intended message by the
user. So it is customary to follow the conventions. These conventions are as follows:

Class names

Class names are problem domain equivalence and begin with capital letter and have
mixed cases.

29
Member Function and Data Member name

Member function and data member name begins with a lowercase letter with each
subsequent letters of the new words in uppercase and the rest of letters in lowercase.

6.1.2 VALUE CONVENTIONS

Value conventions ensure values for variable at any point of time. This involves the
following:

 Proper default values for the variables.

 Proper validation of values in the field.

 Proper documentation of flag values.

6.1.3 SCRIPT WRITING AND COMMENTING STANDARD

Script writing is an art in which indentation is utmost important. Conditional and


looping statements are to be properly aligned to facilitate easy understanding. Comments are
included to minimize the number of surprises that could occur when going through the code.

6.1.4 MESSAGE BOX FORMAT

When something has to be prompted to the user, he must be able to understand it


properly. To achieve this, a specific format has been adopted in displaying messages to the user.
They are as follows:

 X – User has performed illegal operation.

 ! – Information to the user.

30
6.2 TEST PROCEDURE

SYSTEM TESTING
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It is the
process of exercising software with the intent of ensuring that the software system meets its
requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.

Testing is one of the important steps in the software development phase. Testing checks
for the errors, as a whole of the project testing involves the following test cases:

 Static analysis is used to investigate the structural properties of the Source


code.
 Dynamic testing is used to investigate the behavior of the source code by
executing the program on the test data.

6.3 TEST DATA AND OUTPUT

6.3.1 UNIT TESTING

Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual software units
of the application .it is done after the completion of an individual unit before integration. This is
a structural testing, that relies on knowledge of its construction and is invasive. Unit tests
perform basic tests at component level and test a specific business process, application, and/or
system configuration. Unit tests ensure that each unique path of a business process performs
accurately to the documented specifications and contains clearly defined inputs and expected
results.

31
6.3.2 FUNCTIONAL TEST
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system documentation, and
user manuals.

Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems/Procedures : interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key functions,


or special test cases. In addition, systematic coverage pertaining to identify Business
process flows; data fields, predefined processes, and successive processes must be
considered for testing. Before functional testing is complete, additional tests are identified
and the effective value of current tests is determined.

6.3.3 PERFORMANCE TEST


It determines the amount of execution time spent in various parts of the unit, program
throughput, and response time and device utilization by the program unit.

6.3.4 STRESS TEST


Stress Test is those test designed to intentionally break the unit. A Great deal can be
learned about the strength and limitations of a program by examining the manner in which a
programmer in which a program unit break.

32
6.3.5 STRUCTURED TEST

Structure Tests are concerned with exercising the internal logic of a program and
traversing execution paths. The way in which White-Box test strategy was employed to ensure
that the test cases could Guarantee that all independent paths within a module have been
exercised at least once.

 Exercise all logical decisions on their true or false sides.


 Execute all loops at their boundaries and within their operational bounds.
 Exercise internal data structures to assure their validity.
 Checking attributes for their correctness.
 Handling end of file condition, I/O errors, buffer problems and textual
errors in output information
6.3.6 INTEGRATION TESTING

Integration tests are designed to test integrated software components to determine if they
run as one program. Testing is event driven and is more concerned with the basic outcome of
screens or fields. Integration tests demonstrate that although the components were individually
satisfaction, as shown by successfully unit testing, the combination of components is correct and
consistent. Integration testing is specifically aimed at exposing the problems that arise from the
combination of components.

6.3.7 SYSTEM TEST

System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An example of
system testing is the configuration-oriented system integration test. System testing is based on
process descriptions and flows, emphasizing pre-driven process links and integration points.

33
6.3.8 TESTING TECHNIQUES / TESTING STRATERGIES

a) TESTING

Testing is a process of executing a program with the intent of finding an error. A good
test case is one that has a high probability of finding an as-yet –undiscovered error. A successful
test is one that uncovers an as-yet- undiscovered error. System testing is the stage of
implementation, which is aimed at ensuring that the system works accurately and efficiently as
expected before live operation commences. It verifies that the whole set of programs hang
together. System testing requires a test consists of several key activities and steps for run
program, string, system and is important in adopting a successful new system. This is the last
chance to detect and correct errors before the system is installed for user acceptance testing.

The software testing process commences once the program is created and the
documentation and related data structures are designed. Software testing is essential for
correcting errors. Otherwise the program or the project is not said to be complete. Software
testing is the critical element of software quality assurance and represents the ultimate the review
of specification design and coding. Testing is the process of executing the program with the
intent of finding the error. A good test case design is one that as a probability of finding an yet
undiscovered error. A successful test is one that uncovers an yet undiscovered error. Any
engineering product can be tested in one of the two ways:

b) WHITE BOX TESTING

This testing is also called as Glass box testing. In this testing, by knowing the
specific functions that a product has been design to perform test can be conducted that
demonstrate each function is fully operational at the same time searching for errors in each
function. It is a test case design method that uses the control structure of the procedural design to
derive test cases. Basis path testing is a white box testing.

34
Basis path testing:

 Flow graph notation


 Cyclometric complexity
 Deriving test cases
 Graph matrices Control

c) BLACK BOX TESTING


In this testing by knowing the internal operation of a product, test can be
conducted to ensure that “all gears mesh”, that is the internal operation performs according to
specification and all internal components have been adequately exercised. It fundamentally
focuses on the functional requirements of the software.

The steps involved in black box test case design are:

 Graph based testing methods


 Equivalence partitioning
 Boundary value analysis
 Comparison testing
d) SOFTWARE TESTING STRATEGIES:

A software testing strategy provides a road map for the software developer. Testing is a
set activity that can be planned and conducted systematically. For this reason, a template for
software testing a set of steps into which we can place specific test case design methods should
be strategy should have the following characteristics:

 Testing begins at the module level and works “outward” toward the
integration of the entire computer-based system.
 Different testing techniques are appropriate at different points in time.
 The developer of the software and an independent test group conducts
testing.

35
 Testing and Debugging are different activities, but debugging must be
accommodated in any testing strategy.
e) INTEGRATION TESTING:
Software integration testing is the incremental integration testing of two or more integrated
software components on a single platform to produce failures caused by interface defects.

The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the company level –
interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

f) PROGRAM TESTING:

The logical and syntax errors have been pointed out by program testing. A syntax
error is an error in a program statement that in violates one or more rules of the language in
which it is written. An improperly defined field dimension or omitted keywords are common
syntax error. These errors are shown through error messages generated by the computer. A logic
error on the other hand deals with the incorrect data fields, out-off-range items and invalid
combinations. Since the compiler s will not deduct logical error, the programmer must examine
the output. Condition testing exercises the logical conditions contained in a module. The possible
types of elements in a condition include a Boolean operator, Boolean variable, a pair of Boolean
parentheses A relational operator or on arithmetic expression. Condition testing method focuses
on testing each condition in the program the purpose of condition test is to deduct not only
errors in the condition of a program but also other a errors in the program.

g) SECURITY TESTING

Security testing attempts to verify the protection mechanisms built in to a system well,
in fact, protect it from improper penetration. The system security must be tested for
invulnerability from frontal attack must also be tested for invulnerability from rear attack. During
security, the tester places the role of individual who desires to penetrate system.

36
h) VALIDATION TESTING

At the culmination of integration testing, software is completely assembled as a


package. Interfacing errors have been uncovered and corrected and a final series of software test-
validation testing begins. Validation testing can be defined in many ways, but a simple definition
is that validation succeeds when the software functions in manner that is reasonably expected by
the customer. Software validation is achieved through a series of black box tests that
demonstrate conformity with requirement. After validation test has been conducted, one of two
conditions exists.

 The function or performance characteristics confirm to specifications and are


accepted.
 A validation from specification is uncovered and a deficiency created.

Deviation or errors discovered at this step in this project is corrected prior to


completion of the project with the help of the user by negotiating to establish a method for
resolving deficiencies. Thus, the proposed system under consideration has been tested by using
validation testing and found to be working satisfactorily. Though there were deficiencies in the
system they were not catastrophic.

i) USER ACCEPTANCE TESTING

User acceptance of the system is key factor for the success of any system. The system under
consideration is tested for user acceptance by constantly keeping in touch with prospective
system and user at the time of developing and making changes whenever required. This is done
in regarding to the following points.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

6.4. OUTPUT DESIGN

A quality output is one, which meets the requirements of the end user and presents the
information clearly. In any system results of processing are communicated to the users and to
37
other system through outputs. In output design it is determined how the information is to be
displaced for immediate need and also the hard copy output. It is the most important and direct
source information to the user. Efficient and intelligent output design improves the system’s
relationship to help user decision-making.

1. Designing computer output should proceed in an organized, well thought out manner; the right
output must be developed while ensuring that each output element is designed so that people will
find the system can use easily and effectively. When analysis design computer output, they
should Identify the specific output that is needed to meet the requirements.

2.Select methods for presenting information.

3.Create document, report, or other formats that contain information produced by the system.

The output form of an information system should accomplish one or more of the following
objectives.

 Convey information about past activities, current status or projections of the


 Future.
 Signal important events, opportunities, problems, or warnings.
 Trigger an action.
 Confirm an action.

38
CHAPTER 7

SNAP SHOTS

7.1 IMAGE PREPROCESSING

39
7.2 IMAGE ENHANCEMENT

40
7.3 IMAGE SEGMENTATION

41
42
CHAPTER 8

CONCLUSION AND FUTURE ENHANCEMENTS

8.1 CONCLUSION

Different MRI Images where acquired from the internet, basic Ostu pre-
processing technique was used, for segmentation Marker-Controlled Watershed
Segmentation was used and it was observed that for a few images’ segmentation
was done correctly. Measurement accuracy and processing time is very high.
Threshold value is high.

8.2 FUTURE ENHANCEMENTS

The future works includes creating a GUI and enabling a single click feature

extraction using wavelet transform, with the accuracy.

43
CHAPTER 9

REFERENCES

1] Zhang, Y., L. Wu, and S. Wang, “Magnetic resonance brain image classification by an
improved artificial bee colony algorithm,” Progress In Electromagnetics Research, Vol. 116, 65–
79, 2011.

2] Mohsin, S. A., N. M. Sheikh, and U. Saeed, “MRI induced heating of deep brain stimulation
leads: Effect of the air-tissue interface,” Progress In Electromagnetics Research, Vol. 83, 81–91,
2008.

3] Golestanirad, L., A. P. Izquierdo, S. J. Graham, J. R. Mosig, and C.Pollo, “Effect of realistic


modeling of deep brain stimulation on the prediction of volume of activated tissue,” Progress In
Electromagnetics Research, Vol. 126, 1–16, 2012.

4] Mohsin, S. A., “Concentration of the specific absorption rate around deep brain stimulation
electrodes during MRI,” Progress In Electromagnetics Research, Vol. 121, 469–484, 2011.

5] Oikonomou, A., I. S. Karanasiou, and N. K. Uzunoglu,“Phasedarray near field radiometry for


brain intracranial applications,” Progress In Electromagnetics Research.

[6] M. Saranya and A. G. Selvarani, “Fundus Image Screening for Diabetic Retinopathy,” Indian
J. Sci. Technol., vol. 9, no. 25, 2016.

[7] J. H. Yoon and Y. M. Ro, “Enhancement of the contrast in mammographic images using the
homomorphic filter method,” IEICE Trans. Inf. Syst., vol. 85, no. 1, pp. 298–303, 2002.

[8] A. W. Setiawan, T. R. Mengko, O. S. Santoso, and A. B. Suksmono, “Color retinal image


enhancement using CLAHE,” in ICT for Smart Society (ICISS), 2013 International Conference
on, 2013, pp. 1–3.

[9] J. Staal, M. D. Abràmoff, M. Niemeijer, M. A. Viergever, and B. Van Ginneken, “Ridge-


based vessel segmentation in color images of the retina,” IEEE Trans. Med. Imaging, vol. 23, no.
4, pp. 501–509, 2004.

[10] R. Bandara, H. Kulathilake, M. P. Giragama, “Super-Efficient Spatially Adaptive Contrast


Enhancement Algorithm for Superficial Vein Imaging,” in 2017 IEEE 12th International
Conference on Industrial and Information Systems (ICIIS) (ICIIS’2017), Peradeniya, Sri Lanka,
2017.

[11] C. Tyler, “A Novel Retinal Blood Vessel Segmentation Algorithm for Fundus Images,”
MATLAB Cent. File Exch., 2016.

44
[12] P. Saponaro et al., “Three-Dimensional Segmentation of Vesicular Networks of Fungal
Hyphae in Macroscopic Microscopy Image Stacks,” ArXiv Prepr. ArXiv170402356, 2017.

[13] J. Matas, C. Galambos, and J. Kittler, “Robust detection of lines using the progressive
probabilistic hough transform,” Comput. Vis. Image Underst., vol. 78, no. 1, pp. 119–137, 2000.

45
9.1 APPENDIX :CODING
functionvarargout = 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
% istance 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 27-Jan-2020 18:48:57
% 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', []);
ifnargin&&ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
46
end

ifnargout
[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.
functionmain_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;
% 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.
functionvarargout = 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;

47
% --- 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 image
[filename pathname] = uigetfile({'*.jpg';'*.bmp'},'File Selector');
image = strcat(pathname, filename);
axes(handles.axes1);
imshow(image)
% --- 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 image I
k=getimage(handles.axes1);
I=imresize(k,[256 256]);
pause(1)
I=rgb2gray(I);
axes(handles.axes2);
imshow(I)
% --- 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 I I2 a2

I2 = fspecial('gaussian')
48
axes(handles.axes2);
imshow(I2)
pause(1)
a2=imfilter(I,I2);
axes(handles.axes2);
imshow(a2)
--- 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)
global a2 image1
image1=imadjust(a2,stretchlim(a2));
axes(handles.axes2);
imshow(image1);
--- 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 a2 I2 image1
OTSU segmentation ..
level = graythresh(image1);
seg_img = im2bw(image1,level);
axes(handles.axes2);
imshow(seg_img);
pause(1)
gmag = imgradient(image1);
axes(handles.axes2);
imshow(gmag);
title('Gradient Magnitude')
pause(1)
49
L = watershed(gmag);
Lrgb = label2rgb(L);
axes(handles.axes2);
imshow(Lrgb)
title('Watershed Transform of Gradient Magnitude')
pause(1)
se = strel('disk',20);
Io = imopen(image1,se);
axes(handles.axes2);
imshow(Io)
title('Opening')
pause(1)
Ie = imerode(image1,se);
Iobr = imreconstruct(Ie,image1);
axes(handles.axes2);
imshow(Iobr)
title('Opening-by-Reconstruction')
pause(1)
Ioc = imclose(Io,se);
axes(handles.axes2);
imshow(Ioc)
title('Opening-Closing')
pause(1)
Iobrd = imdilate(Iobr,se);
Iobrcbr = imreconstruct(imcomplement(Iobrd),imcomplement(Iobr));
Iobrcbr = imcomplement(Iobrcbr);
axes(handles.axes2);
imshow(Iobrcbr)
title('Opening-Closing by Reconstruction')
pause(1)

50
fgm = imregionalmax(Iobrcbr);
axes(handles.axes2);
imshow(fgm)
title('Regional Maxima of Opening-Closing by Reconstruction')
pause(2)
I2 = labeloverlay(image1,fgm);
axes(handles.axes2);
imshow(I2)
title('Regional Maxima Superimposed on Original Image')
pause(1)
se2 = strel(ones(5,5));
fgm2 = imclose(fgm,se2);
fgm3 = imerode(fgm2,se2);
fgm4 = bwareaopen(fgm3,20);
I3 = labeloverlay(image1,fgm4);
axes(handles.axes2);
imshow(I3)
title('Modified Regional Maxima Superimposed on Original Image')
pause(1)
bw = imbinarize(Iobrcbr);
axes(handles.axes2);
imshow(bw)
title('Thresholded Opening-Closing by Reconstruction')
pause(1)
D = bwdist(bw);
DL = watershed(D);
bgm = DL == 0;
axes(handles.axes2);
imshow(bgm)
title('Watershed Ridge Lines)')

51
pause(1)

gmag2 = imimposemin(gmag, bgm | fgm4);


L = watershed(gmag2);
labels = imdilate(L==0,ones(3,3)) + 2*bgm + 3*fgm4;
I4 = labeloverlay(image1,labels);
axes(handles.axes2);
imshow(I4)
title('Markers and Object Boundaries Superimposed on Original Image')
pause(1)

Lrgb = label2rgb(L,'jet','w','shuffle');
axes(handles.axes2);
imshow(Lrgb)
title('Colored Watershed Label Matrix')
pause(1)
axes(handles.axes2);
imshow(image1)
hold on
himage = imshow(Lrgb);
himage.AlphaData = 0.3;
title('Colored Labels Superimposed Transparently on Original Image')
pause(1)

52
CHAPTER 10
PUBLICATIONS

53
54
55
56
57

You might also like