FINDSCU INFORMATION MODELS

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
rad1015
Posts: 8
Joined: Wed, 2005-01-05, 21:01

FINDSCU INFORMATION MODELS

#1 Post by rad1015 »

I am sucessfully able to query a worklist using the modality worklist information model (-W). I am only able to retrieve information pertaining to patient demographic information but I can't retrieve study specific information.

When I try to use the study "root information model" (-S), I always get the message: "findscu: No Acceptable Presentation Contexts". What does this mean?

wrgben
Posts: 20
Joined: Thu, 2005-01-06, 10:53

#2 Post by wrgben »

The Study Root Information Model is not applicable to worklists...the reason you are getting the message is because the Find SCP ("worklist server") only supports the Worklist Information Model - FIND SOP Class and you are proposing to use the Study Root Q/R Model - FIND SOP Class.

rad1015
Posts: 8
Joined: Wed, 2005-01-05, 21:01

#3 Post by rad1015 »

Makes sense.

Is there a flag that I could use to print off all the keys/values that pertain to that model? If not, is there a reference somewhere of the appropriate keys to a worklist?

wrgben
Posts: 20
Joined: Thu, 2005-01-06, 10:53

#4 Post by wrgben »

Annex K of Part 4 of the DICOM standard has what you need. You can find it at http://medical.nema.org/dicom/2004.html

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

#5 Post by Jörg Riesmeier »

