Sei sulla pagina 1di 13

Progress Report

Project: Realtime Robotic Radiation Oncology Name: Brian Murphy Student ID: 03054128 Course: 4ECE Supervisor: Martin Glavin

Brian Murphy

29/05/2012

Table of Contents
Table of Contents...............................................................................................................2 Chapter 1 - Introduction.....................................................................................................2 Chapter 2 Technology.....................................................................................................4 2.1 - Hardware................................................................................................................4 2.1.1 - Image Acquisition Device..............................................................................4 2.1.2 - Laser Pointer...................................................................................................5 2.1.3 - Lego Mindstorms............................................................................................5 ....................................................................................................................................5 2.1.4 - PC running the Software.................................................................................6 2.2 - Software.................................................................................................................6 2.2.1 - Matlab.............................................................................................................6 2.2.2 - Image Acquisition Toolbox............................................................................6 2.2.3 - Image Processing Toolbox.............................................................................6 2.2.4 - Labview...........................................................................................................6 Chapter 3 Design and Operation.....................................................................................7 3.1 - Image Acquisition In Matlab.................................................................................7 3.2 - Image Acquisition In Labview..............................................................................7 3.3 - Buffer Management In Labview............................................................................8 3.4 - Camera Operation in Labview...............................................................................9 3.5 Robotic Control...................................................................................................11 3.6 - Lego Mindstorms Kit...........................................................................................11 Chapter 4 Progress & Remaining Work.......................................................................12 4.1 - Progress To Date..................................................................................................12 4.2 - Remaining Work..................................................................................................12 Table Of Figures...............................................................................................................13

Chapter 1 - Introduction
Oncology is the study of tumors in a body and aims to understand their development, diagnosis treatment and prevention. There are many different treatments for oncology,

Brian Murphy

29/05/2012

one if which is radiation therapy also known as radiotherapy. In radiotherapy high energy rays are used to damage the cancerous cells and stop them growing and dividing. There are different types of radiotherapy, external radiotherapy and internal radiotherapy. Internal radiotherapy is when the radiation source is placed inside the body very close to or inside the tumor. It is divided into two, sealed source radiotherapy is where the source is placed into small sealed vials called the implants and unsealed source radiotherapy is where the radiation source is injected directly into the vein. External radioherapy is where beams of ionizing radiation are applied from outside the body. While large doses of radiation would be very harmful to the human body, the body can tolerate small doses over long periods of time. To maximise the energy focused on the tumor, and to protect other organs of the body, radiation is usually delivered in narrow beams from a number of sources that converge on the location of the tumor within the patient. At the moment, the alignment of the radiation beams is performed by technicians who calculate the position of the tumor from various scans of the body, and using their knowledge of geometry, training and experience, set up the radiation beams to converge as accurately as possible on the target tumor. One such problem with this method is that areas surronding the tumor and sensitive to the radiation have to be avoided which in turn leads to a lower dosage of radiation and thus cannot effectively treat the cancer. A solution to this problem is described by a treatment known as 3-Dimensional Conformal Radiotherapy (3DCRT) Conformal Radiotherapy is where the the profile of each radiation beam is shaped to fit the profile of the target from a beams eye view. When the treatment volumes conform to the shape of the tumor, the radiation to the surrounding tissue is reduced which allows a higher dosage of radiation to be delivered to the tumor than ordinary techniques would allow. Intensity-Modulated Radiation Therapy (IMRT) is an advancement on 3DCRT in which the intensity of the radiation beam can also be controlled. This maximises the radiation dose to the gross tumor area while radiaiton among surrounding tissue is decreased or completely avoided. IMRT is most effective for concave tumors and is therefore efficient in treating tumors wrapped around a vulnerable structure for example the spinal chord or a blood vessel. The aim of this project will be to optically track a tumor in a body and follow it with ionising radiation. To represent a tumor a small spherical object such as a ball Brian Murphy 29/05/2012 3

should be used as well as laser beams to represent the radiation beams. This system should also be capable of monitoring any movement of the target and compensate for that movement by re-focusing the beams accordingly. The system will be further developed to operate in real time.

Figure 1: Image of Tumour in a body receiving Radiotherapy

Chapter 2 Technology
2.1 - Hardware
2.1.1 - Image Acquisition Device
The image acquisition device used for this project is a standard web cam (Logitech QuickCam 5.6.1). It uses a standard USB interface with the PC. The device

Brian Murphy

29/05/2012

drivers are supplied with the camera, which will control the acquisition of frames, which will be used in to locate the position of the ball.

2.1.2 - Laser Pointer


Small pen torches will represent the laser pointer. These will be mounted on a pan & tilt turret, which contains two servo motors to control the movement of the turret. These servos are controlled by a servo controller, which accepts serial control messages over a USB connection form the PC running the software.

2.1.3 - Lego Mindstorms


The Lego Mindstorms kit will be used to locate the position of the ball and then to track any movement, which may occur. It is controlled by a specially designed NI Labview, which enables the user to program the NXT and upload the programs via USB connectivity. The NXT is the brains of the Mindstorms robot. It is a computer-controlled LEGO brick that lets a Mindstorm robot come alive and perform various different operations.

Figure 2: Lego Mindstorms NXT

Brian Murphy

29/05/2012

2.1.4 - PC running the Software


The PC running the software is a standard desktop computer. The software used will be Matlab at first to implement the algorithms from a previously completed project and then Labview to control the NXT and also to implement the system in real time.

2.2 - Software
2.2.1 - Matlab
Matlab is a high-level scientific and engineering program, which provides many useful capabilities for plotting and visualizing data. To further enhance Matlab capabilities, it provides the user with additional software packages known as toolboxes. Two such toolboxes required for this project are the Image Acquisition toolbox and the Image Processing Toolbox.

2.2.2 - Image Acquisition Toolbox


The Image Acquisition software allows the user to acquire images and videos directly into Matlab from PC compatible software1.

2.2.3 - Image Processing Toolbox


The Image Processing toolbox provides a comprehensive set of referencestandard algorithms and graphical tools for image processing, analysis, visualization, and algorithm development2.

2.2.4 - Labview
Labview will be the central programming language for this project. It is a platform and development environment for a visual programming language from National Instruments (NI). Like Matlab, Labview also provides the user with extra software packages. One which is central to this project is the Image Acquisition (IMAQ) toolbox.

1 2

T he MATLAB product page at Mathworks - http://www.mathworks.com/products/imaq/ The MATLAB product page at Mathworks - http://www.mathworks.com/products/image/

Brian Murphy

29/05/2012

Chapter 3 Design and Operation


3.1 - Image Acquisition In Matlab
The Images were read into Matlab via a USB web cam and Image Acquisition toolbox.

3.2 - Image Acquisition In Labview


In order to obtain an image from a USB camera in Labview it is very important to install the relevant software in a particular order. The following is a guide to the relevant steps that should be followed to obtain an image in Labview. Step 1: Install the USB camera driver. This is a disk, which should be included with the camera from the manufacturer. Step 2: Install Labview. This is done by inserting the disk from (NI) and follow the on screen instructions. Step 3: Install the Image Acquisition Toolbox. This is supplied with Labview but is on a separate disk to it. This will let you work on images. Step 4: Install the driver software which is available as a free download from the NI website. Step 5: Install the vision development toolbox, which is also on a separate disk to Labview. This is used to get images from firewire cameras but it does not support USB. Step 6: Install the IMAQ USB setup which is again a free download off the NI website. This adds USB support to the package in step 5. Once all of these steps have been executed it is possible to read in and work on images from a camera in Labview. Figure 3 shows a block diagram of the NI-IMAQ for USB cameras architecture.

Brian Murphy

29/05/2012

Labview and IMAQ Vision

Vision Assistant

IMAQDirectShowDLL Application Level -------------------------------------------------------------------------------------------------------

Camera Manufacturer Direct Show Filter

Figure 3: NI-IMAQ for USB Cameras Architecture

3.3 - Buffer Management In Labview


The IMAQ create and IMAQ dispose Virtual Instruments (VI) manage image buffers in Labview. IMAQ create shown in Figure allocates an image buffer. Image Name is a label for the buffer created. Each buffer must have a unique name. Image type specifies the type of image being created.

