comparison Sphinx/source/faq/dcmtk-tricks.rst @ 332:7b093bebb562

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