Summary
When using the DCMTK database to write query and retrieve, the definition of the query condition is not very clear. What is the difference between the DICOM query and the SELECT statement of the database?
Query is C-find, and retrieve is C-move. It is the most popular command in radiology imaging devices and systems, compared with C-sore, c-find/C-move is complicated .....
Query/retrieve simplified sequence diagram (only one C-Move-RSP round)
For SCU (initiator)
In general, query refers to sending the information of a certain level (patient/study/series/image) to the target system. Of course, you can also perform Association queries to ask the other party to return all levels of information to themselves.
Retrieve means that after SCU obtains the information through the query, it requires the other party to send the image to itself based on the Request level (patient/study/series/image.
For SCP (Service Provider)
Various levels of services are required for SCU query/retrieve.
C-find/C-move has several important concepts
One is the information model ),
Patient Root
Study Root
Patientstudy Root
Level 1 (query/retrieve level)
Patient level, study level, Series level, image level
Patient root can have four levels including patient level
Study root has only three levels. Study root cannot have Q/R patient level information and images.
C-find
To query a group or a group of patient/study/series/Image Based on a condition, you must query one or more key values and tell the other party what to return, how to differentiate each group of data. The query key, Return key and unique key defined in DICOM.
Unique key is patient id, study instance uid, Series instance uid, sop instance uid.
The query key has different values for each level. common values include check-level studydate and sequence-level modality. For details, see DICOM and IHE.
The unique key must be in the returned column; otherwise, SCU cannot distinguish each group of data.
Some Q/r scp support associated queries, and SCU can obtain series based on the query key of study level.
C-move is relatively simple
Before sending a request to SCU, start a storage SCP to receive images,
Reads the unique key based on the returned result of C-find,
Patient Root
Patient level patient id
Study level patient id, study instance uid
Series level patient id, study instance uid, Series instance uid
Image level patient id, study instance uid, Series instance uid, sop instance uid
Study Root
Study level study instance uid
Series level study instance uid, Series instance uid
Image level study instance uid, Series instance uid, sop instance uid
Each level, itself and the unique key of the previous level must be provided as the query key.
Another concept in C-move is retrieve destination AE. In general, it is to tell the recipient where the image should be sent. For SCU, it can usually send it to itself or to another AE (or even another machine or system ). This is also the difference between C-Move and C-Get. C-Get can only be sent to the other party.
Q/r scu tells the Peer (Q/r scp) unique key and retrieve destination. SCP gets the IP address and port registered on the SCP side by parsing retrieve destination AE title, send the image to the storage SCP and send C-Move-RSP to Q/r scu. after the image is sent, the actual statistical result is sent to Q/r scu.
Let's define a simple query:
// Fill the query object dcxobj = new dcxobj (); dcxelm El = new dcxelm (); El. init (INT) dicom_tags_enum.queryretrievelevel); El. value = "patient"; obj. insertelement (EL); El. init (0x00100010); El. value = "R *"; obj. insertelement (EL); El. init (0x00100020); obj. insertelement (EL); El. init (INT) dicom_tags_enum.patientssex); obj. insertelement (EL); El. init (INT) dicom_tags_enum.patientsbirthdate); obj. insertelement (EL );
The corresponding SQL statement is:
Select [Patient name], [patient id], [patient sex], [patient birth data] From patientwhere [Patient name] Like "R %"
The following figure shows study-level instances.
|
// Fill the query object
Dcxobj OBJ = new dcxobj ();
Dcxelm El = new dcxelm (); |
|
|
El. INIT (INT) dicom_tags_enum.studyinstanceuid );
OBJ. insertelement (EL ); |
Select
[Study instance uid], |
|
El. INIT (INT) dicom_tags_enum.studydate );
OBJ. insertelement (EL ); |
[Study date], |
|
El. INIT (INT) dicom_tags_enum.studydescription );
OBJ. insertelement (EL ); |
[Study description], |
|
El. INIT (INT) dicom_tags_enum.modalitiesinstudy );
OBJ. insertelement (EL ); |
[Modalities in Study] |
|
El. INIT (INT) dicom_tags_enum.queryretrievelevel );
El. value = "study ";
OBJ. insertelement (EL ); |
From Study |
|
El. INIT (INT) dicom_tags_enum.patientname );
El. value = "reimond ^ Golda ";
OBJ. insertelement (EL ); |
Where
[Patient name] = 'reimond ^ Golda' |
|
El. INIT (INT) dicom_tags_enum.patientid );
El. value = "123456789 ";
OBJ. insertelement (EL ); |
And
[Patient id] = '000000' |
The above example is equivalent
Select [Patient name], [patient id], [Study instance uid], [study date], [Study description], [modalities in study] From studywhere [Patient name] = 'reimond ^ Golda 'and [patient id] = '2016'
The following table is the reference table for where.
|
Symbol |
Meaning |
Equivalent to SQL |
|
* |
Zero or more characters, n characters in short. |
Where patient name like "Cohen %" |
|
? |
One character |
"COH? N "can match" Cohen "and" Cohan "and the" coh n"
I do not recommend using this |
|
- |
Description of time and date
From-To Format
YYYYMMDD-YYYYMMDD |
Where study date between 19950101 and 20110911 |
|
Yyyymmdd- |
Where study date >=19950101 |
|
-Yyyymmdd |
Where study data <= 20110911 |
|
\ |
Value that meets the condition
Localizer \ axial |
Where image type in ('localizer', 'axial ') |
The following figure shows the query level.
The following is a model to verify the query level.
|
UID |
Name |
Query levels |
Comment |
|
1.2.840.10008.5.1.4.1.2.1.1 |
Patient Root query/Retrieve Information Model-find |
Patient
Study
Series
Image |
Use it! |
|
1.2.840.10008.5.1.4.1.2.1.2 |
Patient Root query/Retrieve Information Model-move |
Patient
Study
Series
Image |
Use it! |
|
1.2.840.10008.5.1.4.1.2.2.1 |
Study Root query/Retrieve Information Model-find |
Study
Series
Image |
Use it if patient root doesn't work for you |
|
1.2.840.10008.5.1.4.1.2.2.2 |
Study Root query/Retrieve Information Model-move |
Study
Series
Image |
Use it if patient root doesn't work for you |
|
1.2.840.10008.5.1.4.1.2.3.1 |
Patient/study only query/Retrieve Information Model-find (retired) |
Patient
Study |
Don't use |
|
1.2.840.10008.5.1.4.1.2.3.2 |
Patient/study only query/Retrieve Information Model-move (retired) |
Patient
Study |
Don't use |
References
1. http://dicomiseasy.blogspot.com/2012/01/dicom-queryretrieve-part-i.html
2. http://blog.csdn.net/lucky2all/article/details/3307753
You are welcome to participate in the discussion. If you find it helpful, please clickRecommended. Thank you very much.
Author: Spring Yang
Source: http://www.cnblogs.com/springyangwc/
The copyright of this article is shared by the author and the blog. You are welcome to repost this article, but you must keep this statement without the author's consent andArticleThe original text connection is clearly displayed on the page. Otherwise, the legal liability is retained.