Help in experimenting with query / retreive calls

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Jyoti
Posts: 17
Joined: Wed, 2004-12-01, 04:33

Help in experimenting with query / retreive calls

#1 Post by Jyoti » Tue, 2004-12-07, 10:34

Hi,

I am at present experimenting with DCMTK. I am trying to execute differnt commands of DCMTK to get familiarised with the output amd to increase my understanding of the same.

I am facing few problems with query / retrieve . I might be doing something wrong in the steps. Please correct me if I am wrong in the steps followed.

1. I created the database of images as given in imagectn config file.
2. I used the command dcmdump to dump the DCM contents of a ct image present in COMMON directory.
3. I copied a few of the tags from the above output to create a quert text file.
4. I used the command dump2dcm to create .dcm query file.
5. I used the command findscu on the same host as below:
findscu <host> 104 query.dcm --call COMMON

I am getting the error : findscu: No Acceptable Presentation Contexts

I am not able to understand what this error means. Does it mean that the image matching with my query is not found ?

Can you please give me some steps / example to try out the query / retrieve commands?

Thanks,
Jyoti

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier » Tue, 2004-12-07, 10:46

findscu <host> 104 query.dcm --call COMMON
You forgot to specify the query information model. Default is the modality worklist model which is apparently not appropriate for the imagectn. So you have to specify either --patient or --study or --psonly. And don't forget to specify the Query Retrieve Level (0008,0052) accordingly.

See documentation of findscu (e.g. the man page) for details and an example query.

Jyoti
Posts: 17
Joined: Wed, 2004-12-01, 04:33

#3 Post by Jyoti » Tue, 2004-12-07, 11:54

Thanks for your input.

I used the query information model ( -O ) as below:

findscu -v -O rjynt 104 query.dcm --call COMMON

and I get a error of the form :

Requesting Association
Association Accepted (Max Send PDV: 16372)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0016) UI =RETIRED_UltrasoundImageStorage # 26, 1 SOPClassUID
(0008,1050) PN [KLOFAS,EDWARD ] # 14, 1 PerformingPhysiciansName
(0010,0010) PN [NAPPER^MARGRET] # 14, 1 PatientsName
--------
C-Find RSP: MsgID: 1 [Status=Failed: IdentifierDoesNotMatchSOPClass]
AffectedSOPClassUID: =FINDPatientStudyOnlyQueryRetrieveInformationModel
Data Set: Not Present
Releasing Association
---------------------------------------------------------------------------------------

Looks like the image matching the query is not found. But my query.dcm file has been created using the same dataset as the image present in the common directory. Then why is it not finding it?

Also I didn't understand what you mean by "Query Retrieve Level (0008,0052)"? How do I specify that? Sorry if my questions are too basic but I am new to DCMTK and want to understand it well.

Thanks,
Jyoti

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier » Tue, 2004-12-07, 12:51

The Query Retrieve Level (0008,0052) is a mandatory attribute, i.e. you have to specify it either in the query file or on the command line (using option --key). Valid values for the Patient/Study Only information model are "PATIENT" and "STUDY".

I would also suggest that you read Annex C of part 4 of the DICOM standard where the Query/Retrieve Service Class is described in detail.

Jyoti
Posts: 17
Joined: Wed, 2004-12-01, 04:33

#5 Post by Jyoti » Wed, 2004-12-08, 07:43

Hi,

I read through the DICOM specifications for query / retrieval class. I am still having problems in performing the query / retrieve correctly using DCMTK.

I tried a command of the sort :
findscu -k 0008,0052="PATIENT" -v -P rjynt 104 --call COMMON

( Note that I have not given any query file and no query attribute apart from the level)

and it returns back a result of the form:

Requesting Association
Association Accepted (Max Send PDV: 16372)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0008,0052) CS [PATIENT] # 8, 1 QueryRetrieveLevel
--------
C-Find RSP: MsgID: 1 [Status=Success]
AffectedSOPClassUID: =FINDPatientRootQueryRetrieveInformationModel
Data Set: Not Present
Releasing Association

Now I don't know whether by this result it means that the query has been successful and the image has been found as "C-Find RSP: MsgID: 1 [Status=Success]" is reported.

Though I have not passed any query attribute how can it return a success?

I even tried giving some junk patient name and again it returned a success.

Jyoti

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier » Wed, 2004-12-08, 11:04

According to part 7 of the DICOM standard the status "success" of a C-FIND response indicates "that processing of the matches is complete." It does not tell you whether there are any matches at all or not.

Jyoti
Posts: 17
Joined: Wed, 2004-12-01, 04:33

#7 Post by Jyoti » Wed, 2004-12-08, 11:49

Is there no way to get a list of database entries that match with a specific query?

Is there any other command that I can use.

My problem is that I have a specific query which has information only about the image and not about the patient. For e.g my query consists of tags like (0008,1030)-StudyDescription, (0008,0016)-SOPClassUID, (0008,0008)-ImageType etc. I need to query and get a list of images which match with my query image.

Can you please suggest a way of carrying out this query?

Thanks for all your help,
Jyoti

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier » Wed, 2004-12-08, 17:33

