findscu ID Study Problems

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

findscu ID Study Problems

#1 Post by focus »

Hello!

I have some problems with de findscu, I define that I want to search the next fields

(0008,0052) CS [STUDY] # QueryRetrieveLevel
(0020,0010) SH [] # Study ID
(0008,0060) VR [] # Study Modality

The problems is when I define that I want to search the Study Modality, when I execute findscu It gets me the next message

(0000,0902) LO [Query was formatted improperly. Check required keys] # 52, 1 ErrorComment
findscu: Association Release Failed:
0006:0316 DUL P-Data PDU arrived


I supose that I'm doing something wrong when I define the study modality! Which is the mistake ? How can I get the study modality without errors?

Thanks for you help in advance

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#2 Post by Thomas Wilkens »

I suppose you are using the patient root information model (option -P in findscu)? If that is the case, here is my answer:

The patient root information model has 4 hierarchy levels: Patient (highest level) - Study - Series - Image (lowest level). In order to be able to query on a certain lower level, you need to specify the unique keys of all higher levels. I.e. if you are querying on study level, you will have to provide a certain PatientID (0010,0020), if you are querying on series level, you will have to provide a certain PatientID (0010,0020) and a certain StudyInstanceUID (0020,000d), and if you are querying on image level, you will have to provide a certain PatientID (0010,0020), a certain StudyInstanceUID (0020,000d) and a certain SeriesInstanceUID (0020,000e) in your query.

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#3 Post by focus »

[quote="Thomas Wilkens"]I suppose you are using the patient root information model (option -P in findscu)? If that is the case, here is my answer:

No I'm using the -S option for a study, here you have an example code that I use for a specific pateint. Of coure the patient exists

(0008,0052) CS [STUDY] # QueryRetrieveLevel
(0010,0020) LO [682706]
(0020,0010) SH [] # Study ID
(0008,0060) CS [] # Study Modality


When I put the Study Modality I get the Message Error

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianImplicit
(0000,0902) LO [Query was formatted improperly. Check required keys] # 52, 1 ErrorComment
findscu: Association Release Failed:
0006:0316 DUL P-Data PDU arrived

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#4 Post by focus »

I have seen that I get the same error if i try to retrieve the SerieInstanceUID, I supose that I'm doing something wrong .

(0008,0052) CS [STUDY] # QueryRetrieveLevel
(0010,0020) LO [682706]
(0020,0010) SH [] # Study ID
(0020,000d) UI [] # Study UID
(0020,000e) UI [] # Series UID


And I execute findscu :

findscu -S 127.0.0.1 10004 -aet PACS -aec PACS busca2.dcm

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#5 Post by Thomas Wilkens »

Look in the DICOM standard part 4, table C.6-5. The table shows all attributes which can be used for a query on the study level in the study root information model. One of the is the unique key (U) for this level, some of them are required keys (R) and some of them are optional (O). Unique and required keys have to be supported by an archive, optional keys may be supported by an archive. The problem is that attribute Modality (0008,0060) does not appear in this table, so it cannot be used in your query.

Section C.6.2.1.3 in this document says that the attributes on the series level in the study root information model are the same as the attributes on the series level in the patient root information model. The attributes on the series level in the patient root information model are shown in table C.6-3. Attribute Modality (0008,0060) is included in this table, so you can use this attribute for a query on the series level.

So the answer to your problem is: If you want to query attribute Modality, you have to query on the series level, not on the study level.

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

Another doubt

#6 Post by focus »

Thomas I have try to do this in the series level

With the series level I can retrieve the modality, but when I try to retrieve the study date, gets a me a an error, gets "check required keys" message. I can't understand why with the series level I can't retrive the Date of the study, I have tried too with the time study, study ID, and I can't retrieve them, If I use the study level I can retrieve them, but then I can't retrieve the Modality.

And example code is this

(0008,0052) CS [SERIES]
(0008,0020) DA[]
(0010,0010) PN []
(0010,0020) LO []
(0020,000D) UI[]
(0020,0011) IS[]
(0008,0060) CS []


I use the findscu with -S option,

Another question is that if I use with the -P option i get the same message check required keys. With the patient level I can't access to series fields ?

Thanks for your help

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#7 Post by Thomas Wilkens »

I am sorry but that is exactly the way the "traditional" query/retrieve is defined in the DICOM standard: on the patient level you can query for all attributes which DICOM specifies to be on the patient level (and no other attributes), on the study level you can query for all attributes which DICOM specifies to be on the study level (and no other attributes), on the series level you can query for all attributes which DICOM specifies to be on the series level (and no other attributes), and on the image level you can query for all attributes which DICOM specifies to be on the image level (and no other attributes). That's just the way it is in DICOM. In case you need to query for information from more than one level, you need to do multiple queries.

If you are not happy with this "traditional" query/retrieve, there is something called "relational queries" in DICOM. Look in part 4 of the DICOM standard and you will find it. Relational queries allow any combination of keys at any level in the hierarchy (patient-study-series-image). The problem is that hardly any PACS system supports relational queries, probably because such queries are more difficult to implement.

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#8 Post by focus »

Hello Thomas!

First of all thanks for your help to you and all dcmtk's team. We are a group of person from the Udg (university of Girona) in catalonia. That we are developing a open source software for linux, to allow the doctors to connect to the PACS and visualisate the images. We are starting a nobody has idea how PACS works and it's is making that the beginning has been hard We don't have any reference code except your exemples like findscu o movescu, Your help is very helpfull.

Now I have two doubts to improve the efficiency in the querys for search patients.

Firts of all. For example if I want to search all the patients that patient's name begin for P. For every patient in the SCU i use the pogress Callback for retrieve the information, for every patient I have to do the progress Callback, but PACS's server sends the information of all the patients together, or after read a patient in the pogres Callback in the SCU and then PACS sends me the information of the next patient ? PACS waits that I have read one patient to send another, or send all together ?

An another I supose that the majority of people if needs information that are in distinct level make two queries,no ?. For example firts search the patient name, and then another query for the modality,no?

In the progress callback i save the information in a STL List is a good method this ??

Thanks for your help! I supose that we are doing basic questions but we are in our begginings. Thanks for All!

AndreasKnopke
Posts: 49
Joined: Wed, 2005-02-16, 16:27

#9 Post by AndreasKnopke »

What you can try to do is query for (0008,0061) "Modalities in Study" on Study Level. This is an optional key and might be supported by your PACS. CONQUEST for instance does support it. Look at the SQL table of CONQEST (dicom.sql file) to see how you can design your database to represent the levels.

A study can consist of different modalities (e.g. CT,SC and SR) and therefore it makes sence to put the attribute (0008,0061) on Series Level altough I would call it "Series Modality" instead of "Study Modality"

regards
Andreas

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#10 Post by Thomas Wilkens »

I did not really understand your question about "querying patients whose name starts with a P", I am sorry. But with regard to this topic, have you heard about "wildcard matching"? You can actually tell the PACS to return only patients whose name starts with a P by specifying "P*" in the (0010,0010) PatientsName attribute in your query. Look in the DICOM standard, part 4, section C.2.2.2.

Also, I would like to tell you to please note that this is a forum on DCMTK. In case you have general questions about DICOM, you should post your questions to the comp.protocols.dicom newsgroup. You can also search this newsgroup with google, this may already answer a lot of your questions.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest