Mercurial > hg > orthanc-book
comparison Sphinx/source/plugins/worklists-plugin.rst @ 64:a3df3c2b68cf
import the documentation of the Worklists sample plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 22 Nov 2016 13:02:56 +0100 |
parents | a52f1dc48ebc |
children | 468cb58b702a |
comparison
equal
deleted
inserted
replaced
63:34ccc7fc7ef3 | 64:a3df3c2b68cf |
---|---|
2 | 2 |
3 | 3 |
4 Sample Modality Worklists plugin | 4 Sample Modality Worklists plugin |
5 ================================ | 5 ================================ |
6 | 6 |
7 This page describes the **official sample plugin** turns Orthanc into | 7 This page describes the **official sample plugin** turning Orthanc |
8 a server of DICOM worklists. The worklists must be provided in some | 8 into a server of DICOM worklists. General information about how |
9 folder of the filesystem by an external script. | 9 Orthanc supports DICOM worklists through plugins is explained in the |
10 :ref:`FAQ <worklist>`. | |
11 | |
12 The sample plugin will serve the worklists stored in some folder on | |
13 the filesystem. This mimics the behavior of the ``wlmscpfs`` | |
14 command-line tool from the `DCMTK software | |
15 <http://support.dcmtk.org/docs/wlmscpfs.html>`__. | |
16 | |
17 The worklists to be served must be put inside the folder of interest | |
18 by an external application or script. ``dump2dcm`` might be a very | |
19 `useful companion tool | |
20 <http://support.dcmtk.org/docs/dump2dcm.html>`__ to generate such | |
21 worklist files. Whenever a C-Find SCP request is issued to Orthanc, | |
22 the plugin will read the content of the folder of interest to locate | |
23 the worklists that match the request. As a consequence, the external | |
24 application can dynamically modify the content of this folder while | |
25 Orthanc is running to add/remove worklists. | |
10 | 26 |
11 The source code of this sample plugin is `available in the source | 27 The source code of this sample plugin is `available in the source |
12 distribution of Orthanc | 28 distribution of Orthanc |
13 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__ | 29 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__ |
14 (GPLv3 license). The plugin will serve the worklists stored in some | 30 (GPLv3+ license). |
15 folder on the filesystem. This mimics the behavior of the ``wlmscpfs`` | |
16 command-line tool from the `DCMTK software | |
17 <http://support.dcmtk.org/docs/wlmscpfs.html>`__. ``dump2dcm`` might | |
18 be a very `useful companion tool | |
19 <http://support.dcmtk.org/docs/dump2dcm.html>`__ to feed the sample | |
20 plugin with worklists for some separate maintenance script. | |
21 | |
22 General information about the support of DICOM worklists in Orthanc is | |
23 explained in the :ref:`FAQ <worklist>`. | |
24 | 31 |
25 | 32 |
33 Basic configuration | |
34 ------------------- | |
26 | 35 |
27 How should I use it ? | 36 .. highlight:: json |
28 --------------------- | |
29 | 37 |
30 - download `DCMTK utilities <http://dicom.offis.de/download/dcmtk/release/bin/>`__ | 38 1. First, generate the :ref:`default configuration of Orthanc <configuration>`. |
31 - download sample `worklist files <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__ from the Orthanc source code and copy them in a dedicated folder. | 39 2. Then, modify the ``Plugins`` option to point to the folder containing |
40 the shared library of the plugin. | |
41 3. Finally, create a section "ModalityWorklists" in the configuration | |
42 file to configure the worklist server. | |
43 | |
44 A basic configuration would read as follows:: | |
45 | |
46 { | |
47 [...] | |
48 "Plugins" : [ | |
49 "." | |
50 ], | |
51 "Worklists" : { | |
52 "Enable": true, | |
53 "Database": "./WorklistsDatabase" | |
54 } | |
55 } | |
56 | |
57 The folder ``WorklistsDatabase`` of the `source distribution of | |
58 Orthanc | |
59 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__ | |
60 contains a database of sample worklists, that comes from the DCMTK | |
61 source distribution, as described in the `FAQ entry #37 of the DCMTK | |
62 project <http://forum.dcmtk.org/viewtopic.php?t=84>`__. | |
63 | |
64 | |
65 Tutorial | |
66 -------- | |
32 | 67 |
33 .. highlight:: javascript | 68 .. highlight:: javascript |
34 | 69 |
35 - Enable the ModalityWorklist plugin in your config.json by adding this section:: | 70 - Download `DCMTK utilities |
71 <http://dicom.offis.de/download/dcmtk/release/bin/>`__. | |
72 - Download sample `worklist files | |
73 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__ | |
74 from the Orthanc source code and copy them in a dedicated folder. | |
75 - Generate the :ref:`default configuration of Orthanc <configuration>`. | |
76 - Enable the ModalityWorklist plugin in your configuration file by adding this section:: | |
36 | 77 |
37 "Worklists" : { | 78 "Worklists" : { |
38 "Enable": true, | 79 "Enable": true, |
39 "Database": "WorklistsDatabase" //this is the path to the folder with the worklist files. Use absolute path ! | 80 "Database": "WorklistsDatabase" // Path to the folder with the worklist files |
40 }, | 81 }, |
41 | 82 |
42 - Add the plugin to the list of plugins to load (this is an example for Windows):: | 83 - Add the plugin to the list of plugins to load (this is an example |
84 for Microsoft Windows):: | |
43 | 85 |
44 "Plugins" : [ | 86 "Plugins" : [ |
45 "OsimisWebViewer.dll", | 87 "OsimisWebViewer.dll", |
46 "ModalityWorklists.dll" // on GNU/Linux, use ModalityWorklists.so | 88 "ModalityWorklists.dll" // On GNU/Linux, use libModalityWorklists.so |
47 ], | 89 ], |
48 | 90 |
49 - Add the findscu utility to the list of know modalities (considering findscu and Orthanc runs on the same machine):: | 91 - The tests below will be done using the ``findscu`` command-line tool |
92 from the `DCMTK utilities | |
93 <http://support.dcmtk.org/docs/findscu.html>`__. Assuming | |
94 ``findscu`` and Orthanc runs on the same computer (i.e. on the | |
95 ``127.0.0.1`` localhost), declare the ``FINDSCU`` AET to the list of | |
96 know modalities:: | |
50 | 97 |
51 "DicomModalities" : { | 98 "DicomModalities" : { |
52 "horos" : [ "HOROS", "192.168.0.8", 11112 ], | 99 "horos" : [ "HOROS", "192.168.0.8", 11112 ], |
53 "findscu" : [ "FINDSCU", "127.0.0.1", 1234 ] | 100 "findscu" : [ "FINDSCU", "127.0.0.1", 1234 ] |
54 }, | 101 }, |
55 | 102 |
56 .. highlight:: bash | 103 .. highlight:: bash |
57 | 104 |
58 - Launch Orthanc as usual, make sure to pass him the configuration file (ex for Windows):: | 105 - Launch Orthanc as usual, making sure to give the proper |
106 configuration file (e.g. for Microsoft Windows):: | |
59 | 107 |
60 Orthanc.exe config.json | 108 Orthanc.exe config.json |
61 | 109 |
62 - In a prompt, launch a findscu request to ask Orthanc to return all Worklists for 'CT' modalities (considering findscu and Orthanc both runs on your machine: 127.0.0.1 is the Orthanc url and 4242 is the Orthanc DICOM port):: | 110 - In another command-line prompt, launch a ``findscu`` request to ask |
111 Orthanc to return all worklists for ``CT`` modalities:: | |
63 | 112 |
64 findscu -W -k "ScheduledProcedureStepSequence[0].Modality=CT" 127.0.0.1 4242 | 113 findscu -W -k "ScheduledProcedureStepSequence[0].Modality=CT" 127.0.0.1 4242 |
65 | 114 |
66 - findscu should display the matching worklists | 115 The ``-W`` option makes ``findscu`` issue a DICOM worklist query, |
116 the ``-k`` option specifies the query of interest, ``127.0.0.1`` | |
117 corresponds to the localhost, and ``4242`` corresponds to the | |
118 default DICOM TCP port of Orthanc. | |
67 | 119 |
68 How can I create worklist files ? | 120 - ``findscu`` will display the matching worklists. |
69 --------------------------------- | |
70 | 121 |
71 - let's start from an existing `worklist file <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__. | |
72 | 122 |
73 - dump the sample worklist file to a DCMTK dump file:: | 123 How to create a worklist file |
124 ----------------------------- | |
125 | |
126 .. highlight:: bash | |
127 | |
128 - Start with an existing worklist file, some samples of which can be | |
129 found in the `Orthanc source distribution | |
130 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/WorklistsDatabase/>`__ | |
131 (with ``.wl`` file extensions). | |
132 - The worklist file is a DICOM file. Dump its content as a text file | |
133 using ``dcmdump``:: | |
74 | 134 |
75 dcmdump.exe wklist1.wl > sampleWorklist.txt | 135 dcmdump.exe wklist1.wl > sampleWorklist.txt |
76 | 136 |
77 - you'll get something like:: | 137 - The content of the just-generated ``sampleWorklist.txt`` file should |
138 look similar to this text file:: | |
78 | 139 |
79 # Dicom-File-Format | 140 # Dicom-File-Format |
80 | 141 |
81 # Dicom-Meta-Information-Header | 142 # Dicom-Meta-Information-Header |
82 # Used TransferSyntax: Little Endian Explicit | 143 # Used TransferSyntax: Little Endian Explicit |
99 (0010,2000) LO [METASTASIS] # 10, 1 MedicalAlerts | 160 (0010,2000) LO [METASTASIS] # 10, 1 MedicalAlerts |
100 (0010,2110) LO [TANTAL] # 6, 1 Allergies | 161 (0010,2110) LO [TANTAL] # 6, 1 Allergies |
101 (0020,000d) UI [1.2.276.0.7230010.3.2.101] # 26, 1 StudyInstanceUID | 162 (0020,000d) UI [1.2.276.0.7230010.3.2.101] # 26, 1 StudyInstanceUID |
102 (0032,1032) PN [SMITH] # 6, 1 RequestingPhysician | 163 (0032,1032) PN [SMITH] # 6, 1 RequestingPhysician |
103 (0032,1060) LO [EXAM6] # 6, 1 RequestedProcedureDescription | 164 (0032,1060) LO [EXAM6] # 6, 1 RequestedProcedureDescription |
104 (0040,0100) SQ (Sequence with explicit length #=1) # 176, 1 ScheduledProcedureStepSequence | |
105 (fffe,e000) na (Item with explicit length #=12) # 168, 1 Item | |
106 (0008,0060) CS [MR] # 2, 1 Modality | |
107 (0032,1070) LO [BARIUMSULFAT] # 12, 1 RequestedContrastAgent | |
108 (0040,0001) AE [AA32\AA33] # 10, 2 ScheduledStationAETitle | |
109 (0040,0002) DA [19951015] # 8, 1 ScheduledProcedureStepStartDate | |
110 (0040,0003) TM [085607] # 6, 1 ScheduledProcedureStepStartTime | |
111 (0040,0006) PN [JOHNSON] # 8, 1 ScheduledPerformingPhysicianName | |
112 (0040,0007) LO [EXAM74] # 6, 1 ScheduledProcedureStepDescription | |
113 (0040,0009) SH [SPD3445] # 8, 1 ScheduledProcedureStepID | |
114 (0040,0010) SH [STN456] # 6, 1 ScheduledStationName | |
115 (0040,0011) SH [B34F56] # 6, 1 ScheduledProcedureStepLocation | |
116 (0040,0012) LO (no value available) # 0, 0 PreMedication | |
117 (0040,0400) LT (no value available) # 0, 0 CommentsOnTheScheduledProcedureStep | |
118 (fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem | |
119 (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem | |
120 (0040,1001) SH [RP454G234] # 10, 1 RequestedProcedureID | 165 (0040,1001) SH [RP454G234] # 10, 1 RequestedProcedureID |
121 (0040,1003) SH [LOW] # 4, 1 RequestedProcedurePriority | 166 (0040,1003) SH [LOW] # 4, 1 RequestedProcedurePriority |
122 | 167 |
168 - Open ``sampleWorklist.txt`` file in a standard text editor so as to | |
169 modify, add or remove some DICOM tags depending on your needs. | |
170 - Generate a new DICOM worklist file from your modified file using | |
171 ``dump2dcm``:: | |
172 | |
173 dump2dcm.exe sampleWorklist.txt newWorklist.wl | |
123 | 174 |
124 - open sampleWorklist.txt file in a text editor and modify/add/remove some Dicom Tags | 175 - As a last step, copy that file in the folder where Orthanc searches |
125 | 176 for its worklist files. Of course, this worklist generation workflow |
126 - then, generate a new worklist file with dump2dcm:: | 177 can be automated using any scripting language. |
127 | |
128 dump2dcm.exe sampleWorklist.txt newWorklist.wl | |
129 | |
130 - copy that file in the folder where Orthanc searches for its worklist files and that's it ! | |
131 | |
132 - of course, you'll automate this worklist generation workflow with some scripting language. |