simulations for students

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

#16 Post by Markus Sabin »

horus wrote:
1) I'd like to use findscu to obtain a patients-list (whose fields could be patientsname,studydate....) from the ACME_STORE directory, which contains all the dicom files.
That should work now. Each attribute that you append to the query will be returned by the server and contain the corresponding value in the current match.
horus wrote:
2) I'd like to use a field of the list (e.g. only a patientsname or only a studydate.....) obtained in 1) to find a .dcm file (...or the filename) in ACME_STORE (Can findscu do this?)
No. You can not access a server side filename over DICOM C-Find. But you can make the server send you the file using C-Move (resp. OFFIS movescu). The usage is quite similar to findscu. When the move-SCP sends the images, you need to have a Storage Service Class provider running at the moveSCU's site. You can either use the built-in storeSCP in movescu, using the command line options or use a dedicate storescp for that.
horus wrote: Step 2) could be merged in step 1) if the list contains also the filenames for each patient. It doesn't matter if the list contains repeated rows which are different only for the filename.
No, that is not possible
horus wrote: E.g.
date patient file
20030202 olga xxxx file1.dcm
20030202 olga xxxx file2.dcm
20040401 vincent xxx file2.dcm
In fact, DICOM is much more complicated than that :twisted:! Between that patients and the images (files), there are studies and series. Nevertheless, you can advise a MoveSCP to send all instances ("Images") for a specific patient and leave out the study and series information.
horus wrote: 3) I'd like to move the file (or files...more files could have the same patientsname) found in 2) to another PC using movescu.
For that, the movescu supports tree AETs:
-aet the AET of the client (SCU) that issues the C-Move
-aec the AET of the server (SCP) that processes the C-Move
-aem the AET of the move destination

The server has to resolve the IP and port of the move destination using its configuration in "HostTable"

horus
Posts: 20
Joined: Fri, 2006-02-24, 19:33

good news

#17 Post by horus »

Dear Mr. Sabin,

Good News.

I converted the following query.txt into a valid query.dcm file using dump2dcm:
_________________________________
# query patient names and IDs
(0008,0052) CS [PATIENT] # QueryRetrieveLevel
(0010,0010) PN [] # PatientsName
(0010,0020) LO [] # PatientID
_________________________________

obtaining the following result:
_____________________________________________________________
C:\home>findscu -X -v -P -aec ACME_STORE localhost 104 query.dcm
Requesting Association
Association Accepted (Max Send PDV: 8180)
Find SCU RQ: MsgID 1
REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0010,0010) PN (no value available) # 0, 0 PatientName
(0010,0020) LO (no value available) # 0, 0 PatientID
--------
RESPONSE: 1 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXX DEMO ] # 10, 1 PatientName
(0010,0020) LO [556342B ] # 8, 1 PatientID
--------
RESPONSE: 2 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXXX^GIUSEPPE^^^ ] # 18, 1 PatientName
(0010,0020) LO [121 ] # 4, 1 PatientID
--------
RESPONSE: 3 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXXXXX^CHARLES ] # 16, 1 PatientName
(0010,0020) LO [GE0514] # 6, 1 PatientID
--------
RESPONSE: 4 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXXXXX^ANNA ] # 14, 1 PatientName
(0010,0020) LO [SMS511104 ] # 10, 1 PatientID
--------
RESPONSE: 5 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXXXXXXX M ] # 12, 1 PatientName
(0010,0020) LO [spectro-csi ] # 12, 1 PatientID
--------
RESPONSE: 6 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXXX^XXXXXX ] # 16, 1 PatientName
(0010,0020) LO (no value available) # 0, 0 PatientID
--------
RESPONSE: 7 (Pending)

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLe
vel
(0008,0054) AE [ACME_STORE] # 10, 1 RetrieveAETitle

(0010,0010) PN [XXXX^GIUSEPPE^^^] # 16, 1 PatientName
(0010,0020) LO [586 ] # 4, 1 PatientID
--------
C-Find RSP: MsgID: 1 [Status=Success]
AffectedSOPClassUID: =FINDPatientRootQueryRetrieveInformationModel
Data Set: Not Present
Releasing Association

