File: gdcmscu.dox

package info (click to toggle)
gdcm 2.4.4-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 32,868 kB
  • sloc: cpp: 188,481; ansic: 124,526; xml: 41,799; sh: 7,162; python: 3,667; cs: 2,128; java: 1,344; lex: 1,290; tcl: 677; php: 128; makefile: 116
file content (341 lines) | stat: -rw-r--r-- 10,899 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/*!

\page gdcmscu Tool to execute a DICOM Query/Retrieve operation

\section synopsis SYNOPSIS

\verbatim
gdcmscu [OPTION]...[OPERATION]...HOSTNAME...[PORT]...
\endverbatim
Execute a DICOM Q/R operation to HOSTNAME, using port PORT (104 when not specified)

\section description DESCRIPTION

The \b gdcmscu command line program is the tool to execute DICOM Query/Retrieve operation.
It supports:
\li C-ECHO (SCU)
\li C-FIND (SCU)
\li C-STORE (SCU)
\li C-MOVE (SCU/SCP)
C-MOVE operation are executed using two different ports (one for the SCU and one for the SCP).

\section parameters PARAMETERS

\section options OPTIONS

\subsection options options
\verbatim
  -H --hostname    %s  Hostname.
  -p --port        %d  Port number.
     --aetitle     %s  Set calling AE Title.
     --call        %s  Set called AE Title.
\endverbatim

\subsection mode_options mode options
\verbatim
     --echo           C-ECHO (default when none).
     --store          C-STORE.
     --find           C-FIND.
     --move           C-MOVE.
\endverbatim

\subsection cstore_options C-STORE options
\verbatim
  -i --input       %s   DICOM filename
  -r --recursive        recursively process (sub-)directories
     --store-query %s   Store constructed query in file
\endverbatim

\subsection cfind_options C-FIND/C-MOVE options
\verbatim
     --patientroot       C-FIND Patient Root Model.
     --studyroot         C-FIND Study Root Model.

     --patient           C-FIND Query on Patient Info (cannot be used with --studyroot).
     --study             C-FIND Query on Study Info.
     --series            C-FIND Query on Series Info.
     --image             C-FIND Query on Image Info.
     --key   %d,%d[=%s]  0123,4567=VALUE for specifying search criteria (wildcard allowed)
                         With --key, leave blank (ie, --key 10,20="" or --key 10,20) to retrieve values
\endverbatim

\subsection cmove_options C-MOVE options
\verbatim
  -o --output    %s      DICOM filename / directory
     --port-scp  %d      Port for incoming associations
     --key   %d,%d[=%s   0123,4567=VALUE for specifying search criteria (wildcard not allowed)
                         Note that C-MOVE supports the same queries as C-FIND, but no wildcards are allowed
\endverbatim

\subsection general_options general options
\verbatim
  -h   --help
         print this help text and exit

  -v   --version
         print version information and exit

  -V   --verbose
         verbose mode (warning+error).

  -W   --warning
         warning mode, print warning information

  -E   --error
         error mode, print error information

  -D   --debug
         debug mode, print debug information

  -L   --log-file
         specify a filename where to write logs

  --queryhelp
         print query help
\endverbatim

\subsection environment_variable environment variable
\verbatim
  GDCM_ROOT_UID Root UID
\endverbatim

\section cecho_usage C-ECHO usage

\b gdcmscu is a great tool to test if a DICOM server is up. For example to send
a C-ECHO to server dicom.example.com using port 104, use:

\verbatim
$ gdcmscu dicom.example.com
\endverbatim

or if you prefer being explicit:

\verbatim
$ gdcmscu --echo dicom.example.com 104
\endverbatim

Using basic security your DICOM server might require that you set the
appropriate called AE-TITLE

\verbatim
$ gdcmscu --echo dicom.example.com 11112 --call SERVSCP
\endverbatim

If you want to specifiy your own AE-TITLE (default is GDCMSCU), simply use:

\verbatim
$ gdcmscu --echo dicom.example.com 11112 --call SERVSCP --aetitle MYSCU
\endverbatim

For example you could test on the DICOM server provided by DICOMObject team:

\verbatim
$ gdcmscu www.dicomserver.co.uk 11112
\endverbatim

\section cstore_usage C-STORE usage

C-STORE is the operation that allow sending a DICOM file to a remote DICOM
server. For instance to send a file called myfile.dcm

\verbatim
$ gdcmscu --store dicom.example.com 104 myfile.dcm
\endverbatim

or if you prefer being explicit:

\verbatim
$ gdcmscu --store dicom.example.com 104 -i myfile.dcm
\endverbatim

You can even send multiple files using the same association:

\verbatim
$ gdcmscu --store dicom.example.com 104 myfile1.dcm myfile2.dcm myfile3.dcm ...
\endverbatim

\section cfind_usage C-FIND usage

\b gdcmscu also allow querying a DICOM server. This is the C-FIND operation,
for example to find all DICOM Instance where PatientsName match a particular
pattern, usage is simply:

\verbatim
$ gdcmscu --find --patient dicom.example.com 11112 --patientroot --key 10,10,"A*"
\endverbatim

We also support a DCMTK compatible convention:

\verbatim
$ gdcmscu --find --patient dicom.example.com 11112 --patientroot --key 10,10="A*"
\endverbatim

When an attribute is set without a value it will be part of the output result:

\verbatim
$ gdcmscu --find --patient dicom.example.com 11112 --call MI2B2 --patientroot -k 10,10="A*" -k 10,20
\endverbatim

\section cmove_usage C-MOVE usage

C-MOVE is the operation to retrieve a DICOM instance from a remote DICOM
server. Most of the time, it is a subsequent operation after a C-FIND query.
To retrieve a DICOM instance where PatientID is ABCD1234, simply execute:

\verbatim
$ gdcmscu --move --patient --aetitle ACME1 --call ACME_STORE dicom.example.com 5678 --patientroot -k 10,20="ABCD1234" --port-scp 1234
\endverbatim

WARNING For this operation to work you need information from the DICOM server
you are communicating with. Only the DICOM server you are sending a C-MOVE
query will be responsible for sending back incoming associations (the actual
C-STORE SCP).
Therefore you need to make sure that you mapping of (AE-TITLE,PortNumber) is
properly set on the DICOM server side as well as the port for incoming
association (--port-scp).

\b gdcmscu does not currently support external C-STORE association (C-STORE
request sent to an external SCP application).

\section patientroot_notes patientroot notes

The flag --patientroot is just simply a wrapper around the syntax --key 8,52=PATIENT
For instance one would write using DCMTK syntax:

\verbatim
$ findscu --patient dicom.example.com 11112 --key 8,52=PATIENT --key 10,10="F*"
\endverbatim

This would become using GDCM syntax:

\verbatim
$ gdcmscu --find --patient dicom.example.com 11112 --patientroot --key 10,10="F*"
\endverbatim

\section debugging Debugging

This is sometime difficult to investigate why a connection to a remote DICOM server
cannot be done. Some recommendations follows:

Always try to do a simple C-ECHO at first. If you cannot get the C-ECHO to work
none of the other operations will work

Before trying to a C-MOVE operation, make sure you can execute the C-FIND equivalent
query first.

When doing a C-MOVE operation you really need to communicate with the PACS
admin as the C-MOVE operation is different from the other lower level operation
such as HTTP/GET.  When doing a C-MOVE, the server will communicate back using
another channel (could be different port) using it's internal database to map
an AE-TITLE back to the destination IP.

Indeed the C-MOVE operation by design does not always use your incoming IP
address to send back the resulting dataset. Instead it uses a mapping of
AE-TITLE to IP address to send back any results. So pay particular attention to
the spelling of your AE-TITLE and your incoming port (which may be different
from the port to connect to the server).

\section gdcmscu_portwarnings Port Warning

Watch out that port ranging [1-1024] are reserved for admin and not easily
accessible unless granted special privileges. Therefore the default 104 DICOM
port might not be accessible to all your users.

\section gdcmscu_ctorewarnings C-STORE Warnings

When constructing a C-STORE operation, gdcmscu will always use the Media
Storage SOP Class UID as found in the file to be sent. For encapsulated DICOM
file (eg. RLE Lossless) the receiving SCP server might not support this
compression and will legitimately refuse the C-STORE operation. In this case
users have to manually convert to a non-compressed form this particular file:

\verbatim
$ gdcmconv --raw compressed.dcm non_compressed.dcm
\endverbatim

\section gdcmscu_cmovewarnings C-MOVE Warnings

At the moment \b gdcmscu only supports non-compressed transfer syntax. It will
always request DataSet using Implicit VR Little Endian Transfer Syntax during a
C-MOVE operation (both incoming and outgoing associations). This make gdcmscu
--move equivalent to DCMTK movescu syntax:

\verbatim
$ movescu -xi +xi ...
\endverbatim

\section gdcmscu_cfind_image C-FIND IMAGE level (Composite Object Instance)

One should pay attention that gdcmscu --find and findscu are not completely
equivalent. Using gdcmscu --find, all Unique Keys will be added automatically.
One can therefore execute something like this:

\verbatim
$ gdcmscu --find --patientroot --image --key 8,18=1.2.3.4.5.6 dicom.example.com 11112
\endverbatim

instead of the more explicit form

\verbatim
$ gdcmscu --find --patientroot --image --key 8,18=1.2.3.4.5.6 dicom.example.com 11112 --key 10,20 --key 20,d --key 20,e
\endverbatim

This would also be equivalent to:

\verbatim
$ findscu --patient --key 8,52=IMAGE --key 8,18=1.2.3.4.5.6 dicom.example.com 11112 --key 10,20 --key 20,d --key 20,e
\endverbatim

\section gdcmscu_storing Storing the Query

It is also possible to store the query:

\verbatim
gdcmscu --find --patient --patientroot dicom.example.com 11112 --key 10,20="*" --key 10,10 --store-query query.dcm
\endverbatim

One can then check the DataSet values send for the query:

\verbatim
$ gdcmdump query.dcm
# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax:

# Dicom-Data-Set
# Used TransferSyntax: 1.2.840.10008.1.2
(0008,0005) ?? (CS) [ISO_IR 192]                                  # 10,1-n Specific Character Set
(0008,0052) ?? (CS) [PATIENT ]                                    # 8,1 Query/Retrieve Level
(0010,0010) ?? (PN) (no value)                                    # 0,1 Patient's Name
(0010,0020) ?? (LO) [* ]                                          # 2,1 Patient ID
\endverbatim

The Specific Character Set was set to "ISO_IR 192" as the locale encoding of
the system was found automatically by gdcmscu to be UTF-8.

This means that the following command line will properly setup the Query with
the appropriate Charset to be executed correctly:

\verbatim
$ gdcmscu --find --patient --patientroot dicom.example.com 11112 --key 10,10="*Jérôme*"
\endverbatim

The query is always executed on the server side (SCP), some implementations
does not support string matching with different Character Set.

\section public_servers DICOM Public Servers

An up to date list of DICOM Public Servers can be found at:

http://www.dclunie.com/medical-image-faq/html/part8.html#DICOMPublicServers

\section see_also SEE ALSO

<b>gdcmconv</b>(1)

\section copyright COPYRIGHT

Copyright Insight Software Consortium

*/