Retrieve images using movescu/storescp

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
zagwin
Posts: 22
Joined: Wed, 2011-03-09, 03:13

Retrieve images using movescu/storescp

#1 Post by zagwin »

Dear DCMTKers:

I want to retrieve images from a remote server to local directory (just a directory of my harddisk, no pacs client/server in local machine) using movescu. I have 3 questions about this.

First, I found that I must start a storescp to store images to the specified directory, when I using movescu to retrieve images. Is this correct? the storescp is necessary?

Second, when I start the storescp, how to set the "port tcp/ip port number to listen on"? does this have relation with the configuration of the remote server? I used dcmqrscp to work as the remote server, and add the lines
move = (MOVESCU, name, 104)
store = (STORESCU,name, 1000)
I found that the port of storescp must be 104, otherwise, it will not work well. Is this correct?

Third, I found that movescu have an option "--output-directory", what is this? how to use it?

Thanks a lot
Matt

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

Re: Retrieve images using movescu/storescp

#2 Post by Michael Onken »

Hi Matt,
zagwin wrote:Dear DCMTKers:

I want to retrieve images from a remote server to local directory (just a directory of my harddisk, no pacs client/server in local machine) using movescu. I have 3 questions about this.

First, I found that I must start a storescp to store images to the specified directory, when I using movescu to retrieve images. Is this correct? the storescp is necessary?
No, you can start your own server within movescu. Just use movescu's --port option and movescu will use its own built-in storage server.
Second, when I start the storescp, how to set the "port tcp/ip port number to listen on"? does this have relation with the configuration of the remote server?
Yes. movescu only tells the server via DICOM protocol via a name (called AE title, or in this case move destination AE title), where to send the images. The PACS has to know the IP adress and port of that AE title. movescu might for example request to send the images not to "itself" but to any other system with the given AE title -- it just has to be configured as a receiver on the PACS. This is how DICOM works for MOVE.
I used dcmqrscp to work as the remote server, and add the lines
move = (MOVESCU, name, 104)
store = (STORESCU,name, 1000)
I found that the port of storescp must be 104, otherwise, it will not work well. Is this correct?
You only need one line for configuring your move target (i.e. the port and ip adress the move destination you use refers to; you can change the desired move destination in movescu with the --move option; enter there

symbolic name = (move destination AE title you use with movescu's --move option, host of the storage server, port of the storage server).
Third, I found that movescu have an option "--output-directory", what is this? how to use it?
This only has a meaning if you use the --port option to let movescu handle the receiving of objects. I guess then the meaning is clear... You can find documentation for dcmqrscpand movescu also online.

HTH,
Michael

zagwin
Posts: 22
Joined: Wed, 2011-03-09, 03:13

#3 Post by zagwin »

HI, Michael

Thanks very much for your clear and detail reply, I will try them soon and report the results. Thanks
Matt

zagwin
Posts: 22
Joined: Wed, 2011-03-09, 03:13

Re: Retrieve images using movescu/storescp

#4 Post by zagwin »

Michael Onken wrote:
Second, when I start the storescp, how to set the "port tcp/ip port number to listen on"? does this have relation with the configuration of the remote server?
Yes. movescu only tells the server via DICOM protocol via a name (called AE title, or in this case move destination AE title), where to send the images. The PACS has to know the IP adress and port of that AE title. movescu might for example request to send the images not to "itself" but to any other system with the given AE title -- it just has to be configured as a receiver on the PACS. This is how DICOM works for MOVE.
I used dcmqrscp to work as the remote server, and add the lines
move = (MOVESCU, name, 104)
store = (STORESCU,name, 1000)
I found that the port of storescp must be 104, otherwise, it will not work well. Is this correct?
You only need one line for configuring your move target (i.e. the port and ip adress the move destination you use refers to; you can change the desired move destination in movescu with the --move option; enter there

symbolic name = (move destination AE title you use with movescu's --move option, host of the storage server, port of the storage server).

I used dcmqrscp as the remote pacs sever, and the dcmqrscp.cfg seems like this:
------------------------------------------------------------------------------------
# Global Configuration Parameters
#
NetworkTCPPort = 5678
MaxPDUSize = 16384
MaxAssociations = 16
.....
HostTable BEGIN
echo = (ECHOSCU, localhost, 2345)
query = (FINDSCU, localhost, 5678)
move = (MOVESCU, localhost, 104)
store = (STORESCU,localhost, 1000)
#
HostTable END
.....
AETable BEGIN
COMMON D:\COMMON RW (200, 1024mb) ANY
AETable END
------------------------------------------------------------------------------------

When I use movescu/storescp to retrieve images, I used them like:

movescu -v -S 127.0.0.1 5678 -aec COMMON -k 0008,0052=SERIES qry_all.dcm +xa -k 0020,000e="xxxx"
and
storescp -v 104 --output-directory D:\recv\ -xf storescp.cfg Default -sp

They work perfect, however, when I changed storescp like
storescp -v 106 --output-directory D:\recv\ -xf storescp.cfg Default -sp
It does NOT work.

I found the port of STORESCP must match the port of MOVESCU in HostTable of dcmqrscp.cfg. Why this?

I think usually we just need to know the "NetworkTCPPort = 5678", only one port. However, if I use movescu/storescp together, it seems I must know two ports, am I correct?

Thanks very much, sorry for the long post.
Matt

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

Re: Retrieve images using movescu/storescp

#5 Post by Michael Onken »

Hi Matt,
zagwin wrote: I found the port of STORESCP must match the port of MOVESCU in HostTable of dcmqrscp.cfg. Why this?
You start movescu without giving a concrete "move destination ae title", so movescu uses "MOVESCU" as a default. So the PACS is said to send the images to MOVESCU. Then it looks up which system (host, port) is meant with MOVESCU. So it finds the line where you specify MOVESCU, grabs "localhost, 104" and sends the images there. This is the port where you have storescp running.

So, if you change the port of storescp to 106, you have to change the "move destination AE title" of "MOVESCU" to the same port. The PACS just looks up the move destination AE title it is told in the C-MOVE request send by MOVESCU. That is the only information where it defers from, where to send the images.
I think usually we just need to know the "NetworkTCPPort = 5678", only one port. However, if I use movescu/storescp together, it seems I must know two ports, am I correct?
There are just two ports in your whole setup that are interesting. The first is where the PACS listens for requests (C-STORE, C-FIND, C-MOVE), and this is set by the commandline parameter or in the very beginning of the configuration file (under section "Global Configuration Parameters"). If you would not be interested to receive files, then this one port would be enough.

However, if you send a MOVE request for a download of objects, then the PACS always opens up a second TCP/IP (and therefore DICOM) connection. Theoretically, ANY IP adress and ANY port is possible, not only the one from the caller. The requester only tells the PACS the ae title where to send the objects to. So you have to setup a receiver on a host and a port and tell the PACS about it by configuring every possible receiver's AE title with IP and port.

Got it :-)?

Best regards,
Michael

zagwin
Posts: 22
Joined: Wed, 2011-03-09, 03:13

#6 Post by zagwin »

HI, Michael,

Finally, I understand the MOVESCU, Thanks so much for you clear explanation. I know how to do this now.

Thanks
Matt

Post Reply

Who is online

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