Is there no way to get a list of database entries that match with a specific query?
Of course, there is a way: Just specify at least one key (e.g. '-k 0010,0010' or '-k "0010,0010=R*"')!

For the other part of your question: Please note that the Q/R service uses a strictly hierarchical information model (patient - study - series - instance/image), i.e. you can only query on one level at a time. Although there is something called "relational query model" which could be used to query on different levels at a time, this model is not widely used in practise.

The corresponding query levels for your example tags can also be found in part 4 of the DICOM standard: Study Description (0008,1030) is part of the STUDY level, SOP Class UID (0008,0016) and Image Type (0008,0008) are part of the IMAGE level. Note however, that all three tags are optional and may not be (fully) supported by the implementation.

So basically, either you have to perform multiple queries, one for each level your tags belong to, or you have to filter the results from a single query. The latter might also be required if the SCP does not support all keys you are using.

Jyoti
Posts: 17
Joined: Wed, 2004-12-01, 04:33

#9 Post by Jyoti » Fri, 2004-12-10, 06:47

Hi,

Can you please clarify which part of the FINDSCU response tells that it has been successful in finding theimage matching our query as I am not able to differentiate betweena successful search and a un-sussessful one. Both the responses look same.

exp 1: Querying for an image which is of type MRI. Since such an image is present in my database, the query should be sucessful.

findscu -k 0008,0052="STUDY" -k 0008,0016="MR*" -v -P rjynt 104 --call COMMON
Requesting Association
Association Accepted (Max Send PDV: 16372)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0008,0016) UI [MR*] # 4, 1 SOPClassUID
(0008,0052) CS [STUDY] # 6, 1 QueryRetrieveLevel
--------
C-Find RSP: MsgID: 1 [Status=Success]
AffectedSOPClassUID: =FINDPatientRootQueryRetrieveInformationModel
Data Set: Not Present
Releasing Association

exp2: Querying for an image which has the patient name "abc". Since such an image is not present in my database, the query should be un-sucessful.

findscu -k 0008,0052="PATIENT" -k 0010,0010="ABC*" -v -P rjynt 104 --call COMMON

Requesting Association
Association Accepted (Max Send PDV: 16372)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0008,0052) CS [PATIENT] # 8, 1 QueryRetrieveLevel
(0010,0010) PN [ABC*] # 4, 1 PatientsName
--------
C-Find RSP: MsgID: 1 [Status=Success]
AffectedSOPClassUID: =FINDPatientRootQueryRetrieveInformationModel
Data Set: Not Present
Releasing Association

Thanks for all your prompt help,
Jyoti

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#10 Post by Jörg Riesmeier » Mon, 2004-12-13, 14:18

None of your example queries has any matches.

Example 1: There is no SOPClassUID (0008,0016) starting with "MR". Maybe, you wanted to query for Modality (0008,0060)?

Example 2: There is apparently no PatientName (0010,0010) starting with "ABC" in your database. Please note that usually the query is case sensitive, i.e. "abc" is not the same as "ABC". See DICOM part 4 for details.

If there would be any match (or multiple matches) the findscu would list the requested attributes.

Jyoti
Posts: 17
Joined: Wed, 2004-12-01, 04:33

#11 Post by Jyoti » Wed, 2004-12-15, 07:27

Jörg Riesmeier wrote: Example 1: There is no SOPClassUID (0008,0016) starting with "MR". Maybe, you wanted to query for Modality (0008,0060)?
The SOPClassUID was actually called "=MRImageStorage". So I reran the query with the correct value as :

findscu -k 0008,0052="STUDY" -k 0008,0016="=MRImageStorage" -v -P rjynt 104 --call COMMON

But there is no difference in the response :

Requesting Association
Association Accepted (Max Send PDV: 16372)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0008,0016) UI =MRImageStorage # 26, 1 SOPClassUID
(0008,0052) CS [STUDY] # 6, 1 QueryRetrieveLevel
--------
C-Find RSP: MsgID: 1 [Status=Success]
AffectedSOPClassUID: =FINDPatientRootQueryRetrieveInformationModel
Data Set: Not Present
Releasing Association


My questions :

1. Does the data Set part of the response supposed to have the matched attributes ?

2. Please note that I am running only the service imagectn on the server. Am I supposed to run some other service also?

3. What does the number " # 6, 1 " next to each attribute signify?
Jörg Riesmeier wrote:If there would be any match (or multiple matches) the findscu would list the requested attributes.
No success in getting this !! Not able to figure out where I am going wrong

:cry:

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1297
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#12 Post by Marco Eichelberg » Wed, 2004-12-15, 10:41

I think it would be a good idea if you carefully read the description of the Query/Retrieve service class (in particular the query part for now) in Part 4 of the DICOM standard, Annex C. The DICOM Query Model is a hierarchical one, and there is a well-defined list of matching and return keys for each level. In your example, you are trying to do a query on STUDY level in the Patient Root model. The query rules in this case require you to provide a valid Patient ID (being the unique key for the PATIENT level), a return key for the unique key on STUDY level, which is the Study Instance UID, and possibly additional matching or return keys for the STUDY level. The SOP Class UID is neither a matching nor a return key on STUDY level, it is only defined for the IMAGE level. To put it simple, your query is not well-formed and the result is undefined behaviour.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest