Paper For MRI Images Using MATLAB

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Analysis of MRI images and their 3D Visualization

using MATLAB
Ritesh Kumar Saraswat
ICT-Department, Faculty of Electronics & Communication engineering
M.L.V. Textile & Engg. College, pur Road , Bhilwara (Rajasthan)-311001
e-mail:[email protected],
Fax No.- 01482241292 Mob. No. : - +91-9314336069

Ankit Mantri
Final Year (Electronics & Communication Engineering)
M.L.V. Textile & Engg. College, pur Road , Bhilwara (Rajasthan)-311001
e-mail:[email protected], Mob. No. : - +91-9928654745

Abstract THREE-DIMENSIONAL displaying of parts of human


body obtained by modern diagnostic imaging methods is
The simultaneous advances in computer technology, in even more customary. This enables observing the layers
terms of computing capability, memory capacity, and of the tissue shown in the images on a pixel by pixel
sensor technology in terms of cost and reliability of the level and in the context of the 3D structure of the human
acquisition devices, triggered the need of visualization of body.
images in medical field. This paper deals with an The goal of our work was to show the possibility of such
introductory survey of tools available in Matlab for MRI reconstruction using a wide range program such as
image analysis and visualization. Also describes the use MATLAB. Our solution is displayed through an example
of Matlab in three-dimensional reconstruction of human which does
brain MRI images. The program that was designed not allow virtual “entering” into the 3D structure, but
enables observing dissections of the gained 3D structure enables slicing out desired volume to a size of one pixel
along three axes. It also presents the importance of of the original images. Topographic layers at the
statistical parametric mapping and the related toolbox, appropriate depth will be displayed on both sides of
namely SPM, which runs on the top MATLAB. chosen parallelepiped.

II. PREPARATION FOR RECONSTRUCTION


INDEX TERMS – MATLAB, MRI, Image Processing,
Statistical Parameter Mapping, Visualization, Sets of images originating from two modalities were
3D - reconstruction. placed at our disposal. One modality is situated at the
Clinical Center of Serbia in Belgrade, produced by
1. INTRODUCTION Siemens, using the magnetic flux density of 0.95T. The
second one is located at the Institute for Oncology in
The importance of medical analysis and visualization is Sremska Kamenica. Magnetic flux density used was
to develop computational methods and 1.494T. Images used in this project originate from the
algorithms to analyze and quantify biomedical data. latter device, having greater resolution. The size of a
Biologists study cells and generate 3D confocal single image is 512x512 pixels ,with the depth of 12 bit
microscopy data sets, virologists generate 3D per pixel. The modality exports data in DICOM [2]
reconstructions of viruses from micrographs, radiologists (Digital Imaging and Communications in Medicine)
identify and quantify tumors from MRI and CT scans, standard. The images are grayscale and compressed with
and neuroscientists detect regional metabolic brain jpeg compression. The set consists of 25 images, each
activity from PET and functional MRI scans. Analysis of representing a 5mm layer, with a gap between layers of
these diverse types of images requires sophisticated 5.5mm. Two sets were used, in both sagital and
computerized quantification and visualization tools. transversal plain, with the emphasis on the latter one.
This paper is organized as follows. Section (2) deals with The basic code incorporated in our program can be
3D reconstruction of human brain MRI images to found as an example for 3D reconstruction in the Help
understand their visualization and analysis. Section-(3) [1] option of MATLAB 6 and newer.
deals with an introductory survey of tools available in
Matlab for medical image processing. Section-(4) deals III. PROGRAMMING
with statistical analysis and visualization of brain images
using SPM. Section-(5) deals with conclusion. The first step had to be taken was to upload the images
into MATLAB workspace, and to store them as .mat file.
2. 3-D RECONSTRUCTION Then images had to be converted from grayscale to
I. INTRODUCTION indexed ones. As code has the possibility to operate
with 4D matrix, the whole set of 25 images was end;
concatenated one on top of end;
the other into a matrix of size 512x512x1x25. With this N=D;.
matrix we get an extra dimension derived from obsolete
color maps. It can be eliminated using squeeze function, The complete programme code is divided into functions
after which we get a 3D variable used in the rest of the
programme.

