CSE001-Detection of Liver Cancer Using Image Processing Techniques
CSE001-Detection of Liver Cancer Using Image Processing Techniques
PROCESSING TECHNIQUES
A PROJECT REPORT
Submitted by
AKSHAYA G (210616104002)
ISHWARIYA M (210616104021)
in
i
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE
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.
We express our deep sense of gratitude to Lord Almighty for the blessings to
complete this project work successfully.
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
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
vii
LIST OF ABBREVATIONS
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.
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
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
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
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
Abstract:
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
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.
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 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:
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
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.
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.
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.
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.
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
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.1. Definition
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.
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.
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.
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.
20
CHAPTER 4
SYSTEM DESIGN
21
4.2 Sequence Diagram:
GREYSCALE
IMAGE INTO
BINARY IMAGE
Enhancement
techniques
NOISELESS
IMAGE
22
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
End
24
4.5 Collaboration Diagram:
User System
Input MRI images
Enhancement techniques
Noiseless image
Processor
Enhanced image
Segmentation
25
CHAPTER 5
5.1 MODULES:
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)
• 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
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:
Naming conventions
Value conventions
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.
Value conventions ensure values for variable at any point of time. This involves the
following:
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:
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.
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.
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.
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:
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:
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
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.
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.
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.
38
CHAPTER 7
SNAP SHOTS
39
7.2 IMAGE ENHANCEMENT
40
7.3 IMAGE SEGMENTATION
41
42
CHAPTER 8
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.
The future works includes creating a GUI and enabling a single click feature
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.
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.
[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.
[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)
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