DICOM: dcmqrscp.exe1_dcmqridx.exe1_dcmqrti.exe, dicomdcmtk

Source: Internet
Author: User

DICOM: dcmqrscp.exe1_dcmqridx.exe1_dcmqrti.exe, dicomdcmtk

At the beginning of the new year, the column will continue to communicate and learn from each other. Slave database.

Standalone version database:

A standalone version of a database can only run on a single machine and does not provide network functions. For example, ACCESS and FORPRO are all standalone databases (from Baidu Encyclopedia "Standalone Database"). In fact, there are many types of standalone databases. I analyzed Orthanc database a year ago-SQLite, and the index to be analyzed this time. dat files, in addition to FireBird, Derby, HSql, PostgreSQL, JavaDB, H2, and so on.

The purpose of using databases (both on-premise and online) is to minimize data redundancy, improve data utilization, maintain data integrity and consistency, and improve data usage efficiency. Regardless of which database system, the database files it creates can be considered as a set of records of the same nature. In a broader sense, common configuration files such as xml, json, and ini are also standalone databases.

Index. dat:

Originally thought index. dat may be a standard file similar to common formats such as xml and json. After searching for the description in Baidu encyclopedia, "in Microsoft windows operating system, index. dat is a file created by Internet Explorer and resource manager. This file function is like a database, started with the system. It is used to collect personal information, such as URLs, search strings, and recently opened files. Its role is like Indexing in a database ". And other tool kits.

The following section uses dcmqrscp.exe1_dcmqridx.exeand dcmqrti.exe to analyze the index. dat database file.

Dcmqrscp.exe operation:

For more information about dcmqrscp.exe, see the previous blog DICOM medical image processing: DCMTK wiki data learning-PACS debugging.

Dcmqridx.exe operation:

The introduction of dcmqrscp.exe focuses on DIMSE services, such as C-ECHO, C-FIND, C-STORE, C-MOVE, etc., without referring to the internal database section. Since dcmqrscp can respond to C-FIND requests, it naturally implements the database function internally to store records related to C-STORE uploads.

Review the DCMTK official documentation. You can also find that the dcmqridx, dcmqrscp, and dcmqrttools belong to the same dcmqrdb module. The DCMTK document is called an image database server.

If you look at the source code of the dcmqrscp.exe toolkit, you will find that database-related operations are performed before the link request is formally processed. The specific 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::dump(temp_str, cond));      return 10;    }

Because dcmtkhas not yet implemented dcmqueryretrievesqldatabasehandlerelated classes, the dcmqrscp.exe toolkit in Windows uses DcmQueryRetrieveDatabaseIndexDatabaseHandle, which is the index database corresponding to index. dat.

View the dcmqueryretrievdexdexdatabasehandle class definition, which contains the database handle, type: DB_PrivateHandle, which is a struct. The specific definition is 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)    {    }};

The inventory file specifies that different storage areacan be set for different AE in the Application Entity Table section. Because of this, after dcmqrscp.exe is started, multiple index. dat database files may be generated to record operations of different AE respectively)

After resolving the data operation of dcmqrscp.exe, Let's test the problem and share the same dcmqrscp. cfg configuration file with the dcmqrscp.exe toolkit. The path is d: \ DcmScuScp,

Enter the following command:

Cd d: \ dcmscuscp. you can upload the index generated when you used the dcmqrscp.exe tool. dat file. Here we want to make it clearer. delete the dat record operation to ensure that the index does not exist in the current directory. dat file.

Dcmqridx.exe-d: \ DcmScuScp \ c: \ test1.dcm. For more information, we use the debug status and add the-d parameter.

From the output results, we can roughly guess the index. in the dat file, we should record all the information listed in. However, we open the D: \ DcmScuScp directory and use UltriEdit to open the newly generated index. the content of the dat file is as follows:

Drag the scale to the second half of the file to find information about the dcmqridx.exe debug status output, such as StudyDate, StudyTime, SeriesNumber, InstanceNumber, Modality, SeriesInstanceUID, SOPInstanceUID, and so on. the dat database file records the related information of each dcm file in a unified format, including all the information required for the level-4 Structure in common DICOM relational databases. Of course index. dat does not simply append the information of each dcm file at the end of the file. For example, after adding the test1.dcm file, index is used. the dat file size is about 48 KB, and the index is added after the index of the test2.dcm file. the size of the dat file is 52 kb.

Dcmqrti.exe operation:

After learning about the basic structure of index. dat and how to manually add records to the index. dat data file, how can we view the records in the index. dat data file? .

Dcmqrti.exe is described as follows:

The dcmqrrprogram (telnet initiator) is an interactive character based program intended to be used for examining the dcmqrscp image databases and sending images contained within these databases to Vendor nodes.

-- Dcmqrtis used to detect the dcmqrscp image database, that is, index. dat, an interactive tool, you can also index. the images recorded in dat are sent to other DICOM terminals (this terminal must be in dcmqrscp. cfg ).

The following is an actual test:

Enter dcmqrti.exe to see a brief introduction to the use of this toolkit, for example, on the left:

The only parameter required by the dcmqrttool is in dcmqrscp. cfg configuration file: Vendor node registered in the vendor Table, Bowen DICOM medical image processing: DCMTK wiki data learning-in PACS debugging configuration file, vendor is acmeCTcompany, the vendor contains all the nodes in the Host Table. the nodes in the Host Table are the node information of each client that needs to be configured in the PACS system, that is, AETitle, IP, and Port. Enter the following command to view the result on the right.

Dcmqrti.exe acmeCTcompany

At this moment, the command prompt is changed to ACME_STORE-> ACME1>, where ACME_STORE is dcmqrscp. the local storage Title set in the AETable section of the cfg configuration file. ACME1 is an AE Title(dcmqrt.exe tool set in the Host Table by default, the first node in the Host Table ). It indicates that we enter the control status of index. dat in the dcmqrscp database.

Enter help as follows:

Next we will test the preceding commands one by one,

1) view/set the current AE

Input: title

You can see all the Host nodes in the Host Table section in the dcmqrscp. cfg configuration file. The asterisks are the current default, that is, ACME1.

Input: title 1

You can see that the command prompt is changedACME_STORE-> ACME2>Indicates that the AETitle of the current host node is changed to ACME2.

2) view/set the current database

Input: database

You can see dcmqrscp. the local storage Title set in the AETable part of the cfg configuration file. Because this configuration file only specifies a storage region named ACME_STORE, the storage path is d: \ DcmScuScp, therefore, only one index is generated. dat file.

3) study/series/image: view database information

Input the studypolicseries、imagecommand to obtain the information about the dcm manually registered by dcmqridx.exe, as shown in:

4) send the data in the database

For convenience, send image to send the uploaded test1.dcm file to the specified node.

Restart a command line program, enable the C-STORE SCP service, and enter: storescp.exe-d 11110-aet ACME2

Storescp parameters here are filled in according to the Host Table section in the dcmqrscp. cfg configuration file. For convenience, the dcmqrscp. cfg configuration file is as follows:

On the dcmqrti.exe client, enter "send image". The specific result is as follows:

Go to the DcmData directory and you can see that the dcm image is successfully received, for example:

Then, enter quitor exitto return the dcmqrti.exe control status.

The default index database method in the indexing tool is sqlite or mysql. Please wait ......

Follow-up blog introduction:

Use fo-dicom to build a simple PACS Server

Replace the database in the dcmqrscp.exe Toolkit

By zssure@163.com


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.