C:\home>
_____________________________________________________________

I omit the surnames, of course. I noted that spaces are replaced by the symbol ^
Thanks to -X option, I obtain the files named "rsp0001.dcm","rsp0002.dcm".... which
contain the patientsname, patientid...and other. I can read each rsp000x.dcm using dcmdump.

Can dcmdump generate a file which contains the dump? (I didn't find the option in the help documentation...but I'm tired...)

The rsp000x.dcm files mentioned above shoud be 9 (because in ACME_STORE there are 9 files) but they are 7. Why?
Two .dcm files have the same patientsname and patientsid. Is it a possible answer?

This is the answer of dcmqrscp:
_____________________________________________________________

C:\home>dcmqrscp -v 104
Association Received (localhost:FINDSCU -> ACME_STORE) Tue Mar 07 21:27:36 2006
Association Acknowledged (Max Send PDV: 16372)
WARING: maxStudiesPerStorageArea too large
setting to 500
Received Find SCP: C-Find RQ: MsgID: 1
AffectedSOPClassUID: =FINDPatientRootQueryRetrieveInformationModel
Priority: 2
Data Set: Present
Find SCP Request Identifiers:

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT] # 8, 1 QueryRetrieveLe
vel
(0010,0010) PN (no value available) # 0, 0 PatientName
(0010,0020) LO (no value available) # 0, 0 PatientID
Find SCP Response 1 [status: Pending]
Find SCP Response 2 [status: Pending]
Find SCP Response 3 [status: Pending]
Find SCP Response 4 [status: Pending]
Find SCP Response 5 [status: Pending]
Find SCP Response 6 [status: Pending]
Find SCP Response 7 [status: Pending]
Find SCP Response 8 [status: Success]
Association Release
_____________________________________________________________

Tomorrow, I hope to learn how MOVESCU work...but I think that I will need of you again :-)

Thank you so much Mr. Sabin.

Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

Re: good news

#18 Post by Markus Sabin »

Good morning Orazio,
horus wrote: [...]
Can dcmdump generate a file which contains the dump? (I didn't find the option in the help documentation...but I'm tired...)
Yes. Actually this is the only thing dcmdump is useful for.
horus wrote: The rsp000x.dcm files mentioned above shoud be 9 (because in ACME_STORE there are 9 files) but they are 7. Why?
Two .dcm files have the same patientsname and patientsid. Is it a possible answer?
Yes. As you have specified PATIENT as the QueryRetrieveLevel, each patient record in the system is transferred only once. If you want to receive one reply for each image, you have to set the QueryRetrieveLevel to IMAGE.
horus wrote: Tomorrow, I hope to learn how MOVESCU work...but I think that I will need of you again :-)
Movescu works quite similar as findscu does. E.g. you could directly use the datasets returned by C-Find as an input to C-Move to order all images related to the patient entry. As I wrote before, you should check the contents of the Host-table carefully and make sure that you have a storescp running that can receive the images.

Good luck

Markus

horus
Posts: 20
Joined: Fri, 2006-02-24, 19:33

I tried movescu

#19 Post by horus »

Dear Markus,

It's time to move a dicom file!

I used the following command line for movescu:

_____________________________________________________________
movescu -aec ACME_STORE -aem ACME_COPY localhost 104 rsp0004.dcm
pause
_____________________________________________________________

I use as query-file rsp0004.dcm, generated by findscu in the previous demo, instead of creating a new move_query.dcm file.

ACME_COPY is the AE where I want to move the selected file by movescu and query-file rsp0004.dcm. The associated directory is c:\ACME_COPY

The directory associated with ACME_COPY must be written in the configuration file of the SCP counterpart.

I'm working in localhost.

I use dcmqrscp as SCP counterpart with the following configuration:
_____________________________________________________________
# Global Configuration Parameters
NetworkType = "tcp"
NetworkTCPPort = 104
MaxPDUSize = 8192
MaxAssociations = 20
Display = "yes"
#---------------------------------------
HostTable BEGIN