Figure 4: IMAQ Create

New Image contains pointer information to the buffer, which is initially empty. If the image is going to be processed it may be necessary to wire a value to Border Size.

Brian Murphy

29/05/2012

This is the width, in pixels, of a border created around an image. Some image processing functions, such as labelling or morphology, require a border. IMAQ dispose shown in Figure frees up the memory allocated for the image buffer. Call this VI only after the image is no longer required for processing.

Figure 5: IMAQ Dispose

3.4 - Camera Operation in Labview


There are two types of image acquisitions in Labview snap and grab. Snap - A snap acquires a single image into memory buffer. Use this mode to acquire a single frame to a buffer. When snap is initialised, the device acquires the next incoming video frame to a buffer. Use snap for low-speed or single capture applications. Use IMAQ USB Snap to perform a snap acquisition in Labview. The following is a simplified block diagram for using IMAQ USB Snap.

Figure 6: Acquiring an Image Using IMAQ USB Snap

Grab - A grab is a continuous, high-speed acquisition of data to a single buffer in host memory. This function performs an acquisition that loops continually on one buffer. It is possible to get a copy of the acquisition buffer by grabbing a copy to a Labview image buffer. For this to happen two VIs must be used IMAQ USB Grab Setup and IMAQ USB Grab Acquire. Call IMAQ USB Grab Setup once to initialise the acquisition and start capturing the image to an internal software buffer. The IMAQ USB Grab Acquire can be called multiple times to copy the image currently stored in the buffer to a Labview image buffer. Once the program is finished copying images,

Brian Murphy

29/05/2012

call IMAQ USB Close once to shut down the acquisition. Figure shows a simplified block diagram for using IMAQ USB Grab Setup and IMAQ USB Grab Acquire.

Figure 7: Acquiring an Image Using IMAQ USB Grab

The following is an image captured in Labview. The ball will represent the tumor. Some image processing techniques must be performed on this to eliminate any unwanted background material and clearly detect the ball.

Figure 8: Image capture in Labview

Brian Murphy

29/05/2012

10

3.5 Robotic Control


The pen torches will be mounted on a pan & tilt turret. The turret is initially controlled by a parallax servo controller, which is capable of handling 16 servos and is sent commands serially over a virtual com port. The turret consists of two servo motors and is capable of 180 of pan and tilt.

3.6 - Lego Mindstorms Kit


The Lego Mindstorms will be built and programmed in such a way that any movement form the Tumour will be detected and the Mindstorms will then follow the Tumour until it stops moving. The Mindstorms kit is equipped wit h an ultrasonic sensor, which gives it the ability to see objects and react to any movement that may occur. One such Mindstorm robot is shown in Figure

Figure 9: LEGO Mindstorms Tribot

Brian Murphy

29/05/2012

11

Chapter 4 Progress & Remaining Work


4.1 - Progress To Date
Matlab Algorithms from previous project ran and tested. Results taken from Matlab Algorithms. Commissioned Labview for Image Acquisition. Images captured into Labview. Performing Edge Detection in Labview.

4.2 - Remaining Work


Import all Matlab algorithms into Labview. Compare both Matlab and Labview results against each other. Create Labview program to control two servo motors using three NIDAQ interface card. Integrate image processing algorithms with the servo motors to allow system to estimate location of the ball and move the servo motors to point beams directly at the ball. Fine tune system to allow two servo motors and two cameras run in real time.

Brian Murphy

29/05/2012

12

Table Of Figures
Figure 1: Image of Tumour in a body receiving Radiotherapy ........................................4 Figure 2: Lego Mindstorms NXT......................................................................................5 Figure 3: NI-IMAQ for USB Cameras Architecture.........................................................8 Figure 4: IMAQ Create......................................................................................................8 Figure 5: IMAQ Dispose....................................................................................................9 Figure 6: Acquiring an Image Using IMAQ USB Snap....................................................9 Figure 7: Acquiring an Image Using IMAQ USB Grab..................................................10 Figure 8: Image capture in Labview................................................................................10 Figure 9: LEGO Mindstorms Tribot............................................................................11

Brian Murphy

29/05/2012

13

Potrebbero piacerti anche