After a few test runs of the code two things were


established. Response time for 3D rendering was in the
range of 10 minute on a home PC configuration (1.6
GHz, 1GB RAM, GeForce 6500). Also, in a number of
transversal images we detected noise which lead to
unwanted artifacts in the rendered image. The first
problem was solved by cropping obsolete pixels in
images, reducing them to 460x432 pixels. This
diminished the size of our 3D variable and reduced the
response time four times.

For eliminating artifacts we designed the function to


select the ROI (Region of Interest), and to convert the
pixels out of ROI into the ones with the minimal value.

The function that performs the filtration has been


programmed specifically for removing the noise
produced by this modality. The parameters which define
the way of filtering are determined by the contrast and
the color range of the acquired images.

A. FILTRATION AND RECONSTRUCTION

The code of the designed function is as follows: which are responsible for following operations:
function [N]=filt(D);
G=D+80; 1) Uploading variables and displaying images of all
imadjust(G); layers for visual identification of noise;
BW = edge(G,'canny',.3); 2) Filtering, displaying one of the filtered images, as well
se = strel('disk',10); as the contours of that layer which are the basis of 3D
closeBW = imclose(BW,se); reconstruction;
BW2 = imfill(closeBW,'holes'); 3) Displaying the reconstructed structure and the rendered
[m,n]=size(BW2); surface of the face and
M=min(min(D)); 4) Cutting out and displaying a desired selection.
for j=1:n

Figure 1. The contours of a single layer B. USER INTERFACE

Figure 2: Three-dimensional display of contour slices The final step was to design a proper user interface
which allows using programme by simple clicking on the
buttons. In order to work with the images, one has to
enter the path to the directory which holds the initial
.mat file with the uploaded variables, and confirm the
entrance. When the directory is listed, one should choose
the wanted file and go on to the first step in
reconstruction.
The panel contains four buttons which initiate separate
functions of the programme. Click on the first button
will start uploading and concatenating images into a 3D
variable. The whole set of images will be displayed in
the shape of a MRI film.

If the images demand filtering, this process can


be initiated by the click on the second button,
for i=1:m or this step can be skipped.
if BW2(i,j)== 0 Figure 3: The appearance of the user interface
D(i,j)=M;
end;
Button number three will initiate 3D reconstruction by
pasting the contor slices one on top of the other, and 4. STATISTICAL PARAMETRIC MAPPING (SPM) USING
begin rendering of the outer surface. MATLAB

Basic physics and Physiology of fMRI Functional MRI


(Magnetic Resonance Imaging) is a method of
tracking the brain activation’s by using multiple MRI
images of the brain. The differences between images
Figure 4: Reconstructed head

taken while subject is performing different tasks tell as