echoscu = (ECHOSCU, localhost, 104)
findscu = (FINDSCU, localhost, 104)
movescu = (MOVESCU, localhost, 104)
storescu = (STORESCU, localhost, 104)
storescp = (STORESCP, localhost, 104)

ANY = echoscu, findscu, movescu, storescu, storescp

HostTable END
#---------------------------------------
VendorTable BEGIN

"DCMTK AEC"=ANY
"DCMTK AET"=ANY

VendorTable END
#---------------------------------------
AETable BEGIN

COMMON c:\home\dicom\COMMON RW (200, 1024mb) ANY
ACME_STORE c:\home\dicom\ACME_STORE RW (1000, 1024mb) ANY
ACME_COPY c:\ACME_COPY RW (1000, 1024mb) ANY
UNITED_STORE c:\home\dicom\UNITED_STORE RW (1000, 1024mb) ANY
AETable END
_____________________________________________________________

I obtain this terrific result:
_____________________________________________________________

C:\home>dcmqrscp -v 104
Association Received (localhost:MOVESCU -> ACME_STORE) Wed Mar 08 12:22:31 2006
Association Acknowledged (Max Send PDV: 16372)
WARING: maxStudiesPerStorageArea too large
setting to 500
Assertion failed: !(pos >= this->size()), file ..\..\..\dcmtk\ofstd\include\dcmtk/ofstd/ofstring.h, line 375
_____________________________________________________________
C:\home>movescu -aec ACME_STORE -aem ACME_COPY localhost 104 rsp0005.dcm
movescu: Move Failed:
0006:0317 Peer aborted Association (or never connected)

C:\home>pause
Press any key to continue . . .
_____________________________________________________________


I think that I can't use dcmqrscp... what application can I use as SCP counterpart?

However.... what's wrong?

Thank you, Markus.

Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

#20 Post by Markus Sabin »

Sorry, Orazio,

this seems to be the database-connection about which I mentioned that I am not familiar with. No idea what could be going wrong. The warning suggests to me that it might help to reduce the number of files in the storage.

Regards

Markus

horus
Posts: 20
Joined: Fri, 2006-02-24, 19:33

HEEEEELP !!!!!!!!

#21 Post by horus »

Dear Markus,

which other application can I use as SCP counterpart for movescu?

Can you ask to a collegue specialized in this part of DCMTK?

The help documentation isn't so clear about C-move message.


Pleeeeease ! :cry:

Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

#22 Post by Markus Sabin »

Orazio,

you could use imagectn, but it is more complex than dcmqrscp and I would guess that you will run into the same problem again.
What is probably missing is the QueryRetrieveLevel in your move-request, but I do not think that this causes the assertion failure.

The only guys I could ask are the OFFIS Team, so this forum is the right place to get the problem solved.

The only thing I can suggest is to reduce the pool size of dcmqrscp, for the warning message says that the limit is exceeded: "WARING: maxStudiesPerStorageArea too large
setting to 500 "

Good luck

Markus

horus
Posts: 20
Joined: Fri, 2006-02-24, 19:33

again HEEEELP!!!

#23 Post by horus »

Dear Markus,

the WARNING isn't a problem. I have already resolved it!

Now the problems are:

1)What SCP application I must use with movescu?
2)What options for movescu?

I noted that imagectn belongs to a previous version of DCMTK!!!!

Is it so difficult to move a dicom file in a "localhost" with DCMTK ???????? :shock:

I am very gratefull to you and Mr. Onken for the support and if I will make a study on medical imaging using DCMTK , I will cite you (and Michel) , DCMTK and the OFFIS Team in the acknowledgement section of an article for an international conference.

Now, even though I am a DUMMY in dicom protocol (less DUMMY in medical imaging :-) ) I feel to be near to the solution.

I have all: the .dcm files and rsp000x.dcm produced by findscu.

Can you ask someone to help me?????

PLEEEEEEEASE! :cry:

horus
Posts: 20
Joined: Fri, 2006-02-24, 19:33

another attempt

#24 Post by horus »

Dear Markus,

I made the following move_query.dcm:
________________________________________________________
# query patient names and IDs
(0008,0052) CS [PATIENT] # QueryRetrieveLevel
(0010,0020) LO [SMS511104] # PatientID
____________________________________________________

The PatientID should be enough to identify a file...one or more studies...

I obtain the following results:
________________________________________________________
C:\home>movescu -v -P -aec ACME_STORE -aem ACME_COPY localhost 104 move_query.dcm
Requesting Association
Association Accepted (Max Send PDV: 8180)
================================
Sending query file: move_query.dcm
Move SCU RQ: MsgID 1
Request:

# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0008,0052) CS [PATIENT] # 8, 1 QueryRetrieveLe
vel
(0010,0020) LO [SMS511104] # 10, 1 PatientID
________________________________________________________

C:\home>dcmqrscp -v 104
Association Received (localhost:MOVESCU -> ACME_STORE) Wed Mar 08 18:45:05 2006
Association Acknowledged (Max Send PDV: 16372)
Assertion failed: !(pos >= this->size()), file ..\..\..\dcmtk\ofstd\include\dcmtk/ofstd/ofstring.h, line 375
________________________________________________________


Why doesn't it work?????????

What's wrong??? :?

Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

#25 Post by Markus Sabin »

Orazio,

I have tried to reproduce your operations with our own DCMTK-354-based C-Find/C-Move Provider, and this works (as I had expected). The images are successfully transferred.
So your problem is definitely not related to the network communication but to the dcmqrscp-specific configuration and "database" (i.e. filesystem). I suggest that you play around with the configuration and the files in the pool. You could also ask the experts in comp.protocols.dicom.

Other free tools that could serve as a Query/Retrieve SCP are JDICOM and DCM4CHE, there are probably more, but they are not much easier to use than dcmqrscp.

If all this does not help, it is inevitable to perform a debug session with dcmqrscp. I have never used it and I am much too busy to set up a test environment nor do I know anybody who uses dcmqrscp except for the OFFIS team.

Regards

Markus

horus
Posts: 20
Joined: Fri, 2006-02-24, 19:33

new topic at comp.protocols.dicom !

#26 Post by horus »

Dear Markus,

"I have tried to reproduce your operations with our own ....."

Thank you, Thank you, Thank you again....

As you suggested, I' ll make a new topic on comp.protocols.dicom where I'll describe my configuration.

"If all this does not help, it is inevitable to perform a debug session with dcmqrscp"

Do you think that there is a bug in dcmqrscp????? :shock:

Thank you,again.

Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

Re: new topic at comp.protocols.dicom !

#27 Post by Markus Sabin »

Orazio,
horus wrote: Do you think that there is a bug in dcmqrscp????? :shock:
Well, the totally bug-free software is still to be developed ;-)
But dcmqrscp is certainly capable of performing a trivial C-Find/C-Move operation. I rather suspect that something in your configuration is wrong. I have experienced before, that the dcmtk-procedures that handle configuration files expect a syntactically and semantically correct configuration file and have only little support for finding errors in that area (other than the core network routines that really tell you everything you need to know to find out what is going wrong).

Regards and good luck with your newsgroup task!

Markus

xiaozhudafeng
Posts: 1
Joined: Mon, 2010-04-19, 09:13

#28 Post by xiaozhudafeng »

Michael Onken wrote:Hallo,

this is not your fault;) There is an error regarding the --key option in findscu / movescu in DCMTK 3.5.4. You'll get an email containing a patch in a few minutes.

Regards,
Michael

I ran into the same problem, can you send me a patch too?
thank you.

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

#29 Post by Michael Onken »

Well, that's a classic :-) Check the --key FAQ entry for a link. Or download more current version (search for DCMTK snapshot).

Best regards,
michael

Post Reply

Who is online

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