storescp - dcmqrscp - findscu

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ali.farhoudi
Posts: 17
Joined: Mon, 2014-05-19, 08:06

storescp - dcmqrscp - findscu

#1 Post by ali.farhoudi »

Hi
I'm implementing a pacs system using dcmtk. I've got some questions.
These are the steps i have done using instructions:
1- I created "./home/dicom/db" folder and "COMMON", "ACME_STORE" and "UNITED_STORE" folders inside db folder.
2- I copied "dcmqrscp.cfg", "storescp.cfg" and "storescu.cfg" file from dcmtk's "etc" folder to my "./home/dicom/db" folder
3- ran storescp using this command:

Code: Select all

storescp -v -dhl --fork -xf ./home/dicom/db/storescp.cfg Default -od ./home/dicom/db/COMMON --aetitle FPH_SCP --sort-on-patientname 1000
4- send a dcm file using this command:

Code: Select all

storescu -v -d --aetitle FPH_SCU --call FPH_SCP -xf ./home/dicom/db/storescu.cfg Default localhost 1000 test.dcm
and the file received and stored successfully.
5- Then i added a dot ( . ) at the first of paths in dcmqrscp.cfg file and I ran query retrieve service using this command:

Code: Select all

dcmqrscp -v -d -c ./home/dicom/db/dcmqrscp.cfg 104
6- After that i sent a query to find the file i had send using this command:

Code: Select all

findscu -v -d --aetitle FPH_FIND --call COMMON --patient --key 0008,0052=PATIENT --key 0010,0010="T*" localhost 104
and i got this message in dcmqrscp window:
/home/dicom/db/COMMON\index.dat: No such file or directory
dispatch: cannot create DB Handle
DIMSE Failure (aborting association): 000c:0001 DcmQR Index Database Error

7- Then i used dcmqridx file to register my stored file in database index file. i ran this command:

Code: Select all

dcmqridx -v -d ./home/dicom/db/COMMON ./home/dicom/db/COMMON/Test_Test_20140522_114638024/CR.1.2.826.0.1.3680043.2.1074.90089.1.71.10001008.1
And the index file created and information about file stored in index file successfully.
8- Now i tried find query again and i got this in dcmqrscp window:

I: Association Received (MYRIAN-PC:FPH_FIND -> COMMON) Thu May 22 12:52:47 2014
I:
I: Association Acknowledged (Max Send PDV: 16372)
I: Received Find SCP:
I: ===================== INCOMING DIMSE MESSAGE ====================
I: Message Type : C-FIND RQ
I: Message ID : 1
I: Affected SOP Class UID : FINDPatientRootQueryRetrieveInformationModel
I: Data Set : present
I: Priority : low
I: ======================= END DIMSE MESSAGE =======================
I: Find SCP Request Identifiers:
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0052) CS [PATIENT] # 8, 1 QueryRetriev
eLevel
I: (0010,0010) PN [T*] # 2, 1 PatientName
I:
I: Find SCP Response 1 [status: Pending]
I: Find SCP Response 2 [status: Success]
I: Association Release


and this one in findscu window:

D: Request Parameters:
I: Requesting Association
I: Association Accepted (Max Send PDV: 16372)
I: ===================== OUTGOING DIMSE MESSAGE ====================
I: Message Type : C-FIND RQ
I: Presentation Context ID : 1
I: Message ID : 1
I: Affected SOP Class UID : FINDPatientRootQueryRetrieveInformationModel
I: Data Set : present
I: Priority : low
I: ======================= END DIMSE MESSAGE =======================
I: Find SCU Request Identifiers:
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Unknown Transfer Syntax
I: (0008,0052) CS [PATIENT] # 8, 1 QueryRetriev
eLevel
I: (0010,0010) PN [T*] # 2, 1 PatientName
I:
W: ---------------------------
W: Find Response: 1 (Pending)
W:
W: # Dicom-Data-Set
W: # Used TransferSyntax: Little Endian Explicit
W: (0008,0052) CS [PATIENT ] # 8, 1 QueryRetriev
eLevel
W: (0008,0054) AE [COMMON] # 6, 1 RetrieveAETi
tle
W: (0010,0010) PN [Test^Test ] # 10, 1 PatientName
W:
I: ===================== INCOMING DIMSE MESSAGE ====================
I: Message Type : C-FIND RSP
I: Message ID Being Responded To : 1
I: Affected SOP Class UID : FINDPatientRootQueryRetrieveInformationModel
I: Data Set : none
I: DIMSE Status : 0x0000: Success
I: ======================= END DIMSE MESSAGE =======================
I: Releasing Association


I see that it has found the target file.
And these are my questions:

