1. Design Overview
1. the design intent
The rapid development of medical imaging technology to constantly promote the progress of modern medicine, CT, MRI, PET widely applied and clinical diagnostic analysis, its role has changed from body tissues and organs of the anatomical structure of non-intrusive inspection and visualize, develop a plan for operation and simulation, surgical navigation, radiotherapy planning and tracking focus changes from the basic tools for medical image segmentation of the anatomical structures in and constructs a shape in the collection expression.
MR spinal image segmentation studies for medical images of computer-aided identification and neural pathology clinical research have a critical role.
If you can't be accurate and clear the spine from the image segmentation and recognized, then the computer technology for clinical research value is very limited, however, rely on manual methods to complete this work is not enough. The traditional assessment of previous vertebral fracture is manual on each vertebra Callout 6 points (four corners and the midpoint of the upper and lower edge), and then measure the front, middle, rear height of the vertebrae. But the process is very time consuming. Written records, use the mouse to locate a patient 1 block vertebral takes more than 15 minutes, for the entire spine of positioning of time-consuming will make it difficult to accept. Therefore, medical clinic urgent need a way to automatically complete the MR spinal segmentation, the computer automatically locate the vertebra and disc for computer-aided diagnosis with important clinical applications.This work of design intent i.e. Nios.
II processor platform implementation we study a viable, robustness, high algorithms use our lab studies on Spine MRI image segmentation algorithm for spinal sagittal magnetic resonance (Sagittal Views) automatic disc positioning and quantitative dimension, making full use of Altera FPGA/Nios II resources system miniaturization and portable. The algorithm of the application, you can improve on osteoporosis and vertebral fractures caused by automatic assessment of the quantitative analysis conducted on disc, help and other imaging image (CT) for image registration and image guided spinal surgery.2. application and in response to user group
This work is mainly applicable to all own NMR instrument medical institutions.
As a result of this work is based on the Nios II processor, with the use of convenient features, and therefore also suitable for ordinary people, they can in order to understand the patient's condition to remind patients in their attention to the prevention of spinal condition. And this works with network transport functions, convenient doctor for remote consultation.3. This design takes advantage of Nios II processor
(1) the Nios II processors provide innovative SOPC design philosophy.
Nios II soft core system performance can be carried out according to the application of the reduction, customize the user's own system, and fixed processors in lower clock rates with higher performance.
With rich IP core library, user-friendly design, effective operation of the system. Nios II user logic functions and user instructions emergent NiosII processor technical highlights, provides operations optimization, acceleration of an effective way to increase the processing speed, to a certain level, easy-to-implement algorithm of commercialization.(2) the Nios II IDE development environment integrates already ported to Nios II processor of RTOS operating system, facilitating our ucosII directly using the operating system is complete system design and feature line extensions.
(3) Dsp Builder rich function modules and IP core.
With the DSP Builder so that we can proceed in Simulink algorithm-level systems development.
And you can move algorithm designed to customize user instructions, use SoPC Builder and Quartus. Nios II software integration-II embedded system processor, through a software called custom instruction complete DSP algorithm.(4) C2H strong support to design.
Nios II C2H compiler provided the ability to require a higher level of performance of the C language program automatically converted to a hardware accelerator, integrated into the Nios II FPGA-based subsystems.
In this way, Nios II processors share the data calculation and storage access feature, allowing the processor to better handle other tasks. Since Avalon Internet does not limit the host and the quantity from the machine, thus, Nios II C2H compiler can convert the object code, generated more memory autonomy hardware accelerator. Help embedded systems developers to improve efficiency and achieve a successful design.II. function description
MRI study of vertebral segmentation is using magnetic resonance imaging device on human tissue for qualitative or quantitative analysis of the key steps are indispensable.
Introduction of computer-assisted image segmentation spine MRI would make a doctor's clinical diagnosis more accurate and timely, and reduce medical costs, reduce the pressure on doctors, has good prospects.This design hardware parts including DE1 development platform, MRI image LCD display panel, and MR device and PC network interface board.
System function module mainly divided into the following six: MRI image preprocessing module, spinal extraction module, vertebral segmentation module detection, LCD graphics display and interactive modules, MRI image data access module, the network module.1.
MRI image preprocessing module, spinal extraction module, vertebral segmentation module is the detection algorithms part of this work lies at the heart of the function. Nios II processor we use powerful computing capacity, most of the algorithmUse the C program, thanks to the acceleration C2H tool, we will most of time spent in algorithm of section use this tool to accelerate, shorten the development cycle.2.
LCD graphics display and interaction module: we use the LCD screen and the mouse to achieve image display and interactive functionality. Mouse and lcd through their own written IP core to Avalon from devices connected to the Nios II processor.Design time we used the IED development environment UCOSII real-time operating system to complete the system of task management and scheduling algorithms, transplantation corresponds to our use of the LCD controller chip TCB8000C UCGUI graphics interface, so that the system has a good human-computer interaction.
3.
MRI image data access module: direct access from the imaging device image General compliant medical image format, i.e. the dicom format, this format of image for normal users is not common to use specialized software or read the medical equipment, so in order to make the image in any case, in most circumstances you can easily read, we passed by the dicom format conversion to bmp format, through the network to download the hardware platform of the images on the storage device is already had a format conversion of bmp format images, processing continues to bmp format images uploaded to the PC. In this case, you need more storage space, so use the SD card as the data storage, and transplantation corresponds to sd card UCFS file system, enhanced system scalability and system data management capabilities.4. the network transmission module: using Ethernet, enabling data interaction.
Ethernet interface and convenient system from MR device gets an image. Use the extension interface, DE1 to DM9000A chip at the core, developed the network interface board, since the introduction of Ethernet allows system has better scalability.Nios II processor features and sopc design philosophy that our design process become not so boring, this is a continuous optimization algorithm, perfect design, make the system run faster.
We will design into about two steps: 1) to build the Nios II system algorithm to use pure software in the Nios II up and running on the primary realization of system functionality. 2) using custom instruction and custom peripherals, accelerated algorithm runs.III. performance parameters
System performance parameters:
Spinal magnetic resonance images for diagnosis of spine disease plays a very important role, for example, for a description of the degenerated disc than other forms of image for better results, and on the treatment of spinal surgery.
On the spine for analysis by nuclear magnetic resonance image processing can be aided diagnosis more accurate, saving time and costs. So for this system, the most important thing is to be accurate and clear the spine from the image segmentation and recognized, in ensuring the accuracy of image segmentation, by optimizing the code, use C2H tools and custom user peripherals and other methods combined with block operation speed.The following figure is a systems engineering after compiling occupancy of the various resources:
Algorithm for each step operation hours are as follows: (the following is a code optimized run time)
Image processing: 4128.77ms ms extraction cord (Spinal Cord extraction): 24208.14ms disc detection (Disks Detection): 6.03ms image into the SD card: 15881.59 ms image from the SD card into time: 5730.02msAlgorithms for segmentation of accuracy from the system after running the final image is generated, the system can more accurately be spine label, and in the spine on the platform in accordance with the number of annotations.
Medical instrument specific performance also need long-term clinical trials to be verified and, through these data to improve our algorithms.The following figure is a direct shot Works displays the effect, in the later chapters of the displayed picture is the system through a network transfer pictures to your computer.
IV. design structure
Based on the Nios II Image segmentation of MRI spine system hardware chart
Software process as follows:
V. design method
1. system hardware design
SOPC Builder settings as
Quartus II software module diagram as follows
System real pictures:
2. the implementation steps and implementation method
1.
LCD graphics display and interaction module(1) LCD and mouse hardware parts
LCD controller chip adopts TCB8000C, control 5.7 inch color LCD display TFT65000.
Controller interface and MCU interface map as follows, by writing a hardware program to Avalon bus from devices connected to the Avalon bus for Nios direct access to the functionality of the LCD controller, against the driverWrite, simplify subsequent GUI transplantation for LCD driver section.System uses a PS/2 mouse, PS/2 mouse connector uses a two-way sync serial Protocol.
That is, each in the clock line on a pulse that is sent over the data cable and a bit of data. With nios connection still use verilog language implementation from the device, Avolon PS/2 mouse transport protocol. The program includes mouse_avalon_interFace.v, mouse_register_file.v, ps2_mouse_interface.v. Which is avalon mouse_avalon_interface.v bus from device interface, mouse_register_file.v, ps2_mouse_interface.v complete PS/2 mouse protocol conversion and transmission of data. Write the corresponding GUI driver, mouse actions for GUI.(2) c/μ g u I transplant
C/μ G U I is an excellent system for embedded graphics software, it has the source code open, portable, can be cut, stability and high reliability.
C/μ G U I provides a wealth of interface elements, such as button, edit box, slider controls, while supporting efficient Windows will transfer mechanism, as-interface and application functions provide a good interface mechanism. Multifunctional digital mini photo frame system for human-computer interaction interface is the use of this tool for development.C/μ G U I software system structure is as follows:
C/μ G U I functions as user programs provide GUI interface that contains the function has text, numeric, 2-d graphics, input devices, and a variety of window object.
Where the input device can be a keyboard, mouse or touch screen; two-dimensional graphics including pictures, lines, polygons, Park, ellipses, arcs, etc.; window objects include button, edit box, progress bar, checkbox, etc.C/μ G U I function libraries can be configured through GUIConf.h file, the configuration of content including the use of memory device, whether used window manager that supports the operating system, touch screen, configure dynamic memory size etc.
In LCDConf.h file defines and hardware-related attributes, such as LCD size, color, and LCD interface function.
While the LCD driver file is responsible for the μ C/G U I explain the various functions into LCDConf.h file defined LCD interface function, the file and is independent of specific hardware connections.C/μ G U I and LCD hardware interface through the driver file to hardware interface function into LCDConf.h LCD defined in read and write functions.
C/μ G U I transplant procedure:
1. profile of the transplantations
Porting work you first need to complete a profile of the transplantations GUIConf.h, LCDConf.h, according to the digital photo album system display module requirements, on the profile of the relevant parameters to be configured.
2.
LCD driver of the transplantationsC/μ G U I for different LCD controller provides a variety of drivers, such as KS0713, SEDl335, T6963, controller has a corresponding LCD driver.
However, because in this system, the use of display module for TOPWAY TCB8000A LCD controller and TFT, color, LCD screen 65000. While C/μ G U I failed to provide the relevant controller driver with C/μ G U I provide drivers support the LCD controller, TCB8000A controllers have their own independent screen control command system, μ G U I C/in the work of the transplantations TCB8000A controller created a serious difficulty.In the course of the transplantations, we first use the command system, TCB8000A for μ G U I C/to upper-level application functions provide most of the API function, then for TCB8000A controller cannot hardware support for API function, we use the software on the drive patched, finally adopted on a large number of controls to display test, adjust the LCD driver in the displayed order of TCB8000A parameters, making the LCD driver achieve optimal performance.
Ultimately, the μ C/G U I in TCB8000A seamless on the controller.3.
MRI image data access moduleSD card is a Secure Digital Card card ", literal translation into Chinese is" secure digital card ", by ribensongxiagongsi, Toshiba and SANDISK Corporation jointly develop the United States in the development of new storage card products.
SD memory card is a totally open standards (systems), used for MP3, digital cameras, digital cameras, electronic books, AV equipment, and so on, in particular are widely applied in thin digital cameras. SD card in a machine with MultiMedia Card card, MMC card size ratio slightly thick, capacity. And a compatible MMC card interface specification. In addition, the SD card to 9 pin, designed by the means of transmission, a serial into parallel to improve transmission speeds. It's read and write faster than MMC card faster, and at the same time, the security is also higher.In order to make the system even has a wide range of applications, compatibility, we decided to use the SD card as the main storage media to store our photos, music, footage, and other important data.
DE2 SD card device on 1 line, its speed was very restricted. We put the device changes to 4-line party-To make it more consistent with our system requirements.The Nios II integrated software development environment, includes the uc/os that can enable users to easily apply to your own software engineering, in order to better enable tasks jointly, sharing cpu, we use the uc/os operating system, and add a file system.
At first we use zlg file system, in a successful transplant, we tested his speed, speed unsatisfactory. In the sd card 1M data when you need to use respectively 37sec and 57sec. We analyzed it's time-consuming, on the one hand sd card read-write mode restrictions, standard DE2 Development Board, sd card using one read-write mode, the data line only 1 root, speed is a lot of restrictions, we modify its pattern to increase data cables for sd card read-write mode changed to 4 lines of sd mode, after the test, speed increase, namely 17sec and 27sec, but speed is not our imaginary fast to the original four times, this is because of — the file system, through the Internet and found that the performance of the zlg/fs is not high, wasted a lot of time, we decided to use the Micrium Uc/fs companies, he and uc/os has a very good compatibility, performance is gained public acclaim. After several weeks of work we succeeded in porting the uc/fs 1.34 version to de2 platform, to a four-line model of the sd card has set up the file system.After the comparison test, read and write speed has been greatly improved, 1M data read and write respectively when 3.6s and 11s only.
This basic meet our speed of accessing data files. But there are still write slow problem writing data to the sd card in each block are need to calculate the 16-bit CRC is taking part of the time, we chose to use a custom user instructions of how to speed up the CRC16 operation speed toward SD card write an MR image (about 1.5M) from 21.7S reduced to 15.8S. Selection of the more high speed SD card, you can effectively add block write speed of the card.SD mode timing
CLK: Host to card clock signal CMD: Bidirectional Command/Response signal DAT0 - DAT3: 4 Bidirectional data signals. VDD, VSS1, VSS2: Power and ground signals. 1-wire and 4-line differencesSingle Block Read
Single Block Write
4. network interfaces
DE1 does not have the functionality of the network interface, in order to enhance the scalability of the system, we designed a network interface board, through the expansion port connection DE1 connect, which allows the Development Board has network capabilities.
Taking into account the limited scale of IO, we also need to use IO connect LCD display, a choice of IO a relatively small number of dm9000a network chip. In the data, we are a Development Board for scheduled manner data on PC to query your data. Network use, send data with ucosII driver, your data is in the network layer 2 to interrupt mode.5. image processing algorithms:
Typical human spine 24 block presacral vertebrae (pre-sacral), its composition, the vertebra in the neck (Cervical) 7 blocks, thoracic vertebra (Thoracic) of 12 block, waist vertebra (Lumbar) 5 blocks.
So in our spinal sagittal map, the corresponding typical image visible disc 23 block, namely C2-C3-3, 4, 5, C4-C5-C6-6, 7, C7-T1, T1-T2-2, 3, 4, T3-T4-T5-5, 6, 7, T6-T7-T8-8, 9, 10, T9-T10-T11-11, 12, T12-L1, L1-L2-2, 3, 4, L3-L4-5, L5-S1.The goal of this algorithm is visible disc to quantify the flag and to clear disc predict estimated that it will be marked.
Algorithm-based uc/osII operating system written in c programming, plus we transplant ucgui and ucfs, achieved a good man-machine interactive spine MRI image segmentation system, easy-to-application of the system.Specific algorithm is divided into three steps:
(A) image pre-processing (Preprocessing): since the original magnetic resonance image contrast is relatively low, the Visual effect is very unclear, so first of all to the improvement of the quality of image, increase the visibility of the disc.
The following two graphs to compare before and after preprocessing.The steps in the image comparison of median filtering part time consuming, the good news is that part of the program is ideal for using c2h tools for algorithm acceleration, speed and time comparison is as follows:
After the pretreatment pretreatment
(B) the extraction of the spinal cord (Spinal Cord extraction): spinal cord in spine is in magnetic resonance images
An obvious typical section to provide for a disc of orientation direction information, applying statistical pattern recognition, pattern matching method for extraction of the spinal cord. Here we only for the upper body of the spinal cord of extraction, because the upper body of spinal curve changes from person to person, but the more complex of the lower body can make predictions based on the upper body.The lower left of the red line in the figure is extracted of the upper body of the spinal cord.
This part of the algorithm is relative to the other parts, but time-consuming from a structural point of view of the algorithm is not suitable for use to accelerate C2H, considering our algorithm will be further optimized, so there is no other way algorithm acceleration, we will in future work from algorithm structure and accelerate the realization of how perfect the system.Spinal disc positioning images extracted image
(C) disc detection (Disks Detection): on the position of each disc, and annotations.
See the upper figure, red dot represents the position of the disc, the yellow line leads to the callout.We use SOPC design idea, successful completion of this system of design tasks, completed the preset function.
In the system design process, SOPC concept in the following areas were reflected:A, the reconfiguration of the system
Since the Nios II is a soft core processor, with crop characteristics.
So we designed the system has a vast upgrade space, for example, because of the time, some suitable for FPGA hardware implementation of the algorithm we use c program implementation, speed limits, and in subsequent work, we can not change the hardware platform of the upgrade we; there is currently insufficient display pixel value, write different LCD controller will be compatible with the type of LCD display, these are SOPC gives us the advantage of system reconfiguration.B, the modular system design
System design is a team works closely with the practise of the process.
General design of embedded processor platforms must be for a specific processor design, hardware is completed before we can make software debugging. But different Nios, as long as it is able to support the Altera Nios FPGA chip, other FPGA platforms for debugging is no different. This can make the design process of software and hardware work simultaneously, in the actual product design process, you can market and product research and development at the start, reducing the availability of the entire product cycle, the enterprise will undoubtedly have immeasurable significance.C. implementation of diversification
Use SOPC design concept system, the system implementations are varied, for example, to implement an algorithm acceleration you can use custom user commands, custom user peripherals or C2H manner, by comparison to find the best implementation approach.
VI. design features
Based on the Nios II Image segmentation of MRI System with spine operation speed is fast, small, simple, easy-to-MRI with original equipment construction and form a new, complete system, and easy to use partition after doctors image for collective consultations.
1. Nios II processor based ucosII operating system introduced, ucosII worldwide a wide range of applications, including many other fields, such as mobile phones, routers, hubs, aircraft, medical devices, and so on.
UC/OS for small control system, has high efficiency, small footprint, real-time performance and scalability characteristics of strong, etc. Nios II development environments IDE has integrated with the operating system, eliminating the porting work, very convenient, in the course of using the Nios II found that running ucosII and tasks very stable. This system of software development are integrated in the Nios II c/o μ s-I I operating systems above.2. system introduces ucGUI, the system has a very good human-computer interaction, simply use the mouse to manipulate the system all of the features.
This is the system of promotion has been of great help.3. when considering the design of the system to a large number of MRI image storage problems, the use of large-capacity SD cards will solve this problem, benefited from the Nios processor advantage, we are very easy to join the four line of SD card controller, improves the read speed sd cards.
At the same time we transplanted corresponds to sd card ucFS file system, greatly facilitates access to the file.4. the network operating system based on ucosII interface which enables our system has a very strong scalability.
At the same time, network support can also make it possible for us to keep the image updates and remote medical good support.5.
Nios II provides a range of processors, users can address the needs of their own system, create a processor, peripherals, memory and i/o interfaces of the perfect scenario, this will provide a reasonable combination of performance, on the other hand, it also saves system development cost, enhance system cost competitiveness.6.
N I o s C2H compiler Ⅱ provides the ability to require a higher level of performance of the C language program automatically converted to a hardware accelerator, integrated into FPGA-based N I o s Ⅱ subsystem, we improve system speed provides favourable support.VII. Summary
Our contest's design works "based on the Nios II Image segmentation of MRI System" spine on schedule to complete the design of all tasks, and implement the functionality of the system, in some fine
Festival we also need to improve. Competition process we learned a lot new for Nios II processor support, first try the medical image aspects of algorithm in Nios II embedded processors, Nios II processor embodies a powerful processing capabilities and reliable performance. Accumulated in the Nios II on uc/osII, use ucGUI, ucFS experience. In the process of debugging, there's a lot of problems in the power of teamwork, we overcome them one by one.Nios-system performance can be carried out according to the application of the reduction, customize the user's own system, compared with fixed processor, has a strong advantage.
Nios II user logic functions and user instructions emergent Nios II processor technical highlights, provides the system implementation of diverse characteristics. For the students of the SOPC design concept is innovative design ideas. To stimulate our creativity.Thanks for Altera Corporation gives us a very good combination of theory and implementation time, through the competition, having verified that we designed algorithm implementation feasibility! for our theoretical research also has a significant role in promoting.
No comments:
Post a Comment