FINAL CHARACTERIZATION OF 3-DIMENSIONAL MICROWAVE HYPERTHERMIA PLANNING SYSTEM Sateesh Nallamilli B.Tech, JNT University, Hyderabad, 2006 Shaik Mehtab B.E, Osmania University, Hyderabad, 2007 PROJECT Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in ELECTRICAL AND ELECTRONIC ENGINEERING at CALIFORNIA STATE UNIVERSITY, SACRAMENTO SUMMER 2010 FINAL CHARACTERIZATION OF 3-DIMENTIONAL MICROWAVE HYPERTHERMIA PLANNING SYSTEM A Project by Sateesh Nallamilli Shaik Mehtab Approved by: ________________________________, Committee Chair SureshVadhva, Ph.D. ________________________________, Second Reader Russell Tatro, M.S. _________________________ Date ii Students: Sateesh Nallamilli Shaik Mehtab I certify that these students have met the requirements for format contained in the University format manual, and that this project is suitable for shelving in the Library and credit is to be awarded for the project. ______________________, Department Chair Suresh Vadhva, Ph.D. Department of Electrical and Electronic Engineering iii ________________ Date Abstract of FINAL CHARACTERIZATION OF 3-DIMENSIONAL MICROWAVE HYPERTHERMIA PLANNING SYSTEM by Sateesh Nallamilli Shaik Mehtab This project will focus on the final tuning and debugging of 3-dimensional electromagnetic software that was initially developed in the Microwave laboratory at CSUS. The application of the software in clinical hyperthermia, which involves the treatment of tumors in the human or animal body by focused microwave radiation. The software prepares the treatment planning for each individual patient by taking the patient data, in this case, the CT scan data. This data in turn is used to plan the precise focusing of the microwave beam. The software has been essentially developed however, there are some key features still lacking such as the facility to access a multi-patient database, and transfer of multi-file CT scan files to the main MATLAB program. This project has focused on making the multi-patient database functional, and testing of the software to validate its practicality. Final testing was performed on the software, and it is in a ready shape for use in hospital therapy systems. , Committee Chair Suresh Vadhva, Ph.D. iv ACKNOWLEDGMENT Firstly, we would like to express our sincere thanks and gratitude to the respected major advisor of this project and distinguished faculty member of the Electrical and electronic engineering department, Dr. Preetham Kumar for making this project available. His continuous support was the main thing which helped us develop immense interest on the project. Dr. Preetham Kumar helped us by providing many sources of information which we needed from beginning of the project till the end. He was always there to meet, talk and answer the questions which we came across during the project. We also express our sincere thanks and gratitude to our second reader Dr. Russ Tatro for being a reader of this project. We greatly appreciate his willingness to be a co-advisor and committee member for this project. Dr. Russ Tatro spared his valuable office hours every week to discuss our progress with the project work and report. Finally, we also thank all our friends and Electrical engineering department who helped us to complete our project work successfully. Without any of the above mentioned people the project would not have come out the way it did. Thank you all. v TABLE OF CONTENTS Page Acknowledgments……………………………………………………………………….v List of Figures…………………………………………………………………………...viii Chapter 1. INTRODUCTION …………………………………….……………………….…… 1 2. HYPERTHERMIA PLANNING SYSTEM……………………………………...…. 4 2.1 Input Section…………………………………………………………............ 5 2.2 Specific Absorption Rate Model (SAR)....…….…………..…………….…. .5 2.3 Temperature and its Distribution ………………………………………..…...6 2.4 Treatment Planning ………..……………………………..…………………..7 2.5 Multi-patient database access …………………………………….……….....8 2.6 Evaluation tools………………………………………………….……….......8 3. Graphical User Interface (GUI) design for multi-patient database access………..…10 3.1 Introduction to GUI in MATLAB……………………………………..…..…10 3.2 GUI Elements……………………………………………………….…….…10 4. Simulation Results of Hyperthermia Planning System...............................................18 4.1 Simulation Data Set…………………………………………………..……...19 4.2 Simulation errors in initial project implementation and corrective steps …...19 4.3 Successive treatment planning of multiple patient data………………..……20 4.3.1 Treatment Planning based on Patient1 data set……………………..……..21 4.3.2 Treatment Planning based on Patient2 data set……………………..……..24 vi 4.3.3 Treatment Planning based on Patient3 data set………………………….......27 4.4 Code Implementation…………………………………………………...…...29 5. CONCLUSION …………………………………………………………………......32 Appendix A……………………………………………………………………………...33 Bibliography…………………………………………………………...………………..62 vii LIST OF FIGURES Page Figure 2.1 Basic Hyperthermia Treatment Planning System [1]………………...….….4 Figure 2.2 DICOM File Set and File Format [10]……………………………..……….9 Figure 3.1 Property Inspector…………………………………...……………………..13 Figure 3.2 List box displaying patient names …………………………...…………….15 Figure 4.1 Source patients Model Geometry……...…………………………………...18 Figure 4.2 Temperature Distribution of Patient1 CT scan Data...…………………......21 Figure 4.3 Electric Field Distribution of Patient1 CT scan Data…...…………….........22 Figure 4.4 Zoomed view of Electric field after clicking on Image.…………………....23 Figure 4.5 Temperature Distribution of Patient2 CT scan Data...……………………..24 Figure 4.6 Electric Field Distribution of Patient2 CT scan Data…...……………….....25 Figure 4.7 Zoomed view of Electric field after clicking on Image……...……………..26 Figure 4.8 Temperature Distribution of Patient3 CT scan Data…...…………………..27 Figure 4.9 Electric Field Distribution of Patient3 CT scan Data………………………28 Figure 4.10 Zoomed view of Electric field after clicking on Image……...…………....29 viii 1 Chapter 1 INTRODUCTION Hyperthermia is a type of treatment in which body tissue is exposed to high temperatures from 104ºF to 111ºF, to damage and kill cancer cells. The rationale behind hyperthermia treatment is that primary malignant tumors have a bad blood circulation, which makes them more sensitive to changes in temperature [1, 2]. Though earlier clinical studies involved the use of hyperthermia, this negative aspect was one of the reasons behind the slow progress in hyperthermia research and application. Eventually, researchers discovered that hyperthermia is more effective as an adjuvant or added treatment to conventional forms of cancer therapy such as radiation or chemotherapy [2, 3]. Hence, currently hyperthermia is administered prior to radiation or chemotherapy, and several clinical studies have shown that the combined modality of radiation plus hyperthermia or chemotherapy plus hyperthermia significantly improves the response rate in patients, as compared to just radiation or chemotherapy alone [4, 5]. The hardware design of microwave applicators for thermo-therapeutic applications is essential in hyperthermia, for the actual application of the RF or microwave energy on the tumor surface. However, in order to precisely tune the applicator power and orientation, accurate simulation tools are required to prepare the treatment individually for each patient. However, the question now arises that how to simulate the thermal effect of the device on applied tissue? What is the shape and size of the effective aperture area? A variety of electromagnetic simulators of electromagnetic 2 fields have been developed, utilizing methods such as Finite Difference Time Domain and Finite element methods. These simulators provide advanced visualization of the computed results. The Microwave Communication Laboratory in our department has been working on a 3-dimensional hyperthermia planning software, which utilizes the CT scan data of each individual patient to plan the treatment profile. This planning software uses MATLAB with the image processing toolbox to display output images showing the radiated power and temperature distribution over the patient treatment area. Additionally, the software also has a dynamic capability to allow adjustment of the applicator position by the system operator, and view the changes in electric field and temperature profile. The unique feature of the complete software package is that it is patient specific. This is achieved by using the CT scan data of the each individual patient to model the electrical propagation of the various, biological tissues in the human body. Hence this package will provide a very useful tool for the hyperthermia system operator to plan the treatment individually for each patient. The operator can effectively use the modeling to adjust the orientation and pores of the hyperthermia system aperture to focus of the hyperthermia system applicator to focus the beam onto the tumor surface, while delivering minimal energy to neighboring healthy tissue. Specifically, the aim of the current project is to develop and grant operator access to a multi-patient database, and transfer of multi-file CT scan files to the main MATLAB 3 program. The studies performed for the project are organized in the various chapters of the report as follows. Chapter 1 is a brief introduction to the work. Chapter 2 gives a background on the Hyperthermia planning system and a description of the various components that make up the system. Chapter 3 describes the graphical user interface implementation software, and multi-patient database access. Chapter 4 lists the simulation studies performed in the work, and finally, Chapter 5 draws conclusions from our work. 4 Chapter 2 HYPERTHERMIA PLANNING SYSTEM The treatment planning for hyperthermia may be resolved into six parts which are introduced below. Figure 2.1 Basic Hyperthermia Treatment Planning System [1] Input section Specific Absorption Rate Model Temperature and its Distribution Treatment Planning 5 Multi-patient database Evaluation Tools 2.1 Input section The input section is used to determine the distribution of dielectric parameters like conductivity and permittivity of both the applicators and the patient. For each patient a 40 cm CT scan is made and segmented into fat, muscle and bone. The tissues are given dielectric properties in accordance with the SAR distribution on the dielectric parameters. This part of the algorithm also calculates the grid parameters of the lattice which defines the outer boundary of the computational lattice. The time index, field array initialization and the material parameter setup are defined and the boundary conditions are calculated from the temporal data that is stored by the time index. [3] 2.2 Specific Absorption Rate Model (SAR Model) Specific Absorption Rate (SAR) and its Distribution is the determination of the rate of energy absorption per unit mass, wkg-1, in three dimensions under specified conditions in standard phantoms or in a patient from a given treatment machine. The data accumulated during this procedure characterize the heating technique under the specific conditions employed and permit general identification of those sites and target volumes which are likely to prove amenable to treatment with a particular technique. In addition, the distribution of Specific Absorption Rate [SAR] forms one group of input parameters which is essential for the calculation of the temperature distribution in vivo. [4] 6 It is an important factor in hyperthermia planning system because it controls the amount of power delivered to the tumor area while keeping the power delivered to the neighboring healthy tissues minimal. Heating from microwave and RF radiation best relates to Specific Absorption Rate (SAR) rather than the incident power density. The total SAR is related to the internal E- fields as SAR= 1/ρ ωε0εrnΕ2loc Where ρ is the mass density of the object in kg/m3 And SAR is the specific absorption rate in W/kg 2.3 Temperature and its Distribution It is the determination of the distribution of temperature in three dimensions in a patient throughout the course of a clinical treatment. The temperature data accumulated during the clinical treatment form the most valuable record of that treatment and is the ultimate source of data characterizing the heating session. In practice, and with currently available invasive thermometry, complete temperature distributions in vivo cannot be determined. The state of the art technology is presently limited to recommending minimum procedures which could probably indicate when an appropriate hyperthermia treatment had been delivered. The general factors to consider the transfer of heat in tissue are thermo physical properties of tissue such as heat capacity, thermal conductivity, geometry of irradiated 7 organism, heat absorption due to applicator, heat production due to metabolic processes, heat flow due to perfusion of blood and thermoregulatory mechanism. By delivering thermal energy, the tissue is stimulated to increase the blood flow by thermoregulation in order to remove the excess heat. [4] 2.4 Treatment Planning Treatment Planning is the selection of the optimal treatment technique and the geometrical configuration of that technique based on knowledge of the performance of available treatment machines and on the computation of the expected three dimensional temperature distributions in a patient. This definition describes closely the decision making process known as treatment planning in radiotherapy. The difference in practice between the two is that, in the case of hyperthermia, the computational aspects are less advanced and are subject to far greater uncertainty. In the sections that follow each of the three areas defined above is discussed in some detail. After a brief review of the relevant recent literature on these topics suggestions are offered as to how the current knowledge may best be applied in the clinical environment taking into account the wide variation in the equipment available and its degree of sophistication. From the ensuing discussion, areas requiring further study can be identified. 8 2.5 Multi-patient database access In a typical cancer treatment center, there are expected to be a large number of patients, and it is essential that the system operator should have access to each patient’s CT scan database, to develop the individual treatment profile for that patient. In this project, the effort has been to modify the main GUI software to generate a patient identification window, which requires the patient’s name or identification number. Once the operator selects a specific patient’s name or identification number, then the patient’s CT scan files, which are stored in DICOM format, as a set of *.dcm files, are uploaded to the main software, and the FDTD routine is executed to generate the electric field and temperature profile over the patient treatment area. If the temperature focus is observed in an area shifted from the tumor area, then the operator can use the cross-hair GUI function to adjust the applicator position, and re-check the field/temperature distribution. This procedure can be repeated until optimal focus at the tumor is achieved. 2.6 Evaluation Tools The code reads a section of human body CT scan image stored in DICOM format. The DICOM standard facilitates the interpretability of medical image imaging equipment by specifying set of protocols for network communications; syntax and semantics of commands and associated information which can be exchanged using these protocols a file format and a medical directory structure to facilitates access to the images and related 9 information stored on interchangeable media. The standard pertains to the field of Medical Informatics. Within that field, it addresses the exchange of digital information between medical imaging equipment and the other systems. Such equipment may interoperate with other medical devices, the scope of this standard needs to overlap with other areas of Medical Informatics. A DICOM file format provides a mean to encapsulate in a file the data set representing a SOP instance related to a DICOM IOD. As shown in the figure, the byte stream of the Data set is placed into the file after the DICOM file meta information. Each file contains a single SOP instance. [10] Figure 2.2 DICOM File-set and File Format [10] 10 Chapter 3 GRAPHICAL USER INTERFACE (GUI) DESIGN FOR MULTI-PATIENT DATABASE ACCESS 3.1 Introduction to GUI in Matlab A graphical user interface (GUI) is a user interface built with graphical objects, such as buttons, text fields, sliders, and menus. In general, these objects already have meanings to most computer users. For example, when we move a slider, a value changes; when we press an OK button, our settings are applied and the dialog box is dismissed. Of course, to leverage this built-in familiarity, we must be consistent in how you use the various GUI-building components [11]. Applications that provide GUIs are generally easier to learn and use. The action that results from a particular user action can be made clear by the design of the interface. The sections that follow describe how to create GUIs with MATLAB. This includes laying out the components, programming them to do specific things in response to user actions, and saving and launching the GUI; in other words, the mechanics of creating GUIs. 3.2 GUI Elements Push button A push button is typically used when you want an immediate action to occur when the user presses the button. It is used to trigger a callback when clicked with a mouse. An example might a button to start the application. 11 Check box Check boxes generate an action when clicked and indicate their state as checked or not checked. Check boxes are useful when providing the user with a number of independent choices that set a mode (e.g., display a toolbar or generate callback function prototypes).The Value property indicates the state of the check box by taking on the value of the Max or Min property (1 and 0 respectively by default): •Value = Max, box is checked. •Value = Min, box is not checked. You can determine the current state of a check box from within its callback by querying the state of its Value property, as illustrated in the following example: function checkbox1_Callback(h,eventdata,handles,varargin) if (get(h,'Value') == get(h,'Max')) % then checkbox is checked-take appropriate action else % checkbox is not checked-take appropriate action 12 Radio Button It is a type of toggle button with a small circular dot in the middle when it is on and no dot when it is off. It is typically used when you need to group several buttons together so that the groups of buttons have mutually exclusive settings. For Example Set (handles.option1,’Value’, 1); Set (handles.option2,’Value’, 0); Set (handles.option3,’Value’, 0); Edit Text Edit text controls are fields that enable users to enter or modify text strings. Use edit text when you want text as input. The String property contains the text entered by the user. To obtain the string typed by the user, get the String property in the callback. function edittext1_Callback (h, event data, handles, varargin) user_string = get (h, 'string'); Static Text Static text controls displays lines of text. Static text is typically used to label other controls, provide directions to the user, or indicate values associated with a slider. Users cannot change static text interactively and there is no way to invoke the callback routine associated with it. 13 Slider function Sliders accept numeric input within a specific range by enabling the user to move a sliding bar. Users move the bar by pressing the mouse button and dragging the slide, by clicking in the trough, or by clicking an arrow. The location of the bar indicates a numeric value. We can orient the slider either horizontally or vertically by setting the relative width and height of the Position property: •Horizontal slider – width is greater than height. •Vertical slider – height is greater than width. For example, these settings create a horizontal slider. Figure 3.1 Property Inspector Slider1=uicontrol(gcf,…’style’,’slider’,….’callback’,… [‘slvalue=get(slider1,’’value’’);’,….’disp (num2str(slvalue));’…]); 14 List box List boxes display a list of items and enable users to select one or more items. The String property contains the list of strings displayed in the list box. The first item in the list has an index of 1. The Value property contains the index into the list of strings that correspond to the selected item. If the user selects multiple items, then Value is a vector of indices. By default, the first item in the list is highlighted when the list box is first displayed. If we do not want any item highlighted then set the Value property to empty. The List box Top property defines which string in the list displays as the top most items when the list box is not large enough to display all list entries. List box Top is an index into the array of strings defined by the String property and must have a value between 1 and the number of strings. Non integer values are fixed to the next lowest integer. The following is a sample load_listbox function, which is called by the opening function of the GUI M-file as well as by the list box callback. [7] function load_listbox(dir_path, handles) cd (dir_path) dir_struct = dir(dir_path); [sorted_names,sorted_index] = sortrows({dir_struct.name}'); handles.file_names = sorted_names; handles.is_dir = [dir_struct.isdir]; 15 handles.sorted_index = [sorted_index]; guidata(handles.figure1,handles) set(handles.listbox1,'String',handles.file_names,... 'Value',1) set(handles.text1,'String',pwd) Figure 3.2: List Box displaying patient names. 16 Frame It is a decorative rectangular box with in a figure. It is used for the visual grouping of other controls. It makes the user interface easier to understand by visually grouping related controls. Frames do not have any callback routine associated with them and only ui-controls can appear with in them. Popup Menu Popup menus open to display a list of choices when users press the arrow. The String property contains the list of string displayed in the popup menu. The Value property contains the index into the list of strings that correspond to the selected item. User Interface Controls. When not open, a popup menu displays the current choice, which is determined by the index contained in the Value property. The first item in the list has an index of 1. Popup menus are useful when you want to provide users with a number of mutually exclusive choices, but do not want to take up the amount of space that a series of radio buttons requires.[7] Programming the Popup Menu You can program the popup menu callback to work by checking only the index of the item selected (contained in the Value property) or you can obtain the actual string contained in the selected item. This callback checks the index of the selected item and uses a switch statement to take action based on the value. If the contents of the popup menu are fixed, then you can use this approach. 17 function varargout = popupmenu1_Callback(h,eventdata,handles,varargin) val = get(h,'Value'); switch val case 1 % The user selected the first item case 2 % The user selected the second item. This callback obtains the actual string selected in the popup menu. It uses the value to index into the list of strings. This approach may be useful if your program dynamically loads the contents of the popup menu based on user action and you need to obtain the selected string. Note that it is necessary to convert the value returned by the String property from a cell array to a string. function varargout = popupmenu1_Callback(h,eventdata,handles,varargin) val = get(h,'Value'); string_list = get(h,'String'); selected_string = string_list{val}; % convert from cell array to string % 18 Chapter 4 SIMULATION RESULTS OF HYPERTHERMIA PLANNING SYSTEM This chapter discusses the several simulations done on the hyperthermia planning system software. The software package contains three sections: patient model, source model and FDTD field calculations. The complete geometry is shown in Fig 4.1 FDTD Field calculation over entire simulation space P(x, y, z) Z (X) r S(x0, y0, z0) Patient Model Source Model Y X Figure 4.1 Source-Patient Model Geometry The patient model is created from the CT scan data: this is achieved by the first part of the treatment planning software which converts the CT distribution into an electrical permittivity/magnetic permeability/electrical conductivity (//) distribution. The source model is created by assuming a circular area with a specified current distribution, to replicate the hyperthermia applicator system. 19 4.1 Simulation Data Set In this simulation work we used four different patient data sets. The spatial resolution along x-y-z directions for the simulation software is: ∆z=0.002 m ∆y=0.002 m ∆x=0.002 m However, due to a limitation in maximum memory size that the software can handle, we have use the interpolation along all 3 axes of the data set. This constraint can be avoided by using a Student version of Matlab with higher disk storage area. 4.2 Simulation errors in initial project implementation and corrective steps The simulation of the entire program is carried out at the hyperthermia application frequency of 27MHz. When the program is initialized it shows the list box with different patient names. The software package was being tested on different sets of CT scan data. One aspect of the work covered under this project is to test the software package to efficiently run and simulate the data of different patients CT scan. This is the major step in testing, as the ultimate purpose of the software is to make it applicable to hyperthermia treatment planning in an actual cancer center which is treating a large number of patients daily. 20 During the first phase of the development of this treatment planning software, the CT scan section set of just one patient was used to extract the data. Now it is developed to use for multiple patients: however, there was a problem with list box not closing at the start of the program and we implemented a function called close to close the list box after selecting the patient. The major change done in the program is to use multiple CT scan data along all three axes. After these modifications, successful generation of 3-D images was achieved. In the modified version, the code increase the period of interpolation and, instead of talking consecutive image sections, it uses 8, 16 and 32 image sections along the Z-axis. However, even after these interpolation modifications, the SARs of the temperature output results were satisfactory. A further problem that the previous project partners faced was the inability of the software to access multiple patient data: after the first patient selection, the routine generated an error signal, if prompted to select the next patient. This problem in the software was rectified after considerable adjustment of the software code, and proper sequencing of the initial list box, and successive image displays. 4.3 Successive treatment planning of multiple patient data The following simulation study was successfully able to access three patient data sets, and generate the required image files for effective treatment planning. 21 4.3.1 Treatment planning based on Patient 1 data set The figure 4.2 shows all the interpolation sections of patient1, each section depicting the temperature in ºC. These show the simulated temperature rise in each section in response to the 27 MHz diathermy source. This is the first stage of the treatment planning, which assumes the default setting of the applicator. Figure 4.2: Temperature Distribution of Patient1 CT scan Data 22 Figure 4.3 shows the electric field distribution over all interpolated sections, and also the position of diathermy source antenna. This graphical layout is used to position the X-Y position of the diathermy applicator source near the tumor area. The dynamic adjustment of the applicator is achieved by means of a cross-hair function, which allows the operator to focus on the tumor area. Figure 4.3: Electrical Field Distribution of Patient1 CT scan Data 23 Figure 4.4 shows the electric field of the section selected in figure and is used to focus the Z-axis of the antenna position to an optimal position near the tumor. Figure 4.4: Zoomed view of Electric field after clicking on image The cross hairs shown in the figure are used to fix the position of the antenna. Now the simulation package takes in the new X-Y-Z co-ordinates of the source antenna and recalculates the temperature distribution over the entire scan area. This process is repeated by the system operator until an optimal antenna position is reached. 24 4.3.2 Treatment planning based on Patient 2 data set The figure 4.5 shows all the interpolation sections of patient2, each section depicting the temperature in ºC. These show the simulated temperature rise in each section in response to the diathermia source. Figure 4.5: Temperature Distribution of Patient2 CT Scan Data 25 Figure 4.6 shows the electric field distribution over all interpolated sections, and also the position of diathermy source antenna. This graphical layout is used to position the X-Y position of the antenna source near the tumor area. Figure 4.6: Electrical Field Distribution of Patient2 CT Scan Data 26 Figure 4.7 shows the electric field of the section selected in figure and is used to focus the Z-axis of the antenna position to an optimal position near the tumor. Figure 4.7: Zoomed view of Electric field after clicking on any image 27 4.3.3 Treatment planning based on Patient 3 data set The figure 4.8 shows all the interpolation sections of patient3, each section depicting the temperature in ºC. These show the simulated temperature rise in each section in response to the diathermia source. Figure 4.8: Temperature Distribution of Pateint 3 CT Scan Data 28 Figure 4.9 shows the electric field distribution over all interpolated sections, and also the position of diathermy source antenna. This graphical layout is used to position the X-Y position of the antenna source near the tumor area. Figure 4.9: Electric Field Distribution of Patient 3 CT Scan Data 29 Figure 4.10 shows the electric field of the section selected in figure and is used to focus the Z-axis of the antenna position to an optimal position near the tumor. Figure 4.10: Zoomed View of Electric Field after clicking on any image 4.4 Code Implementation For the program used for simulating the above results, the following information is required as input: 30 The name of the patient, in order to extract the corresponding CT file set The size in the X-dimension of the CT scan data The value of the time steps in the Y, Z-dimensions of the CT scan data The program calculates the computational lattice from the following information: Frequency of operation [in this case 27 MHz is chosen] Number of cells per wavelength [to define the X-Y-Z resolution] Total number of time steps The spatial increment is calculated based on the input provided, which is one-tenth of a wavelength, in order to obtain good resolution for the fields. The value of the grid used throughout the program, defines the outer boundaries for the computational lattice. The next step is to define the time index, initialize the field arrays and setup the material parameters. The time index holds the temporal data, which is used in computing the boundary conditions and field updating equations. The temporal data is a circular link list that rotates with every time index, this is necessary for the field to propagate. Grid parameters are computed in which scattered properties are defined and the values of the updating coefficients are computed for the entire lattice. [8] Lattice boundary conditions are applied in order to minimize the effects of reflections at the boundary of the solution space. These boundary conditions minimize the reflection of any outgoing waves by simulating the propagation of the wave from the lattice plane 31 adjacent to the lattice truncation plane in a number of time steps corresponding to the propagation delay. The averaging process is used to take into account all possible local angels of the incidence of the outgoing wave at the lattice boundary and possible multiple incidences. [8] The software program calculates the 3-dimentional electric field distribution throughout the simulation pace, which includes the patient treatment area. The electric filed components Ex, Ey, Ez are calculated in the 3-dimentional spaces. The Specific Absorption Rate (SAR) is determined. The SAR measures the amount of energy absorption in the time and is defined by: SAR (x,y,z)=[|E(x,y,z)|² X σ(x,y,z)]/[2ρ(x,y,z)] Where, |E(x,y,z)|²=|Ex(x,y,z)|²+ |Ey(x,y,z)|²+ |Ez(x,y,z)|² σ(x,y,z)= Electrical conductivity at part (x,y,z) ρ(x,y,z)= Volume density at part (x,y,z) The unit of SAR is W/kg. Once the SAR is calculated, the 3-dimentional-temperature distribution is calculated using the bio-heat transfer equation. And the Matlab program used to generate the simulations results is included in the Appendix A. 32 Chapter 5 CONCLUSION The main goal of this project is a facility to access a multi-patient database, and transfer of multi-file CT scan files to the main hyperthermia treatment planning MATLAB program. A few modifications in the program, including the list box implementation, made it possible to use the program effectively with a multiple patient’s database. The GUI was developed in MATLAB programming language and the access to various patient files from the database was presented. This software was successfully tested for executing various patient CT scan files in the graphical window. The main advantage of this software is that, it is patient-specific and hence more accurate than a process which uses a generic patient model. The actual CT scan files for the patient are obtained in a MATLAB data file. This helps in treatment planning of incident antenna power, antenna position and configuration, to focus the beam at the desired tumor location, and cause minimum damage to the healthy tissues around the tumor spot. The better visualization from the 3 dimensional images helps the doctors for precisely applying hyperthermia techniques to patient tumors. The software was designed to be ultimately used in an actual cancer center, which provides hyperthermia treatment as an additional cancer-fighting tool. Hence the remaining task is to carry out an experimental trial of the software in a typical cancer center, treating hundreds of patients. The trial will bring out the efficiency and reliability of the software, and provide valuable feedback to correct any shortcomings in the operational efficiency. 33 APPENDIX A Matlab code function varargout = original(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @original_OpeningFcn, ... 'gui_OutputFcn', @original_OutputFcn, ... 'gui_LayoutFcn', [], ... 'gui_Callback', []); if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout varargout{1:nargout} = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end function original_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; guidata(hObject, handles); if nargin == 3, initial_dir = pwd; elseif nargin > 4 if strcmpi(varargin{1},'dir') if exist(varargin{2},'dir') initial_dir = varargin{2}; else errordlg('Input argument must be a valid directory','Input Argument Error!') return end else errordlg('Unrecognized input argument','Input Argument Error!'); return; 34 end end % Populate the listbox load_listbox(initial_dir,handles) function varargout = original_OutputFcn(hObject, eventdata, handles) % Get default command line output from handles structure varargout{1} = handles.output; function varargout = listbox1_Callback(h, eventdata, handles) get(handles.figure1,'SelectionType'); if strcmp(get(handles.figure1,'SelectionType'),'open') index_selected = get(handles.listbox1,'Value'); file_list = get(handles.listbox1,'String'); patientname = file_list{index_selected}; if handles.is_dir(handles.sorted_index(index_selected)) cd (patientname) else [path,name,ext,ver] = fileparts(patientname); switch ext case '.fig' guide (patientname) otherwise try open(patientname) catch errordlg(lasterr,'File Type Error','modal') end end end close fprintf(1,'Patient selected:%s\n',patientname); p=1; file1=[num2str(patientname),'_000',num2str(p),'.dcm']; [X,map]=dicomread(char(file1)); 35 [ix,iy]=size(X); iz = 20; ctnumber=zeros(ix,iy,iz); intp=4; xmax=0.2; ymax=0.2; zmax=0.2; dx=xmax/ix; dy=ymax/iy; dz=zmax/iz; for p=1:iz file=[num2str(patientname),'_000',num2str(p),'.dcm']; if p > 9 file=[num2str(patientname),'_00',num2str(p),'.dcm']; end; [X,map]=dicomread(char(file)); ctnumber(:,:,p)=X; end; ctmax=max(max(max(ctnumber))); ctnumber=ctnumber*2000/ctmax-1000; ct11=ctnumber; %image(ct11); i1=1; for i=1:intp:ix; j1=1; for j=1:intp:iy; for k=1:iz; x1(i1,j1,k)=(i-1)*dx; y1(i1,j1,k)=(j-1)*dy; z1(i1,j1,k)=(k-1)*dz; ct13(i1,j1,k)=ct11(i,j,k); end; j1=j1+1; end; i1=i1+1; end; [ix,iy,iz]=size(ct13); dx=dx*intp; 36 dy=dy*intp; dz=dz; ix1=ix*1.5/4; xii=ix1*dx; ix2=0.1*ix; dx2=ix2*dx; iy1=iy*1.5/4; yii=iy1*dy; iy2=iy/2+0.1*iy; iz1=iz/2; zii=iz1*dz; iz2=iz/2+0.1*iz; for i=1:ix; xx=i*dx; for j=1:iy; yy=j*dy; for k=1:iz; zz=k*dz; if (xx-xii)^2 + (yy-yii)^2 + (zz-zii)^2 <= dx2^2 ct13(i,j,k)=300; end; end; end; end; inx=ix*iy*iz; ct1x(1:inx)=ct13; x(1:inx)=x1(:,:,:); y(1:inx)=y1(:,:,:); z(1:inx)=z1(:,:,:); G=ones(ix,iy,iz)*0.001; Roe=1.29*ones(ix,iy,iz); 37 Er=ones(ix,iy,iz); sph=ones(ix,iy,iz)*1006; perf=ones(ix,iy,iz)*0; met=ones(ix,iy,iz)*0; therm=ones(ix,iy,iz)*0.026; %electrical/density parameters for different human tissues at 2.45GHz %layer air G1=0.001; Er1=1; Roe1=1.29; sph1=1006; perf1=0; met1=0; therm1=0.026; %layer blood G2=2.5448; Er2=58.264; Roe2=1000; sph2=3600; perf2=1000; met2=0; therm2=0.51; %layer bone G3=0.32; Er3=16.1; Roe3=1080; sph3=2238; perf3=3; met3=0; therm3=0.36; %layer brain G4=1.08; Er4=42.8; 38 Roe4=1040; sph4=3640; perf4=56; met4=331; therm4=0.534; %brain(grey matter) G5=1.8077; Er5=48.911; Roe5=1000; sph5=3680; perf5=67.1; met5=5370; therm5=0.565; %brain(white matter) G6=1.215; Er6=36.167; Roe6=1000; sph6=3600; perf6=23.7; met6=5370; therm6=0.503; %cartilage G7=1.7559; Er7=38.77; Roe7=1000; %cerebro-spinal fluid G8=3.4578; Er8=66.243; Roe8=1000; sph8=4200; perf8=0; met8=0; therm8=0.6; %layer fat 39 G9=0.1045; Er9=5.28; Roe9=920; sph9=2300; perf9=2.8; met9=302; therm9=0.23; %layer heart G10=2.2561; Er10=54.814; Roe10=1000; %layer kidney G11=2.4295; Er11=52.742; Roe11=1000; %layer lens G12=1.504; Er12=44.625; Roe12=1000; %layer liver G13=1.6864; Er13=43.035; Roe13=1000; %inflated lung G14=0.8084; Er14=20.5909; Roe14=1000; %inflated lymph G15=1.9679; Er15=57.201; Roe15=1000; %layer muscle 40 G16=1.7388; Er16=52.729; Roe16=1040; sph16=3500; perf16=5; met16=756; therm16=0.498; %layer ovary G17=2.2641; Er17=44.7; Roe17=1000; %layer pancreas G18=1.9679; Er18=57.201; Roe18=1000; %layer skin G19=0.86; Er19=39.1; Roe19=1010; sph19=3150; perf19=12; met19=1125; therm19=0.343; %layer spleen G20=2.238; Er20=52.449; Roe20=1000; %layer testis G21=2.1676; Er21=57.551; Roe21=1000; %layer thyroid G22=1.9679; 41 Er22=57.201; Roe22=1000; %layer eyeball G23=2.21; Er23=73.9; Roe23=1010; sph23=4200; perf23=0; met23=0; therm23=0.586; %breast fat G24=0.1378; Er24=5.1750; Roe24=1000; sph24=2300; perf24=2.8; met24=302; therm24=0.23; %layer cerebellum G25=2.1125; Er25=45.0552; Roe25=1000; sph25=3640; perf25=56; met25=331; therm25=0.534; %cornea G26=2.3075; Er26=51.9018; Roe26=1000; sph26=3000; perf26=3.8; met26=0; therm26=0.4; %dura 42 G27=1.6776; Er27=42.2677; Roe27=1000; %layer tongue G28=1.8121; Er28=52.9196; Roe28=1000; Gtumor=1.5; Ertumor=40; Roetumor=1000; for i=1:ix; for j=1:iy; for k=1:iz; %this portion of the code detects the tissue from the image acquired for the corresponding ct number %layer air boundary if ctnumber(i,j,k) >= -1050 & ctnumber(i,j,k) <= -950 G(i,j,k)=G1; Er(i,j,k)=Er1; Roe(i,j,k)=Roe1; sph(i,j,k)=sph1; perf(i,j,k)=perf1; met(i,j,k)=met1; therm(i,j,k)=therm1; %layer blood boundary elseif ctnumber(i,j,k) >= 23 & ctnumber(i,j,k) <= 27 G(i,j,k)=G2; Er(i,j,k)=Er2; Roe(i,j,k)=Roe2; sph(i,j,k)=sph2; perf(i,j,k)=perf2; met(i,j,k)=met2; therm(i,j,k)=therm2; 43 %layer bone boundary elseif ctnumber(i,j,k) >= 900 & ctnumber(i,j,k) <= 1100 G(i,j,k)=G3; Er(i,j,k)=Er3; Roe(i,j,k)=Roe3; sph(i,j,k)=sph3; perf(i,j,k)=perf3; met(i,j,k)=met3; therm(i,j,k)=therm3; %layer brain boundary elseif ctnumber(i,j,k) >= 33 & ctnumber(i,j,k) <= 41 G(i,j,k)=G4; Er(i,j,k)=Er4; Roe(i,j,k)=Roe4; sph(i,j,k)=sph4; perf(i,j,k)=perf4; met(i,j,k)=met4; therm(i,j,k)=therm4; %layer brain_grey matter boundary elseif ctnumber(i,j,k) >= 32 & ctnumber(i,j,k) <= 44 G(i,j,k)=G5; Er(i,j,k)=Er5; Roe(i,j,k)=Roe5; sph(i,j,k)=sph5; perf(i,j,k)=perf5; met(i,j,k)=met5; therm(i,j,k)=therm5; %layer brain_white matter boundary elseif ctnumber(i,j,k) >= 24 & ctnumber(i,j,k) <= 36 G(i,j,k)=G6; Er(i,j,k)=Er6; Roe(i,j,k)=Roe6; 44 sph(i,j,k)=sph6; perf(i,j,k)=perf6; met(i,j,k)=met6; therm(i,j,k)=therm6; %layer cartilage boundary elseif ctnumber(i,j,k) >= 93 & ctnumber(i,j,k) <= 103 G(i,j,k)=G7; Er(i,j,k)=Er7; Roe(i,j,k)=Roe7; %layer csf boundary elseif ctnumber(i,j,k) >= 0 & ctnumber(i,j,k) <= 22 G(i,j,k)=G8; Er(i,j,k)=Er8; Roe(i,j,k)=Roe8; sph(i,j,k)=sph8; perf(i,j,k)=perf8; met(i,j,k)=met8; %layer Fat boundry elseif ctnumber(i,j,k) >= -55 & ctnumber(i,j,k) <= -45 G(i,j,k)=G9; Er(i,j,k)=Er9; Roe(i,j,k)=Roe9; sph(i,j,k)=sph9; perf(i,j,k)=perf9; met(i,j,k)=met9; therm(i,j,k)=therm9; %layer heartboundry elseif ctnumber(i,j,k) >= 52 & ctnumber(i,j,k) <= 58 G(i,j,k)=G10; Er(i,j,k)=Er10; Roe(i,j,k)=Roe10; %layer kidney boundary elseif ctnumber(i,j,k) >= 40 & ctnumber(i,j,k) <= 46 G(i,j,k)=G11; 45 Er(i,j,k)=Er11; Roe(i,j,k)=Roe11; %layer lens boundry elseif ctnumber(i,j,k) >= 47 & ctnumber(i,j,k) <= 53 G(i,j,k)=G12; Er(i,j,k)=Er12; Roe(i,j,k)=Roe12; %layer liver boundray elseif ctnumber(i,j,k) >= 50 & ctnumber(i,j,k) <= 56 G(i,j,k)=G13; Er(i,j,k)=Er13; Roe(i,j,k)=Roe13; %layer lung boundary elseif ctnumber(i,j,k) >= -815 & ctnumber(i,j,k) <= 667 G(i,j,k)=G14; Er(i,j,k)=Er14; Roe(i,j,k)=Roe14; %layer lymph boundary elseif ctnumber(i,j,k) >= 26 & ctnumber(i,j,k) <= 330 G(i,j,k)=G15; Er(i,j,k)=Er15; Roe(i,j,k)=Roe15; %layer Muscle boundary elseif ctnumber(i,j,k) >= 38 & ctnumber(i,j,k) <= 46 G(i,j,k)=G16 ; Er(i,j,k)=Er16; Roe(i,j,k)=Roe16; sph(i,j,k)=sph16; perf(i,j,k)=perf16; met(i,j,k)=met16; therm(i,j,k)=therm16; %layer ovary boundary elseif ctnumber(i,j,k) >= 42& ctnumber(i,j,k) <= 48 46 G(i,j,k)=G17 ; Er(i,j,k)=Er17; Roe(i,j,k)=Roe17; %layer pancreas boundary elseif ctnumber(i,j,k) >= 29& ctnumber(i,j,k) <= 35 G(i,j,k)=G18; Er(i,j,k)=Er18; Roe(i,j,k)=Roe18; %layer Skin boundary elseif ctnumber(i,j,k) >= 70 & ctnumber(i,j,k) <= 85 G(i,j,k)=G19; Er(i,j,k)=Er19; Roe(i,j,k)=Roe19; sph(i,j,k)=sph19; perf(i,j,k)=perf19; met(i,j,k)=met19; therm(i,j,k)=therm19; %layer spleen boundary elseif ctnumber(i,j,k) >= 51& ctnumber(i,j,k) <= 57 G(i,j,k)=G20 ; Er(i,j,k)=Er20; Roe(i,j,k)=Roe20; %layer testis boundary elseif ctnumber(i,j,k) >= 30& ctnumber(i,j,k) <= 34 G(i,j,k)=G21; Er(i,j,k)=Er21; Roe(i,j,k)=Roe21; %layer thyroid boundary elseif ctnumber(i,j,k) >= 38 & ctnumber(i,j,k) <= 42 G(i,j,k)=G22; Er(i,j,k)=Er22; Roe(i,j,k)=Roe22; 47 %layer eyeball elseif ctnumber(i,j,k) >=47 & ctnumber(i,j,k) <= 53 G(i,j,k)=G23; Er(i,j,k)=Er23; Roe(i,j,k)=Roe23; sph(i,j,k)=sph23; perf(i,j,k)=perf23; met(i,j,k)=met23; end; end; end; end; GG=G; EEr=Er; RRoe=Roe; ssph=sph; pperf=perf; mmet=met; ttherm=therm; freq1=27e6; ; cells_per_wavelength=5; %********************************************************************** * % Fundamental constants %********************************************************************** * cc = 2.99792458e8; muz = 4.0*pi*1.0e-7; %speed of light in free space %permeability of free space 48 epsz = 1.0/(cc*cc*muz); %permittivity of free space aimp1 = 1; aimp2 = 1; % sqrt (muz/epsz); %********************************************************************** * % Initial calculations %********************************************************************** * lambda = cc/freq1; D=dx; dt = dx/(2.0*cc); %dx = 0.002 time step % xp=0.01; yp=0.01; zp=0.01; antx=xp; anty=yp; antz=zp; ant_objx=0.1; ant_objy=0.1; ant_objz=0.1; obj_sizex = xmax; obj_sizey = ymax; obj_sizez = zmax; objpx=antx+ant_objx; objpy=anty+ant_objy; objpz=antz+ant_objz; for norient=1:10; antx=xp; anty=yp; antz=zp; 49 ant_objx=objpx-antx; ant_objy=objpy-anty; ant_objz=objpz-antz; Dmaxx = obj_sizex + ant_objx + antx ; Dmaxy = obj_sizey + ant_objy + anty ; Dmaxz = obj_sizez + ant_objz + antz ; Dmax = max (Dmaxx, Dmaxy) Dmax= max (Dmax, Dmaxz); %********************************************************************** * % Inputs %********************************************************************** xinput = Dmaxx*1.1; %input('Enter the x dimensions of the space lattice: '); yinput = Dmaxy*1.1; zinput = Dmaxz*1.1; %********************************************************************** * % Grid parameters %********************************************************************** * tcon = 3; ie = round(xinput/dx); %number of grid cells in x-direction je = round(yinput/dy); %number of grid cells in y-direction ke = round(zinput/dz); %number of grid cells in z-direction ib = ie+1; jb = je+1; kb = ke+1; is = 2; %location of y-directed current source js = round(je/2); % side view y plane location %kobs = 5; kobs = round(ke/2); % top view z plane location ex = zeros (ib, jb, kb, tcon); 50 ey = zeros (ib, jb, kb, tcon); ez = zeros (ib, jb, kb, tcon); hx = zeros (ib, jb, kb, tcon); hy = zeros (ib, jb, kb, tcon); hz = zeros (ib, jb, kb, tcon); ct = zeros (ib, jb, kb); tt=ones(ib,jb,kb,tcon)*25; G=ones(ib,jb,kb)*0.001; Roe=ones(ib,jb,kb)*1.29; Er=ones(ib,jb,kb); sph=ones(ib,jb,kb)*1006; perf=ones(ib,jb,kb)*0; met=ones(ib,jb,kb)*0; therm=ones(ib,jb,kb)*0.026; tt1=ones(ib,jb,kb)*0; tt2=ones(ib,jb,kb)*0; tt3=ones(ib,jb,kb)*0; sar=zeros(ib,jb,kb); ez_source = zeros (ib, jb, kb); ey_source = zeros (ib, jb, kb); e_source = zeros (ib, jb, kb); ees = zeros (ib, jb, kb); ees1 = zeros (ib, jb); ees2 = zeros (ib,kb); %********************************************************************** % Time index setup %********************************************************************** ncur = 3; npr1 = 2; npr2 = 1; %********************************************************************** * % Material parameters %********************************************************************** * freq1=27e6; 51 %cells_per_wavelength = input ('Enter Cells per wavelength: '); cells_per_wavelength=5; %eps = [1.0 47]; %e1=47 a=2.17 %sig = [0 2.17]; cc = 2.99792458e8; %speed of light in free space muz = 4.0*pi*1.0e-7; %permeability of free space epsz = 1.0/(cc*cc*muz); %permittivity of free space aimp1 = 1; aimp2 = 1; % sqrt (muz/epsz); %********************************************************************** * % Initial calculations %********************************************************************** * lambda = cc/freq1; %D = lambda/cells_per_wavelength; %dx = 0.002; D=dx; dt = dx/(2.0*cc); %dx = 0.002 time step da = 1.0; %((cc*dt)/(dx))^2; db = dt/ muz/ dx; ca = zeros (ib, jb ,kb , 1); cb = zeros (ib, jb, kb, 1); %Shift Object to fit source model i111=round((antx+ant_objx)/dx); j111=round((anty+ ant_objy)/dy); k111=round((antz+ ant_objz)/dz); for i=1:ix; i11 = i+i111; for j=1:iy; j11 = j + j111; for k=1:iz; %i11 = i+3; %k11 = k+3; k11 = k+k111; Er(i11, j11, k11)= EEr(i,j,k); G(i11, j11, k11) = GG(i,j,k); Roe(i11, j11, k11) = RRoe(i,j,k); therm(i11, j11, k11) = ttherm(i,j,k); sph(i11, j11, k11) = ssph(i,j,k); 52 met(i11, j11, k11) = mmet(i,j,k); perf(i11, j11, k11) = pperf(i,j,k); ct(i11,j11,k11)=ct13(i,j,k); end; end; end; %********************************************************************** * % Updating coefficients %********************************************************************** * ca(:,:,:,1)=(1.0-(dt*G)./(2.0*epsz*Er))./(1.0+(dt*G)./(2.0*epsz*Er)); cb(:,:,:,1)=(dt/epsz/Er/dx)./(1.0+(dt*G)./(2.0*epsz*Er)); %********************************************************************** * % Create Sources: cosine distribution on a face of horn antenna %********************************************************************* a = 0.1; c = 25.546*a; yy11 = (yinput -2* a)/2; yy12 = yy11 + 2*a; zz11 = (zinput - 2*a)/2; zz12 = zz11 + 2*a; source1_y1 = fix(yy11/dy)+1; source1_y2 = fix(yy12/dy)+1; source1_z1 = fix(zz11/dz)+1; source1_z2 = fix(zz12/dz)+1; kc=1.841/a; for j = source1_y1:source1_y2; y=(j-1)*dy; y1=y-anty; 53 for k = source1_z1:source1_z2; z=(k-1)*dz; z1=z-antz; b = kc*sqrt(y1^2+z1^2); ph=atan2(z1,y1); d = besselj(1,b); d1=besselj(0,b); dd = -d/b+d1; e = sqrt(y1^2+z1^2); f = sin(ph); g = cos(ph); if y1^2 + z1^2 <= a^2; ey_source(is,j,k) = -g^2*d/(kc*b)-f^2*dd/kc; end; if y1^2 + z1^2 <= a^2; ez_source(is,j,k) = -f*g*d/(kc*b) + g*f*dd/kc; end; end; end; e_source=ez_source.^2+ey_source.^2; e_source=sqrt(e_source); eesm=max(max(max(e_source))); e_source=(e_source)/eesm; ctm=max(max(max(ct))); ees=e_source+ct/ctm; %********************************************************************** * % BEGIN TIME-STEPPING LOOP %********************************************************************** * nmax=100; for n=1:nmax % if mod(n,10) == 0 % time = n % end %display time progress 54 %********************************************************************** * % Update time container index %********************************************************************** npr2 = npr1; npr1 = ncur; ncur = mod(ncur+1,3); if ncur == 0 ncur = 3; else ncur = ncur; end %********************************************************************** % Apply soft lattice Truncation Conditions at the boundaries %********************************************************************** %i = 0 case (index =1) %case where index excludes the boundaries hy (1, 1:jb, 2:ke-1, ncur) = (hy (2 , 1:jb , 1:ke-2 , npr2)+... hy (2 , 1:jb , 2:ke-1, npr2)+hy(2 ,1:jb ,3:ke , npr2))/3; hz (1, 1:je, 2:ke, ncur) = (hz(2, 1:je, 1:ke-1, npr2)+... hz (2, 1:je, 2:ke, npr2) + hz (2, 1:je, 3:kb, npr2))/3; %case where k = ke, kb index fails (at max k index for hy, hz) hy (1, 1:jb ,ke, ncur) = (hy (2, 1:jb, ke-1, npr2)+... hy (2, 1:jb, ke, npr2))/2; hz (1, 1:je, kb, ncur) = (hz (2, 1:je, kb-1, npr2)+... hz (2, 1:je, kb, npr2))/2; %for k = 1 where index fails (at min k index for hy, hz) hy (1, 1:jb, 1, ncur) = (hy (2, 1:jb, 1, npr2)+... hy (2, 1:jb, 2, npr2))/2; hz (1, 1:je, 1, npr2) = (hz (2, 1:je, 1, npr2)+... hz (2, 1:je, 2, npr2))/2; %i = imax case %case where index excludes the boundaries hy (ie, 1:jb, 2:ke-1, ncur) = (hy (ie-1, 1:jb, 1:ke-2, npr2)+... hy (ie-1, 1:jb, 2:ke-1, npr2) + hy (ie-1, 1:jb, 3:ke, npr2))/3; hz (ie, 1:je, 2:ke, ncur) = (hz (ie-1, 1:je, 1:ke-1, npr2)+... hz (ie-1, 1:je, 2:ke, npr2) + hz (ie-1, 1:je, 3:ke+1, npr2))/3; 55 %for k = ke, kb where index fails (at max k index for hy, hz) hy (ie, 1:jb, ke, ncur) = (hy (ie-1, 1:jb, ke-1, npr2)+... hy (ie-1, 1:jb, ke, npr2))/2; hz (ie, 1:je, kb, ncur) = (hz (ie-1, 1:je, kb-1, npr2)+... hz (ie-1, 1:je, kb, npr2))/2; %for k=1 where index fails (at min k index for hy, hz) hy (ie, 1:jb, 1, ncur) = (hy (ie-1, 1:jb, 1, npr2)+... hy (ie-1, 1:jb, 2, npr2))/2; hz (ie, 1:je, 1, ncur) = (hz (ie-1, 1:je, 1, npr2)+... hz (ie-1, 1:je, 2, npr2))/2; %j=0 case (index=1) ex (1:ie, 1, 1:kb, ncur) = ex (1:ie, 2, 1:kb, npr2); ez (1:ib, 1, 1:ke, ncur) = ez (1:ib, 2, 1:ke, npr2); %j=jmax case (index=1) ex (1:ie, jb, 1:kb, ncur) = ex (1:ie, jb-1, 1:kb, npr2); ez (1:ib, jb, 1:ke, ncur) = ez (1:ib, jb-1, 1:ke, npr2); %k=0 case (index k=1) %case where index excludes the boundaries ex (2:ie-1, 1:jb, 1, ncur) = (ex (1:ie-2,1:jb,2,npr2)+... ex (2:ie-1,1:jb,2,npr2) + ex (3:ie,1:jb,2,npr2))/3; ey (2:ie, 1:je, 1, ncur) = (ey (1:ie-1, 1:je, 2, npr2)+... ey (2:ie, 1:je, 2, npr2) + ey (3:ie+1, 1:je, 2, npr2))/3; %for i = ie, ib case where index fails (at max i index for ex, ey) ex (ie,1:jb,1,ncur) = (ex(ie-1,1:jb,2,npr2)+... ex (ie,1:jb,2,npr2))/2; ey (ib,1:je,1,ncur) = (ey(ib-1,1:je,2,npr2)+... ey (ib,1:je,2,npr2))/2; %for i=1 case where index fails (at min i index for ex, ey) ex (1,1:jb,1,ncur) = (ex(1,1:jb,1,npr2)+... ex(2,1:jb,1,npr2))/2; ey (1,1:je,1,ncur) = (ey (1,1:je,1,npr2)+... ey (2,1:je,1,npr2))/2; ex(2:ie-1,1:jb,kb,ncur) = (ex(1:ie-2,1:jb,kb-1,npr2)+... 56 ex(2:ie-1,1:jb,kb-1,npr2)+ex(3:ie,1:jb,kb-1))/3; ey(2:ie,1:je,kb,ncur) = (ey(1:ie-1,1:je,kb-1,npr2)+... ey(2:ie,1:je,kb-1,npr2) + ey(3:ie+1,1:je,kb-1,npr2))/3; %for i=ie,ib case where index fails (at max i index for ex, ey) ex(ie,1:jb,kb,ncur) = (ex(ie-1,1:jb,kb-1,npr2)+... ex(ie,1:jb,kb-1,npr2))/2; ey(ib,1:je,kb,ncur) = (ey(ib-1,1:je,kb-1,npr2)+... ey(ib,1:je,kb-1,npr2))/2; ex(1,1:jb,kb,ncur) = (ex(1,1:jb,kb-1,npr2)+... ex(2,1:jb,kb-1))/2; ey(1,1:je,kb,ncur) = (ey(1,1:je,kb-1,npr2)+... ey(2,1:je,kb-1,npr2))/2; %********************************************************************** * % Update electric fields %********************************************************************** * ex(1:ie,2:je,2:ke,ncur) = ca(1:ie,2:je,2:ke,1).*ex(1:ie,2:je,2:ke,npr1)+... cb(1:ie,2:je,2:ke,1).*(hz(1:ie,2:je,2:ke,npr1)-hz(1:ie,1:je-1,2:ke,npr1)+... hy(1:ie,2:je,1:ke-1,npr1)-hy(1:ie,2:je,2:ke,npr1)); ey(2:ie,1:je,2:ke,ncur) = ca(2:ie,1:je,2:ke,1).*ey(2:ie,1:je,2:ke,npr1)+... cb(2:ie,1:je,2:ke,1).*(hx(2:ie,1:je,2:ke,npr1)-hx(2:ie,1:je,1:ke-1,npr1)+... hz(1:ie-1,1:je,2:ke,npr1)-hz(2:ie,1:je,2:ke,npr1)); ez(2:ie,2:je,1:ke,ncur) = ca(2:ie,2:je,1:ke,1).*ez(2:ie,2:je,1:ke,npr1)+... cb(2:ie,2:je,1:ke,1).*(hx(2:ie,1:je-1,1:ke,npr1)-hx(2:ie,2:je,1:ke,npr1)+... hy(2:ie,2:je,1:ke,npr1)-hy(1:ie-1,2:je,1:ke,npr1)); sar1=abs(ex(:,:,:,ncur)).^2+abs(ey(:,:,:,ncur)).^2+abs(ez(:,:,:,ncur)).^2; %sar= G.*sar1./(2*Roe); %********************************************************************** ** % Source update %********************************************************************** ** 57 ez(is,source1_y1:source1_y2,source1_z1:source1_z2,ncur) = ... ez_source(is,source1_y1:source1_y2,source1_z1:source1_z2,1)*... aimp1 * sin(2*pi*freq1*n*dt); ey(is,source1_y1:source1_y2,source1_z1:source1_z2,ncur) = ... ey_source(is,source1_y1:source1_y2,source1_z1:source1_z2,1)*... aimp1 * sin(2*pi*freq1*n*dt); %********************************************************************** * % Update magnetic fields %********************************************************************** * hx(2:ie,1:je,1:ke,ncur) = da*hx(2:ie,1:je,1:ke,npr1)+... db*(ey(2:ie,1:je,2:kb,ncur)-ey(2:ie,1:je,1:ke,ncur)+... ez(2:ie,1:je,1:ke,ncur)-ez(2:ie,2:jb,1:ke,ncur)); hy(1:ie,2:je,1:ke,ncur) = da*hy(1:ie,2:je,1:ke,npr1) + ... db*(ex(1:ie,2:je,1:ke,ncur)-ex(1:ie,2:je,2:kb,ncur) + ... ez(2:ib,2:je,1:ke,ncur) - ez(1:ie,2:je,1:ke,ncur)); hz(1:ie,1:je,2:ke,ncur) = da*hz(1:ie,1:je,2:ke,npr1) +... db*(ex(1:ie,2:jb,2:ke,ncur) - ex(1:ie,1:je,2:ke,ncur) +... ey(1:ie,1:je,2:ke,ncur) - ey(2:ib,1:je,2:ke,ncur)); %********************************************************************** * % END TIME-STEPPING LOOP %********************************************************************** * end; sar1=abs(ex(:,:,:,ncur)).^2+abs(ey(:,:,:,ncur)).^2+abs(ez(:,:,:,ncur)).^2; sar= G.*sar1./(2*Roe); 58 %********************************************************************** * % Update temperature %********************************************************************** * ncur = 2; npr1 = 1; nmax=100; dtt=0.05; for n=1:nmax %********************************************************************** * % Update time container index %********************************************************************** npr2 = npr1; npr1 = ncur; ncur = mod(ncur+1,3); if ncur == 0 ncur = 3; else ncur = ncur; end tt1(2:ie-1,:,:)=(therm(3:ie,:,:).*tt(3:ie,:,:,npr1)-therm(3:ie,:,:).*tt(1:ie-2,:,:,npr1)-... therm(1:ie-2,:,:).*tt(3:ie,:,:,npr1)+therm(1:ie-2,:,:).*tt(1:ie-2,:,:,npr1))/4 +... therm(2:ie-1,:,:).*(tt(3:ie,:,:,npr1)-2*tt(2:ie-1,:,:,npr1)+tt(1:ie-2,:,:,npr1)); tt1=tt1/dx/dx; tt2(:,2:je-1,:)=(therm(:,3:je,:).*tt(:,3:je,:,npr1)-therm(:,3:je,:).*tt(:,1:je-2,:,npr1)-... therm(:,1:je-2,:).*tt(:,3:je,:,npr1)+therm(:,1:je-2,:).*tt(:,1:je-2,:,npr1))/4 +... therm(:,2:je-1,:).*(tt(:,3:je,:,npr1)-2*tt(:,2:je-1,:,npr1)+tt(:,1:je-2,:,npr1)); tt2=tt2/dy/dy; tt3(:,:,2:ke-1)=(therm(:,:,3:ke).*tt(:,:,3:ke,npr1)-therm(:,:,3:ke).*tt(:,:,1:ke-2,npr1)... therm(:,:,1:ke-2).*tt(:,:,3:ke,npr1)+therm(:,:,1:ke-2).*tt(:,:,1:ke-2,npr1))/4 +... therm(:,:,2:ke-1).*(tt(:,:,3:ke,npr1)-2*tt(:,:,2:ke-1,npr1)+tt(:,:,1:ke-2,npr1)); tt3=tt3/dz/dz; 59 tt(:,:,:,ncur) = tt(:,:,:,npr1)+ dtt*(tt1+tt2+tt3+sar.*Roe-(3600*1057*perf.*(tt(:,:,:,npr1)37)/6000)+met)./Roe./sph; end; is=2; %********************************************************************** * % Visualize fields %********************************************************************** * tmax=nmax*dtt/60; ee=tt(:,:,:,ncur); [ix1,iy1,iz1]=size(ee); i=1:ix1; x1=(i-1)*dx; i=1:iy1; y1=(i-1)*dy; i=1:iz1; z1=(i-1)*dz; iz2=round(iz1/6)+1; inx=ix1*iy1*iz1; figure(1); for isub=1:iz1; subplot(iz2,6,isub); ees1=ee(:,:,isub); pcolor(x1,y1,ees1'); colorbar; shading flat; axis off; end; xlabel('x,m'); ylabel('y,m'); title(['Temperature, degress C after ',num2str(tmax),' minutes']); ees=abs(ees); figure(2) for isub=1:iz1; 60 subplot(iz2,6,isub); ees1=ees(:,:,isub); pcolor(x1,y1,ees1'); colorbar; shading flat; axis off; end; title('Electric field, Volts/meter'); xlabel('x,m'); ylabel('y,m'); [xp,yp]=ginput(1); figure(3) iz2=round(iy1/6)+1; np1=round(yp/dy)+1; ees2(:,:)=ees(:,np1,:); pcolor(x1,z1,ees2'); colorbar; shading flat; axis off; title('Electric field, Volts/meter'); xlabel('x,m'); ylabel('z,m'); [xpp,ypp]=ginput(1); zp=ypp; end; end; close(1); % -----------------------------------------------------------% Read the current directory and sort the names % -----------------------------------------------------------function load_listbox(dir_path,handles) cd (dir_path) dir_struct = dir(dir_path); [sorted_names,sorted_index] = sortrows({dir_struct.name}'); handles.file_names = sorted_names; 61 handles.is_dir = [dir_struct.isdir]; handles.sorted_index = [sorted_index]; guidata(handles.figure1,handles) set(handles.listbox1,'String',handles.file_names,... 'Value',1) set(handles.text1,'String',pwd) % --- Executes during object creation, after setting all properties. function listbox1_CreateFcn(hObject, eventdata, handles) usewhitebg = 1; if usewhitebg set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end 62 BIBLIOGRAPHY 1. American Cancer Society, “Progress Report on Reducing the Global Cancer Burden”, presented at the 20th World Cancer Congress. August 2008. 2. R. Bansal, “Battling cancer: the latest on microwave hyperthermia”, IEEE Microwave Magazine, Volume 6, Issue 3, Sept. 2005 Page(s):32 – 34. 3. E.L. Jones, J.R. Oleson, L.R. Prosnitz, T.V. Samulski, Z. Vujaskovic, D.Yu, L.L. Sanders, and M.W. Dewhirst, ‘Randomized trial of hyperthermia and radiation for superficial tumors’, J Clin. Oncol. 2005 May 1;23(13):3079-85. 4. R. Knoechel, ‘Capabilities of Multiapplicator systems for focused hyperthermia’, IEEE Trans. Microw. Theory Tech., Vol.31, pp. 70-73, Jan. 1983. 5. M. Popovic and L. Duong, “Phased array for microwave hyperthermia: a preliminary study in a computational muscle phantom”, 2005 IEEE International Symposium on Antennas and Propagation, Volume 2B, 3-8 July 2005 Page(s):788 – 791. 6. Sabariego, R.V.; Landesa, L.; Obelleiro, F., “Synthesis of an array antenna for hyperthermia applications”, IEEE Transactions on Magnetics, Volume 36, Issue 4, Part 1, July 2000 Page(s):1696 – 1699. 7. B.P. Kumar, N. Karnik & G.R. Branner, ‘Near-field beam-forming for hyperthermia applications using waveguide aperture arrays’, (invited paper), Proceedings of the 2002 Progress in Electromagnetics Research (PIERS) Conference, Boston, p. 345 (abstract), July 2002. 63 8. C.Y. Huang, Design And Optimization Of Nine Element Array Antenna For Deep Focused Hyperthermia Applications, M.S. Thesis, California State University, Sacramento, 2002. 9. C.A. Balanis, ‘Antenna Theory: Analysis and Design’, John Wiley & Sons, New York, 1997. 10. DICOM File Format. Retrieved on April 21st, 2010 from World Wide Web: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28416/img/dicom004.gif 11. The Mathworks Inc., Graphical User Interface Applications. Retrieved on March 13th, 2010 from World Wide Web: http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/buildgui.pdf