A) First of all I'd like to know if my steps are correct?
B) Do i have to have a index database file to use find and move services?
C) To register files in index file should I call dcmqridx in -xcr parameter of storescp service?
D) How can i use movescu after finding the target file?
E) How can I use responses (like found image) in other programming languages like PHP?

Any help would be appreciated.

ali.farhoudi
Posts: 17
Joined: Mon, 2014-05-19, 08:06

Re: storescp - dcmqrscp - findscu

#2 Post by ali.farhoudi »

Any Heeeeeeelpp?!?!

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: storescp - dcmqrscp - findscu

#3 Post by J. Riesmeier »

What about reading the documentation that is provided for the DCMTK? Or, what about using the search function of this forum system...

Anyway, here are some short answers to your questions:

A) This depends on what you intend to do.
B) The "index.dat" file is needed by the Q/R SCP "dcmqrscp".
C) No, you could register the files with dcmqridx in a first step, but basically the registration is done by dcmqrscp each time a new SOP instance is received. The tool storescp has nothing to do with it.
D) What about reading the documentation... there are examples on how to use this tool ...
E) You mean the result of findscu, i.e. the C-FIND responses? What about using option --extract?
I'm implementing a pacs system using dcmtk.
Btw, if you really try to implement a PACS, you should not use the command line tools but the underlying class library! The tools are just (small) sample applications that demonstrate how to use the library. Of course, some of these tools are quite comprehensive but I would only use them for testing and/or validation purposes.

ali.farhoudi
Posts: 17
Joined: Mon, 2014-05-19, 08:06

Re: storescp - dcmqrscp - findscu

#4 Post by ali.farhoudi »

Thanks J. Riesmeier for your help.
I'm confused.
For receiving and storing images and registering them in index.dat file, which one should I use: storescp or dcmqrscp? And how should i register them as i receive them?
For result of find command, if I want to show result in a php page, should I extract them as dcm files and get their tags and show them?

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: storescp - dcmqrscp - findscu

#5 Post by J. Riesmeier »

For receiving and storing images and registering them in index.dat file, which one should I use: storescp or dcmqrscp?
Use dcmqrscp.
And how should i register them as i receive them?
dcmqrscp does this automatically.
For result of find command, if I want to show result in a php page, should I extract them as dcm files and get their tags and show them?
It's your design decision.

ali.farhoudi
Posts: 17
Joined: Mon, 2014-05-19, 08:06

Re: storescp - dcmqrscp - findscu

#6 Post by ali.farhoudi »

I sent a file using storescu to dcmqrscp service.
but i got this message:
"F: No Acceptable Presentation Contexts"
I tried some different files. But i got the same error.
This wasn't happening when i was using storescp for receiving files.
This is my command for dcmqrscp:

Code: Select all

dcmqrscp -v -c ./home/dicom/db/dcmqrscp.cfg 104
and this in for my storescu:

Code: Select all

storescu -v --aetitle FPH_SCU --call COMMON -xf ./home/dicom/db/storescu.cfg Default localhost 104 test.dcm
What could be the problem?!

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: storescp - dcmqrscp - findscu

#7 Post by J. Riesmeier »

I guess the error message "No Acceptable Presentation Contexts" is clear. If you don't understand it, you should first learn how the DICOM network protocol works (especially, the association negotiation).

Basically, you should check the following:
  1. What is the SOP Class and Transfer Syntax of "test.dcm".
  2. Is this combination covered by the "storescu.cfg" file?
  3. Does the dcmqrscp accept this presentation context?

ali.farhoudi
Posts: 17
Joined: Mon, 2014-05-19, 08:06

Re: storescp - dcmqrscp - findscu

#8 Post by ali.farhoudi »

Thank you Mr. Riesmeier.
It worked.
I have another question about dcmqrscp:
Can I config the dcmqrscp to set the location of saving files?
I saw that storescp can do it by setting -ss, -su, -sp and -uf, +uf, -tn, -fe for file name.
But I couldn't find these options for dcmqrscp in documentation.
Could you please help me?

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: storescp - dcmqrscp - findscu

#9 Post by J. Riesmeier »

The location (directory) where dcmqrscp stores the received DICOM objects as files can be configured in the configuration file (see documentation). There are no options to control the filename generation.

ali.farhoudi
Posts: 17
Joined: Mon, 2014-05-19, 08:06

Re: storescp - dcmqrscp - findscu

#10 Post by ali.farhoudi »

OKAY!
Got it.
Thanks a lot Mr. Riesmeier.
Best Regards

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: storescp - dcmqrscp - findscu

#11 Post by Michael Onken »

As a follow up, also for other users facing the same question(s): There is a new DCMTK networking tool howto that explains how to use echoscu, storescu, findscu, movescu and dcmqrscp in order to debug PACS communication.

Best,
Michael

Post Reply

Who is online

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