DICOM:DCMTK Toolkit Analysis of Dcmqrscp.exe, Dcmqridx.exe, Dcmqrti.exe

Source: Internet
Author: User

background:

As the new year begins, the column will persist and continue to interact with you and learn from each other. This post again analyzes DCMTK's own toolkit Dcmqrscp.exe (similar to a standalone version of Minipacs), the main focus of the Dcmqrscp.exe database section, by using Dcmqridx.exe manual operation Dcmqrscp.exe Database files, intuitive understanding of the data Library, and then use Dcmqrti.exe to query the Dcmqrscp.exe database file to learn how to manipulate the Dcmqrscp.exe database.

Standalone Database:

A stand-alone database is a database that only runs on a single machine and does not provide network functionality. such as access, FORPRO, etc. are single-machine database (from Baidu Encyclopedia "stand-Alone database") in fact, there are many types of single-machine database, analyzed Orthanc database--sqlite years ago, and the forthcoming analysis of the Index.dat file, in addition to even Firebird, Derby, HSQL, PostgreSQL, javadb, H2 and so on.

The purpose of using a database (whether standalone or online) is to minimize data redundancy, improve data utilization, maintain data integrity and consistency, and data usage efficiency. No matter what kind of database system, its database file can be considered as a collection of records with the same nature, more broadly speaking, our common XML, JSON, INI and other configuration files are also a standalone version of the database.

Index.dat:

Originally thought that index.dat may be a similar to XML, JSON and other common format of the standard file, the search for the description of Baidu Encyclopedia "in the Microsoft Windows operating system, Index.dat is a file created by Internet Explorer and Resource Manager. This file functions like a database, which is launched with the system. Its function is to collect personal information, like URLs, search strings and recently opened files. Its responsibility is like the index in the database. " So here's a blog post that Index.dat as a custom index database file in DCMTK that is used to record related information, primarily for Dcmqrscp.exe, Dcmqridx.exe, Dcmqrti.exe, and other toolkits.

The following will analyze the Index.dat database files by analyzing and actually using the Dcmqrscp.exe, Dcmqridx.exe, and Dcmqrti.exe toolkits.

Dcmqrscp.exe Operation:

The relevant introduction to Dcmqrscp.exe refer to the previous post Dicom medical image processing: PACs debugging of DCMTK wiki data learning.

Dcmqridx.exe Operation:

The previous post's introduction to Dcmqrscp.exe focused on DIMSE services, such as C-echo, C-find, C-Store, c-move, etc., without mentioning the internal Database section. Since DCMQRSCP is able to respond to c-find requests, it naturally implements database functions to store related records for C-Store uploads.

Re-view DCMTK official documentation, you can also find Dcmqridx, DCMQRSCP, Dcmqrti three tools belong to the Dcmqrdb module, DCMTK document called an image database server.


If you look at the source of the Dcmqrscp.exe Toolkit again, it will be found that before the formal processing of the link request, the database-related operations, the code is as follows:

#ifdef with_sql_database    //Use SQL DATABASE    dcmqueryretrievesqldatabasehandlefactory factory; #else    // Use linear Index Database (index.dat)    dcmqueryretrieveindexdatabasehandlefactory Factory (&config); #endif    dcmqueryretrievescp SCP (config, options, factory);    Scp.setdatabaseflags (Opt_checkfindidentifier, opt_checkmoveidentifier);    /* Loop waiting for associations */    while (Cond.good ())    {      cond = scp.waitforassociation (options.net_);      if (!options.singleprocess_) Scp.cleanchildren ();  /* Clean up any child processes    *    /} cond = Asc_dropnetwork (&options.net_);    if (Cond.bad ()) {      oflog_fatal (Dcmqrscplogger, "Cannot drop network:" << dimsecondition::d UMP (TEMP_STR, cond ));      return ten;    }

Since the current DCMTK has not yet implemented Dcmqueryretrievesqldatabasehandle related classes, Therefore, the Dcmqrscp.exe Toolkit in the Windows system uses Dcmqueryretrievedatabaseindexdatabasehandle, which is the index.dat corresponding index database.

View the Dcmqueryretrieveindexdatabasehandle class definition, which contains the database handle, type Db_privatehandle, which is a struct, defined as follows:

