DICOM Medical Image processing: A preliminary discussion on WEB PACs

Source: Internet
Author: User
Tags ftp file

background:

At the weekend, I saw an article from my former colleague, speaking about the PACS system under the new Internet situation. Just the last column also mentioned the impulse to build a worklist server, so the search for the original student time to build the simple Web PACs found out, through the opportunity to build again to learn about Web PACs related technologies, such as Wado standards, Techniques such as CGI or fastcgi.

on WEB PACs technology:

WEB PACs is a PACS system that can query and obtain DICOM objects freely by using Internet technology, which spans hospitals and geographical limits. There are two common ways: the first is to provide the query location through the Web server, return the address and path corresponding to the DICOM image Storage server (usually FTP), and the client to request the object from the DICOM image storage server, and the second is to provide the query and return request object uniformly through the Web server. Both have pros and cons, the first through the deployment of the Web server and FTP file server, reduce the burden of the Web server, speed up the response time, but there are many shortcomings of the scheme, such as the need to send two requests for images, FTP server security maintenance cost is high, Requires the browser to download can parse Dicom image plug-ins and so on; the second Web server consolidates the query and return, removes the FTP server, the deployment is convenient, its disadvantage is that the data returned by the Web server is the real DCM converted BMP or JPEG files, Therefore, some operations that rely on other information of dicom files (such as window width adjustment) need to re-request the service side, require updating the data, so the processing power of the server is more expensive, the bandwidth also has certain requirements.

Two ways are as follows:

(from the literature "DICOM Wado Principles and Applied research")

1) WADO

WADO (Web Access to dicom persistent Object) is part of the DICOM standard, Provides a mechanism for accessing and reproducing Dicom objects from an HTML page or XML document through an HTTP or HTTPS protocol and using DICOM identifiers to address access to dicom objects in an Internet environment-which can also be considered the ultimate goal of Web PACs. As with the standard HTTP or HTTPS-based network access, the user enters the URL in the browser address bar, sends a Web request to the server, and the server receives the request based on the parameters provided in the URL, and locates the requested image or report back to the browser on the service side. as follows (excerpted from chapter 18th of the DICOM standard),

In fact, the Wado standard is to define the client and server interaction between the rules, you can simply understand the two-way interaction when the parameters of the contract, that is, the server can be based on the browser to send different parameters to achieve common single-version PACs c-find, C-move, C-Store and other functions. The introduction of the Wado part of the DICOM standard is also mainly a description of various parameter rules, as well as some URL instances, here to intercept a simple explanation:

As shown, URLs use common get methods to send queries from traditional PACS system clients to the server, such as Studyuid, Seriesuid, and Objectuid (which is actually the SOP Instance UID in DICOM images).

2) CGI

CGI (Common Gateway Interface) is one of the most important technologies in WWW technology and has irreplaceable important position. CGI defines an interface standard between an external application (CGI program) and a Web server, independent of the development language, giving the user a way to request data from a Web browser to a program executing on the server-providing a way to implement Web PACs.

To understand the meaning of CGI, it is necessary to know the front-end and back-end that are common in web development. The front end is the Web application in the user can see the touch of things, the server receives the request after the most direct data transfer to the browser, the backend is more than the user could not see (this refers to the results can not be seen in the operation, but the operation of the process to see), received the request after the service to further operations, such as querying the database, algorithm operations and so on. CGI is the standard for implementing programs that are triggered by browser input to run on a Web server.

actual environment Construction:

As mentioned in the first section of the blog post, because the first type of Web PACs requires a browser to install a third-party plug-in, the FTP server needs to be deployed separately, so this scenario was not adopted at first. The second Web PACS service side sends requests to the image server after accepting requests, which is a good scenario for the CGI technology mentioned above. Here is a detailed description of how to build a CGI application environment:

1) wampserver+fastcgi Web Server Setup:

Wampserver installation package download http://www.wampserver.com/en/#wampserver -64-bits-php-5-5

You may encounter a " missing Msvcr110.dll, program cannot start " error during installation, and you can refer to http://jingyan.baidu.com/article/ The workaround given in ed2a5d1f3303d709f7be1776.html is to be reminded of the download of Visual C + + redistributable for VisualStudio Update The 4 version is not determined by the computer's operating system type (32-bit or64 bit), but should be selected based on the type of Wampserver installation package. After you install Visual C + + redistributable for VisualStudio Update 4, you need to reinstall Wampserver.

Configure the FASTCGI environment:

Refer to http://www.admin10000.com/Document/53.html and http://my.oschina.net/Twitter/blog/210044 to configure the Apache server. Restart Wampserver After the configuration is complete failed, the following error occurred:

It is even more tragic to see Apache errorlog unexpectedly without a hint, So can only modify the httpd.conf configuration file line-by-row troubleshooting, through the line of comments on the method finally found the problem, due to modify directoryindex caused by errors, restore to the original order, restart Wampserver unexpectedly successful, small have a sense of accomplishment, as for the specific reasons for follow-up in slow Slow find, OK to add up.

2) C-language CGI instance

After configuring the development environment, give a simple test, because the computer does not have PHP installed, so here flattering, directly using Apache's own CGI to invoke the C language Development program, about the C language CGI configuration is relatively simple, The CGI module is already included in modules in the Apache directory, just specify the directory c-cgi run in the httpd.conf configuration file and add the following code:

scriptalias/cgi-bin/"c:/wamp/www/c-cgi/" AddHandler cgi-script. exe. pl. cgi<directory "c:/wamp/www/c-cgi/" > Options Indexes followsymlinks execcgiallowoverride allorder allow,denyallow from Allrequire local</directory>
The specific configuration can refer to the http://blog.sina.com.cn/s/blog_66ec4d660100rd2h.html, the example of the case should not be used in the blog, using the complete example I gave below.

Get method Instance source code

#include <stdio.h> #include <stdlib.h>int main (void) {char *data;        Char a[10],b[10];        printf ("content-type:text/html\n\n");        printf ("Use the VS compiled executable as Gettest.exe and put it in the/www/cgitest-c directory.

Post Method Instance source code

#include <stdio.h> #include <stdlib.h>int main (void) {int len;        Char *lenstr,poststr[20];        Char m[10],n[10];        printf ("content-type:text/html\n\n");        printf ("Use the VS compiled executable as Posttest.exe, and put it in the/www/cgitest-c directory as well.

Test Web page source code

To the Apache server root directory, which can be accessed via localhost/cgitest-c.html in the browser.

actual running Results

The above is a simple calculation to demonstrate the CGI technology implementation and development process, of course, for the simple digital computing web front-end itself, just to illustrate the CGI process. At this point the entire Web PACs Web server has been built almost, using CGI or fastcgi we can use the service side of the other language development program to achieve the function we want, then the subsequent work with the development of the C/s mode of PACs, in C + +, C # or high-level languages such as Java to develop PACs service-related programs for the Web server to invoke. This blog post demonstrates the invocation of an EXE executable, which is risky, and I'll introduce a more secure way to make use of PHP in fastcgi mode to invoke C + + or C # or Java dynamic libraries.

DICOM Medical Image processing: A preliminary discussion on WEB PACs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.