annotate Sphinx/source/faq/dcmtk-tricks.rst @ 544:d7ec7ea133b8

note about nginx to emulate dicom tls
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Nov 2020 09:26:24 +0100
parents 0a73844cc5bc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
332
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _dcmtk-tricks:
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 Some tricks with DCMTK
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ======================
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 .. contents::
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 :depth: 3
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 Sending uncommon or recent SOP class UIDs
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 -----------------------------------------
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 On many systems, the ``storescu`` command from the `DCMTK project
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 <https://support.dcmtk.org/docs/storescu.html>`__ is not configured
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 out-of-the-box to send uncommon/recent SOP class UIDs or transfer
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 syntaxes. You might have to fine-tune the default configuration file
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 of ``storescu`` in order to be able to send e.g. MPEG4 videos or
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 breast tomosynthesis images.
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 .. highlight:: text
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 For instance, here is the result of sending one MPEG4 video on a
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 Ubuntu 18.04 box::
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 $ storescu localhost 4242 XC000000.dcm
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 E: No presentation context for: (VVp) 1.2.840.10008.5.1.4.1.1.77.1.4.1
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 E: Store SCU Failed: 0006:0208 DIMSE No valid Presentation Context ID
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 This error message is unrelated to Orthanc (especially if you have set
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 the :ref:`configuration option <configuration>`
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 ``UnknownSopClassAccepted`` to ``true``). To properly adapt the
333
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 332
diff changeset
31 configuration file, first determine the value of the DICOM tag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 332
diff changeset
32 ``SOPClassUID`` (0008,0016) and the transfer syntax of the file, which
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 332
diff changeset
33 can be done by using the ``dcm2xml`` command-line tool::
332
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 $ dcm2xml XC000000.dcm | grep -E 'data-set xfer|"SOPClassUID"'
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 <data-set xfer="1.2.840.10008.1.2.4.102" name="MPEG-4 AVC/H.264 High Profile / Level 4.1">
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 <element tag="0008,0016" vr="UI" vm="1" len="32" name="SOPClassUID">1.2.840.10008.5.1.4.1.1.77.1.4.1</element>
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 Secondly, create a copy of the default ``storescu.cfg`` configuration
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 file, e.g. on Ubuntu 18.04::
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 $ cp /etc/dcmtk/storescu.cfg /tmp/storescu.cfg
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 Edit this file so as to replace one of the 128 preconfigured
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 presentation contexts, using this information::
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 $ diff /etc/dcmtk/storescu.cfg storescu.cfg
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 198c198
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 < PresentationContext128 = VideoPhotographicImageStorage\MPEG2
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 ---
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 > PresentationContext128 = 1.2.840.10008.5.1.4.1.1.77.1.4.1\MPEG4
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 Obviously, you can replace more predefinitions if other pairs of SOP
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 class UID and transfer syntax are needed. Finally, run ``storescu``
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 using this new configuration::
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 $ storescu -xf /tmp/storescu.cfg Default localhost 4242 XC000000.dcm
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 Note that the ``storescu`` command from the `dcm4che project
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 <https://www.dcm4che.org/>`__ might be more easy to use in such
7b093bebb562 storescu trick
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 situations.