about the regions of the brain that activated. There is
still a lot to be learned about the link between the brain
activation’s and changes in the MRI but currently the
mostly accepted is the BOLD (Blood Oxygen Level
Dependent) mechanism. The local increase of the
brain activation increases the metabolism rate and the
oxygen consumption. This causes increase of the large
blood flow that overcompensates for the increased use
of oxygen. In the result the blood in the active region
becomes more oxygenated. This means it contains
more oxyhemoglobin and less deoxyhemoglobin vary
in its magnetic properties. Luckily for MRI
In the end, the user has the option to enter the pixel by requirement these two forms of hemoglobin vary in its
pixel coordinates of the planes which should divide the magnetic properties. Deoxyhemoglobin is
structure along the axes into a desired volume for paramagnetic. The higher content of deoxyhemoglobin
observation [3]. Matlab editor for displaying 3D images increases the rate of depolarization of hydrogen nuclei
has the ability of rotation and viewing the reconstruction creating the NMR signal thus decreasing the intensity
from different angles. The illumination of the display is of the T2* image. The bottom line is that the intensity
set in such a way to show the best contrast in the most of images increases with the increase of brain
practical angles for viewing images. activation. The problem remain that this increase is
small (usually less than 2%) and easily obscured by
3. TOOLS AVAILABLE IN MATLAB FOR MEDICAL IMAGE noise and different artifacts.
PROCESSING The SPM software [4] is a suite of MATLAB
functions and subroutines (with some externally
MATLAB is high-performance language for technical compiled C routines) for functional PET and MRI
computing [5]. It integrates computation, visualization, brain image analysis that implements “statistical
and programming in an easy-to-use environment parametric mapping”. SPM was developed by
where problems and solutions are expressed in members and collaborators of the Functional Imaging
familiar mathematical notations. Matlab is Laboratory (FIL), Institute of Neurology, London and
complemented by a family of application specific is distributed as open source code. Fig. 5. shows data
solutions called toolboxes along with mathematics, transformation in SPM toolbox.
computation, algorithm development, data acquisition,
modeling, simulation, prototyping, data analysis, The core of this programming package is the function
exploration, visualization, scientific and engineering readfmri that loads data from series of images and let
graphics, and application development including user create and view different statistical images from
graphical user interface. this data. This can be used for a thorough interactive
There are special toolboxes available for imaging and analysis of functional MRI data. fmri batch is a
related techniques namely Image Processing Toolbox version of this program that can be run as a batch job
(IPT), Signal Processing Toolbox, Neural Network saving all prescribed statistical maps. To run readfmri
Toolbox, Fuzzy Logic Toolbox (FLT), Wavelet one have to create the setup file describing the
Toolbox, etc. Special toolbox like Statistical structure of experimental data. This done with help of
Parametric Mapping (SPM), developed by the functions trysetup, checkpos, histplot, fixpos that help
Wellcome Department of Imaging Neuroscience, to asses the quality of the data file and define the
University College, London, to map the activity of appropriate strategy. After initial analysis the
living brain in space and time corresponding to statistical parametric maps can be saved. For this
specific tasks or stimuli is also available for free purpose readfmri can
download.
Figure 5: Data Transformation in SPM which is used to map the activities of living brain in
space and time corresponding to specific tasks or
be run as a batch job, using its version called fmri stimuli
batch. The example displayed in this paper shows how a
powerful tool like MATLAB can be used for 3D
ViewRes provides access to all the statistical visualization of 3D tomographic images. With further
parametric maps created by readfmri or fmribatch work on this realization it could be possible to create
and stored in our data base. It can display them the effect of entering the structure in such a way to
using different threshold and different clustering observe inner volumes. MATLAB supports this
filters. function, but working with matrixes this large would
be very time consuming for home computers.
The interactive interface of ViewRes is very similar
to that of readfmri, but the former can access only
previously calculated statistical maps all of them,
while the latter is loading the whole raw data for a
single slice of singe study – this is time consuming, REFERENCES
but give access to actual time course of intensities
and can help to understand data in its complexity. [1] Matlab, Help, sections: Visualizing MRI data:
Volume Visualization Techniques (3-D
Results of similar studies may be transformed into an Visualization); Image Processing Toolbox; Creating
uniform talairach space to be combined into Graphical User Interfaces
composite statistical maps, or may produce sets of [2] Dave Harvey, Dicom Objects User Manual, Medical
measures of activation’s for predefined Regions of Connections, pdf, 2001
Interest (ROI). [3] 3D MRI Reconstruction for Surgical Planning and
Other features of SPM toolbox includes functions for Guidance; In: Alexander E III (ed) Advanced Navigation
spatial realignment, spatial normalization, in Neurosurgery.
segmentation, coregistration, spatial smoothing, Available:http://spl.harvard.edu:8000/pages/papers/sh
voxel by voxel statistical analysis, general linear in/3Dmri/aans.html
model, generalized for temporal autocorrelation,
random effects analysis, multiple comparisons, [4] SPMs extensive web site:
plotting & results interrogation, image display, http://www.fil.ion.ucl.ac.uk/spm
CheckReg, rendering, brain extraction, adjusted [5]. Using Matlab, Version 6.5, The MathWorks, Inc.,
means and image algebra. Natick, MA., 2002.

5. CONCLUSION

This paper presents a brief overview of the toolboxes


available in Matlab for medical image analysis and
visualization. The functionalities of the SPM to
.

You might also like