Help in experimenting with query / retreive calls
Moderator: Moderator Team
Help in experimenting with query / retreive calls
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
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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.findscu <host> 104 query.dcm --call COMMON
See documentation of findscu (e.g. the man page) for details and an example query.
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
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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.
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.
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
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Of course, there is a way: Just specify at least one key (e.g. '-k 0010,0010' or '-k "0010,0010=R*"')!Is there no way to get a list of database entries that match with a specific query?
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.
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
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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.
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.
The SOPClassUID was actually called "=MRImageStorage". So I reran the query with the correct value as :Jörg Riesmeier wrote: Example 1: There is no SOPClassUID (0008,0016) starting with "MR". Maybe, you wanted to query for Modality (0008,0060)?
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?
No success in getting this !! Not able to figure out where I am going wrongJörg Riesmeier wrote:If there would be any match (or multiple matches) the findscu would list the requested attributes.

-
- OFFIS DICOM Team
- Posts: 1516
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
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.
Who is online
Users browsing this forum: No registered users and 0 guests