How to use storescu?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Aimevous
Posts: 37
Joined: Thu, 2008-05-15, 11:02

How to use storescu?

#1 Post by Aimevous »

Hi,

I am interested in created a GUI form of storescu.exe and was looking through the source (storescu.cc) but reached a dead end rather quickly.

The entire 2000-line source was a bit too long to individually read through line by line, but I did notice a bit of the organisation in place, though I'm not sure how to find stuffs still.

I skimmed through the top 1/3 of the code and all I gathered was that it was about handling the command line arguments?

I thought that perhaps I could find the code for relevant arguments by searching for the arguments. For example, I tried searching for "aet" to find out how the application title argument was used but all I could find was:

Code: Select all

Line 247:      cmd.addOption("--aetitle",              "-aet", 1, "aetitle: string", opt1.c_str());
and

Code: Select all

Line 251:      cmd.addOption("--call",                 "-aec", 1, "aetitle: string", opt2.c_str());
and

Code: Select all

Line 437      if (cmd.findOption("--aetitle")) app.checkValue(cmd.getValue(opt_ourTitle));
Are there something very important that I didn't pick up in the above code?

Please pardon my ignorance but I realise most of the source files for the exes are something like that. I feel lost when I look at them. Could anyone enlighten me as to how I can make use of the code efficiently?

Also, while reading http://support.dcmtk.org/docs/storescu.html, I noticed that there are 2 commands with regards to Application Title:
application entity titles:

-aet --aetitle aetitle: string
set my calling AE title (default: STORESCU)

-aec --call aetitle: string
set called AE title of peer (default: ANY-SCP)
Please pardon my ignorance again, but whats the difference?

Thanks!

Aimevous
Posts: 37
Joined: Thu, 2008-05-15, 11:02

#2 Post by Aimevous »

I was looking through the source for the storescu and cstore function and I noticed that there was one parameter called: *assoc

what is this?

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#3 Post by Per »

I think the aetitles are only used in text substitutions for the execute on study or instance options. See executeOnReception and executeOnEndOfStudy.

Aimevous
Posts: 37
Joined: Thu, 2008-05-15, 11:02

#4 Post by Aimevous »

Per wrote:I think the aetitles are only used in text substitutions for the execute on study or instance options. See executeOnReception and executeOnEndOfStudy.
sorry but where is that?

i did a search on storescu.cc but I can't find those 2 functions

btw, looking at the storescu() and cstore(), I am getting confused by the "*assoc".

What is "assoc"? What is an example parameter to use to call storescu() or cstore()??

Can anyone help?

Thanks!

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 »

Maybe, you should first read and understand the relevant parts of the DICOM standards before starting to implement a DICOM service. For example, the Application Entity Title (AET) is a symbolic name that is used to identify a DICOM service in the network.

Btw, a very simple example of an Echo SCU can be found in the documentation. Unfortunately, most network tools are not really easy to integrate into your own application because there is no wrapper class around the code. Anyway, the code of storescu is documented quite well, so it should be possible to extract the required parts with some effort.

ngladitz
Posts: 8
Joined: Wed, 2008-03-19, 13:22

#6 Post by ngladitz »

The opt_ variables contain the options set by the user via the command line (e.g. --aetitle sets opt_ourTitle) or some sensible default which is set at the top of storescu.cc (e.g. static OFBool opt_verbose = OFFalse;)

If you then look for opt_ourTitle you can see the dcmtk call that makes use of it:

Code: Select all

ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL);
The calling AE title is the name that storescu uses to introduce itself to the server to.
The called AE title is the name of the application entity which you want to talk to on the server.

"assoc" is short for association and represents a network connection.

You could read up on associations and application titles in the Philips DICOM Cook Book:
ftp://ftp.philips.com/pub/pms-3003/DICO ... okBook.pdf

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#7 Post by Per »

Aimevous wrote:
Per wrote:I think the aetitles are only used in text substitutions for the execute on study or instance options. See executeOnReception and executeOnEndOfStudy.
sorry but where is that?

i did a search on storescu.cc but I can't find those 2 functions
Thanks!
Oops, sorry, that is storescp. I never looked at the storescu code.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#8 Post by Marco Eichelberg »

Franky speaking I don't exactly understand what the original poster is looking for. If you are looking for "relevant arguments", I would say that all of them are relevant, otherwise we would not have implemented them. Some may br rarely used and some frequently, but they are all relevant, which is why they exist in the first place.

When reading the storescu.cc source code you will indeed see that 80% of the file is code for handling command line options. The network functions as such are mainly provided by the underlying library.

Post Reply

Who is online

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