The list of supported matching and return keys of the "wlmscpfs" (DCMTK's Worklist Management SCP) is contained in the documentation (man page).

rad1015
Posts: 8
Joined: Wed, 2005-01-05, 21:01

#6 Post by rad1015 »

In the wlmscpfs.man, for the matching and returning keys, what does the indented ">" mean? Is there a way to use findscu to return all possible keys (wildcard)?

I am trying to get the study description based on the accession number. I am not using the worklist scp provided. I am using another system that I do not know the keys for. I assume they are closely related. When I try to query for the study description with accession number being defined, I do not recieve a value for the study description (does not show up on the list of returned keys). What am I doing wrong?

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

#7 Post by Thomas Wilkens »

In wlmscpfs.man you can see that the wlmscpfs application supports the following attributes as matching keys:

Code: Select all

(0008,0050) AccessionNumber
(0008,0090) ReferringPhysiciansName
(0010,0010) PatientsName
(0010,0020) PatientID
(0010,0040) PatientsSex
(0032,1032) RequestingPhysician
(0038,0010) AdmissionID
(0040,0100) ScheduledProcedureStepSequence
  (0008,0060) > Modality
  (0040,0001) > ScheduledStationAETitle
  (0040,0002) > ScheduledProcedureStepStartDate
  (0040,0003) > ScheduledProcedureStepStartTime
  (0040,0006) > ScheduledPerformingPhysiciansName
(0040,1001) RequestedProcedureID
(0040,1003) RequestedProcedurePriority
The indented ">" means that this particular attribute is part of the sequence attribute that is mentioned above. I.e. the attributes Modality, ScheduledStationAETitle, ScheduledProcedureStepStartDate, ScheduledProcedureStepStartTime and ScheduledPerformingPhysiciansName are part of the sequence attribute ScheduledProcedureStepSequence.

Because you are unfamiliar with the ">" character, I assume that you dont know what a sequence attribute is. Here's a short explanation:
  • A special case among the DICOM data types is the sequence („Sequence of Items“, SQ), which can be used to create hierarchical data structures
  • Attribute value is an order list of so-called „Items“
  • An item is a frame structure containing a complete DICOM data set
    Therefore, the value of a sequence is a list of DICOM data sets which again may contain sequences, and so on.
  • Most of the time, all items of a sequence have the same structure (analogy: an array of structs in C/C++)
  • There are a few sequences, though, where each item may have a different structure.
If you are trying to get the study description based on the accession number, your query should look similar to this:

Code: Select all

(0008,0050) SH [Enter your accession number here]     # AccessionNumber
(0040,0100) SQ (Sequence explicit length #=1)         # ScheduledProcedureStepSequence
  (fffe,e000) na (Item with explicit length #=5)      # Item
    (0008,0060) CS []                                 # Modality
    (0040,0001) AE []                                 # ScheduledStationAETitle
    (0040,0002) DA []                                 # ScheduledProcedureStepStartDate
    (0040,0003) TM []                                 # ScheduledProcedureStepStartTime
    (0040,0006) PN []                                 # ScheduledPerformingPhysiciansName
  (fffe,e0dd) na (SequenceDelimitationItem for re-encoding)
(fffe,e0dd) na (SequenceDelimitationItem for re-encoding)
Good luck!

rad1015
Posts: 8
Joined: Wed, 2005-01-05, 21:01

#8 Post by rad1015 »

I tried to take that query, filled in the accession numberm and run it through dump2dcm. I recieved the folowing message:

Code: Select all

[root@server bin]# ./dump2dcm query query.dcm
dump2dcm: query: Error in creating Element: Invalid Tag (line 9)
dump2dcm: query: Error in creating Element: Invalid Tag (line 10)
dump2dcm: query: Block Error in dataset
3 Errors found in query
I am actually wanting to do all command line queries. I am able to get the Study Description using matching key 0032,1060 only if I specify a StudyUID key 0020,000d.
The process I am doing now is listing the StudyUID based on PatientID. Choosing on of the StudyUID and getting a Study Description from it. I still can not figure out how to get the AETitle, StudyDate/StudyTime.

I understand the hierarchy of the sequences.

This appears to work find except I am using RequestedProcedureDescription (matching key 0032,1060) rather than ScheduledProcedureStepDescription (0040,0007). I don't think I understand the difference between these two matching keys.

Code: Select all

[root@server lib]# /usr/local/dicom/bin/findscu -v -k 0008,0052="STUDY" -k 0010,0020="########" -k 0020,000d="##.##.##.##.##.##" -k 0032,1060 [IP] [PORT]
Requesting Association
Association Accepted (Max Send PDV: 99988)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0008,0052) CS [STUDY]                                  #   6, 1 QueryRetrieveLevel
(0010,0020) LO [########]                             #  10, 1 PatientID
(0020,000d) UI [##.##.##.##.##.##] #  52, 1 StudyInstanceUID
(0032,1060) LO (no value available)                     #   0, 0 RequestedProcedureDescription
--------
RESPONSE: 1 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianImplicit
(0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
(0010,0020) LO [########]                             #  10, 1 PatientID
(0020,000d) UI [##.##.##.##.##.##] #  52, 1 StudyInstanceUID
(0032,1060) LO [CHEST 1V]                               #   8, 1 RequestedProcedureDescription
--------
C-Find RSP: MsgID: 1 [Status=Success]
  AffectedSOPClassUID: =FINDModalityWorklistInformationModel
  Data Set: Not Present
Releasing Association
So my question is: On a command line query, how would I query all the accession numbers, patientIDs and study descriptions based on a AETitle and a date? I hope this example will clear up my misunderstandings!

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

#9 Post by Thomas Wilkens »

I am sorry, I made a slight mistake in my example. The following query file should be correct:

Code: Select all

(0008,0050) SH [enter your accession number here]       #     6,  1  AccessionNumber
(0010,0010) PN []                                       #     6,  1  PatientName
(0010,0020) LO []                                       #     6,  1  PatientID
(0010,0030) DA []                                       #     8,  1  PatientBirthDate
(0010,0040) CS []                                       #     2,  1  PatientSex
(0032,1060) LO []                                       #     8,  1  RequestedProcedureDescription
(0040,0100) SQ                                             #   250,  1  ScheduledProcedureStepSequence
  (fffe,e000) na                                             #   242,  1  Item
    (0008,0060) CS []                                       #     2,  1  Modality
    (0040,0001) AE []                                       #     8,  2  ScheduledStationAETitle
    (0040,0002) DA []                                       #     8,  1  ScheduledProcedureStepStartDate
    (0040,0003) TM []                                       #     6,  1  ScheduledProcedureStepStartTime
    (0040,0006) PN []                                       #     8,  1  ScheduledPerformingPhysiciansName
    (0040,0007) LO []                                       #     8,  1  ScheduledProcedureStepDescription
    (0040,0009) SH []                                       #     8,  1  ScheduledProcedureStepID
    (0040,0010) SH []                                       #     6,  2  ScheduledStationName
    (0040,0011) SH []                                       #     4,  1  ScheduledProcedureStepLocation
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #     0,  1  ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-enc.)   #     0,  1  SequenceDelimitationItem
(0040,1001) SH []                                       #     6,  1  RequestedProcedureID
(0040,1003) SH []                                       #     4,  1  RequestedProcedurePriority
Save this query as a file, run it through dump2dcm and use it with findscu like this:

Code: Select all

findscu -v [IP] [PORT] query.dcm
Unfortunately, it is not possible to specify this query on the command line (without a file query.dcm) because sequence attributes are used in this particular query and (quotation from file dcmnet/docs/findscu.man:)

Code: Select all

It is not possible to replace or insert attributes within sequences using the -k option.
From the example command line you gave, the following things are obvious: you have not understood the difference between matching key attributes and return key attributes and you mix up the DICOM query/retrieve service and the DICOM worklist management service.

Difference between matching key attributes and return key attributes: Matching key attributes are attributes that have a value assigned to them in a query; these attributes decide which instances from the database will be returned. In my example from above, accession number is a matching key attribute, because I am trying to query records from the database based on their accession number. Return key attributes are attributes that do NOT have a value assigned to them in a query; these are the attributes whose values shall be returned in C-Find response messages; in my example from above, all attributes except for accession number are return key attributes (I am interested in all the values for these attributes, I want to retrieve these values from the database).

Difference between worklist management service and query/retrieve service: There is a big difference! The main difference is that Q/R has a hierarchical query structure (thats why you have to specify a query retrieve level) but worklist management has not. That is the reason why with worklist management, you dont have to pass the query retrieve level in your query! Please: no -k 0008,0052="STUDY" in your query when you are doing worklist management. Query retrieve level is for the Q/R service only!!

Read part 4 annex C of the DICOM standard thoroughly in order to get to know all differences between the worklist management service and the query/retrieve service.
And regarding your question about the difference between the two attributes RequestedProcedureDescription and ScheduledProcedureStepDescription: The latter is part of the ScheduledProcedureStepSequence, the former is not. If you want to query ScheduledProcedureStepDescription, you need to include in a ScheduledProcedureStepSequence item.

rad1015
Posts: 8
Joined: Wed, 2005-01-05, 21:01

#10 Post by rad1015 »

Its all coming together now. I didn't realize you could not use sequence attributes on a command line. I assumed that since I didn't want to insert or replace, that I could use command line. Still don't understand how I am inserting or replacing since I am just trying to do a query. No matter how much I read the standard, its always a sentance I overlook.

On the last query: How do you know the "Two letter indentity"? For an example, "SH" or "PN" or "LO". When I look at the wlmscpfs man file, it only specifies the matching key.

Also with the last query: What is the two numbers specified in your comments? For an example "6, 1" in the AccessionNumber comment?

I think this finalizes my questions. Hopefully this topic is helpful to other viewers!

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

#11 Post by Thomas Wilkens »

In this context (quotation from file dcmnet/docs/findscu.man:)

Code: Select all

It is not possible to replace or insert attributes within sequences using the -k option.
replace or insert means that if you are using a query file and the -k option to specify attributes in your query, the attributes that are passed on the command line (through the -k option) will replace attributes with the same group/element number in the query file or they will be inserted if there is no attribute with the same group/element number in the query file. Unfortunately, this does not work with attributes within sequences.

The "two letter identity" (= an attributes value representation (VR) (i.e. its datatype)) can be identified in part 6 (data dictionary) of the DICOM standard, and only there. You wont even find an attributes VR in part 4 where worklist management is explained in detail.

"6, 1" in the Accession Number comment is (as you have correctly said) part of the comment and does therefore not have any importance with regard to the query. Generelly, these numbers are shown when you dump a DICOM file with dcmdump, and thats where they come from. "6, 1" means that the value in this attribute is 6 bytes long and that this attribute has a value multiplicity (VM) of 1.

deepujames
Posts: 19
Joined: Wed, 2005-02-09, 08:44

Semantics of dicom sequence

#12 Post by deepujames »

Hi
I am using dump2dcm utility

Can any one explain me how sequences can be added in a query file

For example consider this sequence:

(0040,0100) SQ # 250, 1 ScheduledProcedureStepSequence
(fffe,e000) na
<< items in sequence>>
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 1 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-enc.) # 0, 1 SequenceDelimitationItem

what is the meaning of (fffe,e000),item delimitation and sequence delimitation?
how can i add more items to this sequence?
Also How many items i can add to this particular sequence?
Also should i add code value and coding scheme designer tags for each sequences? if so what are its values for this sequence?

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

#13 Post by Thomas Wilkens »

Can any one explain me how sequences can be added in a query file
Just look at the examples above, it is not that complicated.
what is the meaning of (fffe,e000),item delimitation and sequence delimitation?
The item delimitation item tells dump2dcm where the end of a corresponding item is. Attributes which follow the item delimitation item do not belong to the above specified item.

The sequence delimitation item tells dump2dcm where the end of a corresponding sequence is. Attributes which follow the sequence delimitation item do not belong to the above specified sequence.
how can i add more items to this sequence?
See this example:

Code: Select all

(0010,0010) PN [Wilkens^Thomas]                         #     6,  1  PatientName
(0010,0020) LO [12345]                                  #     6,  1  PatientID
(0010,0030) DA [19730526]                               #     8,  1  PatientBirthDate
(0010,0040) CS [M]                                      #     2,  1  PatientSex
(0040,0100) SQ                                            #   250,  1  ScheduledProcedureStepSequence
  (fffe,e000) na                                            #   242,  1  Item
    (0008,0060) CS [XA]                                     #     2,  1  Modality
    (0040,0001) AE [XA1]                                    #     8,  2  ScheduledStationAETitle
    (0040,0002) DA [20051027]                               #     8,  1  ScheduledProcedureStepStartDate
    (0040,0003) TM [1000]                                   #     6,  1  ScheduledProcedureStepStartTime
    (0040,0006) PN [Eichelberg]                             #     8,  1  ScheduledPerformingPhysiciansName
    (0040,0009) SH [123]                                    #     8,  1  ScheduledProcedureStepID
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)  #     0,  1  ItemDelimitationItem
  (fffe,e000) na                                            #   242,  1  Item
    (0008,0060) CS [XA]                                     #     2,  1  Modality
    (0040,0001) AE [XA1]                                    #     8,  2  ScheduledStationAETitle
    (0040,0002) DA [20051027]                               #     8,  1  ScheduledProcedureStepStartDate
    (0040,0003) TM [1020]                                   #     6,  1  ScheduledProcedureStepStartTime
    (0040,0006) PN [Eichelberg]                             #     8,  1  ScheduledPerformingPhysiciansName
    (0040,0009) SH [124]                                    #     8,  1  ScheduledProcedureStepID
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)  #     0,  1  ItemDelimitationItem
  (fffe,e000) na                                            #   242,  1  Item
    (0008,0060) CS [XA]                                     #     2,  1  Modality
    (0040,0001) AE [XA1]                                    #     8,  2  ScheduledStationAETitle
    (0040,0002) DA [20051027]                               #     8,  1  ScheduledProcedureStepStartDate
    (0040,0003) TM [1040]                                   #     6,  1  ScheduledProcedureStepStartTime
    (0040,0006) PN [Eichelberg]                             #     8,  1  ScheduledPerformingPhysiciansName
    (0040,0009) SH [125]                                    #     8,  1  ScheduledProcedureStepID
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #     0,  1  ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-enc.)   #     0,  1  SequenceDelimitationItem
(0040,1001) SH []                                       #     6,  1  RequestedProcedureID
How many items i can add to this particular sequence?
As many as you want, there is no restriction.
Should i add code value and coding scheme designer tags for each sequences? if so what are its values for this sequence?
Please specify more clearly what your scenario is, otherwise we cannot help you.

Also please note that in the context of worklist management, you can only have one item in the ScheduledProcedureStepSequence attribute in the dataset of a C-Find request message. (See sequence matching in section C.2.2.2.6 of part 4 of the DICOM standard.)

deepujames
Posts: 19
Joined: Wed, 2005-02-09, 08:44

How to add more elements to sequence after dum2dcm?

#14 Post by deepujames »

Hi
Thanks for ur reply. It really helped me.
Is it possible to add more elements to a sequence after dump2dcm without modifying the query file. using dcmodify?
I am using query file for MPPS. My dataset is getting values from the query.dcm file similer to findscu.
So sequences like referenced image sequence I would like to add more SOP class and Instance UID of images aquired to the .dcm file using dcmodify and how many images are going to be aquired is known at run time only.
example:
(0008,1140) SQ [] # Referenced Image Sequence 1
(fffe,e000) na #
(0008,1150) UI [1.2.840.113780.9800.0.20050408150157.20.11]
(0008,1155) UI [1.2.840.113780.9800.0.20050408150157.20.11.11.1.1.1]
(fffe,e00d) na (ItemDelimitationItem for re-encoding)
(fffe,e000) na #
(0008,1150) UI [1.2.840.113780.9800.0.20050408150157.20.11.2]
(0008,1155) UI [1.2.840.113780.9800.0.20050408150157.20.11.22.2]
(fffe,e00d) na (ItemDelimitationItem for re-encoding)
(fffe,e000) na #
(0008,1150) UI [1.2.840.113780.9800.0.20050408150157.20.11.1]
(0008,1155) UI [1.2.840.113780.9800.0.20050408150157.20.11.11.2.1]
(fffe,e00d) na (ItemDelimitationItem for re-encoding)
(fffe,e0dd) na (SequenceDelimitationItem for re-enc.)

this is referenced image sequnce with 3 elements.
Can I add more (more than 3 elements) elements to it using ./dcmodify after creating query.dcm using ./dump2dcm?

Ebaad
Posts: 5
Joined: Fri, 2006-02-17, 19:17

#15 Post by Ebaad »

Dear Sir,

From the above example I tried to make a dcm file and it was successful, but when i tried to use it as specified (findscu -v IP PORT test.dcm), I get the following error.

Requesting Association
findscu: Association Rejected:
Result: Rejected Permanent, Source: Service User
Reason: No Reason

The only change I did before making a .dcm file was that I changed the patient name to,

(0010,0010) PN [A*] # 6, 1 PatientName

and

(0008,0050) SH [] # 6, 1 AccessionNumber

Which I hope just tell the findscu to query for all the patients names starting with A.

Please let me know if I'm doing anything wrong.

I have been hasseling with this for about three weeks and I really want to move forward and make a script so that I can query and retrieve all the exams for that day.

Thanks in advance for the help.
Ebaad Ahmed.

Post Reply

Who is online

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