struct db_private_handle{    int pidx;    Db_elementlist *findrequestlist;    Db_elementlist *findresponselist;    Db_level Querylevel;    Char indexfilename[dbc_maxstring+1];    Char storagearea[dbc_maxstring+1];    Long Maxbytesperstudy;    Long maxstudiesallowed;    int idxcounter;    Db_counterlist *movecounterlist;    int numberremainoperations;    Db_query_class Rootlevel;    Db_uidlist *uidlist;    Db_private_handle ()    : Pidx (0),    findrequestlist (null)    , findresponselist (null)    , Querylevel ( Study_level)//  , Indexfilename ()//  , Storagearea ()    , Maxbytesperstudy (0)    , maxstudiesallowed (0 )    , Idxcounter (0)    , movecounterlist (NULL)    , numberremainoperations (0)    , Rootlevel (study_root)    , Uidlist (NULL)    {    }};

From its constructor can be determined that the PIDX record is the descriptor of the Index.dat file, similar to the file handle, Indexfilename records the full path of the Index.dat database file, Storagearea is recorded in dcmqrscp.cfg configuration file in aetable section Given with Storagearea (described in the Dcmqrcnf.txt file, the Application Entity table section can be set differently for different AE storage area, Therefore, after starting Dcmqrscp.exe, multiple Index.dat database files may be generated for recording different AE operations separately.

After a rough look at the data operations of Dcmqrscp.exe, let's actually test the same dcmqrscp.cfg profile as the Dcmqrscp.exe Toolkit test, with a path of D:\DCMSCUSCP,

Enter the following command:

CD D:\DCMSCUSCP, At this point you can notice that there is a Index.dat file that was generated when the Dcmqrscp.exe tool was used in this path, and here we remove it to make sure that the Index.dat file does not exist in the current directory for a clearer description of the Index.dat record operation.

dcmqridx.exe–d d:\DcmScuScp\ c:\test1.dcm, in order to learn more information, we use the debug state, add-D parameter.


From the output of the results we can roughly guess, Index.dat file should be listed in the various information, then we open the D:\DCMSCUSCP directory, using Ultriedit to open the newly generated Index.dat file, the contents are as follows:


Drag the ruler to the back half of the file to discover various information about the Dcmqridx.exe debug state output, such as Studydate, Studytime, Seriesnumber, Instancenumber, modality, Seriesinstanceuid, Sopinstanceuid and so on, It can be seen that the Index.dat database file is a uniform format for each DCM file related information, including the DICOM common relational database in the four-level structure required for all the information. Of course index.dat is not for each DCM file information is simply appended to the end of the file, such as the addition of TEST1.DCM files Index.dat file size of about 48k, and then add test2.dcm file index index.dat file size changed to 52k.

Dcmqrti.exe Operation:

Knowing the basic structure of index.dat and how to manually add records to the Index.dat data file, how do we see the records in the Index.dat data file? DAT file is not a uniform standard format, we can not accurately parse the Index.dat file before we get the specific protocol, but fortunately DCMTK has provided us with a tool that is dcmqrti.exe.

The official website describes the Dcmqrti.exe as follows:

The Dcmqrti program (telnet initiator) is a interactive character based program intended to being used for examining the DCM QRSCP image databases and sending images contained within these databases to Vendor nodes.

--dcmqrti is an interactive tool for detecting DCMQRSCP image databases, or Index.dat, and can also send images recorded in Index.dat to other dicom terminals that need to be in the DCMQRSCP.CFG host Registered in the table).

Here we carry out the actual test:

Enter Dcmqrti.exe to see a brief introduction to the toolkit's use, such as left:


The only parameter that the Dcmqrti tool must have is the vendor node that is registered in the Dcmqrscp.cfg configuration file Vendor table. Blog post dicom medical image processing: DCMTK wiki Data Learning PACs the vendor in the Debug configuration file is Acmectcompany, which contains all the nodes in the host table, the host The node in table is the node information of each client that usually needs to be configured in the PACS system, namely Aetitle, IP, Port. Enter the following command to see the results on the right

Dcmqrti.exe Acmectcompany

At this point the command prompt changes to Acme_store->acme1>, where Acme_store is the local storage set in the Aetable section of the dcmqrscp.cfg configuration file title,acme1 is an AE set in the host table Title (the Dcmqrt.exe tool selects the first node in the host table by default). We enter the control state of the DCMQRSCP database Index.dat.

Enter Help now, as shown below:

We're going to test the above instructions one by one,

1) Title View/Set Current AE

Input:title

You can see all the host nodes in the Host table section of the dcmqrscp.cfg configuration file, with the asterisk as the current default, which is ACME1

Input:Title 1

You can see that the command prompt becomes acme_store->acme2>, indicating that the aetitle of the current host node becomes ACME2

2) database view/set current databases

Input:database

You can see the title of the local store in the aetable section of the dcmqrscp.cfg configuration file, because only one storage area, Acme_store, is specified in this configuration file, and the storage path is D:\DCMSCUSCP. Therefore, only one Index.dat file is generated.

3) Study/series/image View database related information

Enter the study, series, and image instructions separately to view information about the DCM that you just registered manually via Dcmqridx.exe, as shown in:

4) Send the data in the database

For convenience only, send image is sent to the specified node using the test1.dcm file just uploaded.

Re-open a command-line program, open the C-Store SCP service, enter:storescp.exe–d 11110–aet ACME2

STORESCP the parameters here are filled in according to the host table portion of the dcmqrscp.cfg configuration file, and for easy viewing, the Dcmqrscp.cfg configuration file is as follows:


In the Dcmqrti.exe client input:send image, the exact result is as shown:


Go to the Dcmdata directory and you can see the DCM image being successfully received, such as:

Then enter quit or exit to successfully exit the Dcmqrti.exe control state.


Now for the Dcmqrscp.exe in DCMTK, The introduction of the Dcmqridx.exe and Dcmqrti.exe Toolkit is over, and this personal test provides a general understanding of how the data is stored in the DCMQRSCP tool and the database file Index.dat used, and on the basis of the previous blog post, the dcmqrscp.cfg configuration text A further understanding of the parameters of the piece, followed by further detailed research, try to replace the default index database in the Dcmqrscp.exe tool, instead of using SQLite or MySQL, please look forward to ...


Follow-Up blog introduction:

Using fo-dicom to build a simple PACs server service side

Replace the database in the Dcmqrscp.exe toolkit



[email protected]

time: 2015-01-11

/blockquote>

DICOM:DCMTK Kit Analysis Dcmqrscp.exe, Dcmqridx.exe, Dcmqrti.exe

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.