Mercurial > hg > orthanc-book
comparison Sphinx/source/users/anonymization.rst @ 0:901e8961f46e
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 Apr 2016 12:57:38 +0200 |
parents | |
children | eaec5029ef01 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:901e8961f46e |
---|---|
1 .. highlight:: bash | |
2 .. _anonymization: | |
3 | |
4 Anonymization and modification | |
5 ============================== | |
6 | |
7 .. contents:: | |
8 :depth: 2 | |
9 | |
10 Orthanc 0.5.0 introduces the anonymization of DICOM resources | |
11 (i.e. patients, studies, series or instances). This page summarizes | |
12 how to use this feature. | |
13 | |
14 | |
15 Anonymization of a Single Instance | |
16 ---------------------------------- | |
17 | |
18 Orthanc allows to anonymize a single DICOM instance and to download | |
19 the resulting anonymized DICOM file. Anonymization consists in erasing | |
20 all the tags that are specified in Table E.1-1 from PS 3.15 of the | |
21 DICOM standard 2008. Example:: | |
22 | |
23 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{}' > Anonymized.dcm | |
24 | |
25 It is possible to control how anonymization is achieved by specifying | |
26 a JSON body:: | |
27 | |
28 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{"Replace":{"PatientName":"hello","0010-0020":"world"},"Keep":["StudyDescription", "SeriesDescription"],"KeepPrivateTags": null}' > Anonymized.dcm | |
29 | |
30 Explanations: | |
31 | |
32 * New UUIDs are automatically generated for the study, the series and | |
33 the instance. | |
34 * The DICOM tags can be specified either by their name (``PatientName``) | |
35 or by their hexadecimal identifier (``0010-0020`` corresponds to | |
36 ``PatientID``). | |
37 * ``Replace`` is an associative array that associates a DICOM tag with its | |
38 new string value. The value is dynamically cast to the proper DICOM | |
39 data type (an HTTP error will occur if the cast fails). Replacements | |
40 are applied after all the tags to anonymize have been removed. | |
41 * ``Keep`` specifies a list of tags that should be preserved from full | |
42 anonymization. | |
43 * If ``KeepPrivateTags`` is absent from the JSON request, private tags | |
44 (i.e. manufacturer-specific tags) are also removed. This is the | |
45 default behavior, as such tags can contain patient-specific | |
46 information. | |
47 | |
48 | |
49 Modification of a Single Instance | |
50 --------------------------------- | |
51 | |
52 Orthanc allows to modify a set of specified tags in a single DICOM | |
53 instance and to download the resulting anonymized DICOM | |
54 file. Example:: | |
55 | |
56 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/modify -X POST -d '{"Replace":{"PatientName":"hello","PatientID":"world"},"Remove":["InstitutionName"],"RemovePrivateTags": null}' > Modified.dcm | |
57 | |
58 Remarks: | |
59 | |
60 * The ``Remove`` array specifies the list of the tags to remove. | |
61 * The ``Replace`` associative array specifies the substitions to be applied (cf. anonymization). | |
62 * If ``RemovePrivateTags`` is present, the private tags (i.e. manufacturer-specific tags) are removed. | |
63 | |
64 | |
65 Modification of Studies or Series | |
66 --------------------------------- | |
67 | |
68 .. highlight:: bash | |
69 | |
70 It is possible to modify all the instances from a study or from a | |
71 series in a single request. In this case, the modified instances are | |
72 stored back into the Orthanc store. Here is how to modify a series:: | |
73 | |
74 $ curl http://localhost:8042/series/95a6e2bf-9296e2cc-bf614e2f-22b391ee-16e010e0/modify -X POST -d '{"Replace":{"InstitutionName":"My own clinic"}}' | |
75 | |
76 | |
77 .. highlight:: json | |
78 | |
79 The parameters are identical to those used to modify a single | |
80 instance. Orthanc will answer a JSON message that tells where the | |
81 modified series has been stored:: | |
82 | |
83 { | |
84 "ID" : "3bd3d343-82879d86-da77321c-1d23fd6b-faa07bce", | |
85 "Path" : "/series/3bd3d343-82879d86-da77321c-1d23fd6b-faa07bce" | |
86 } | |
87 | |
88 | |
89 .. highlight:: bash | |
90 | |
91 Similarly, here is an interaction to modify a study:: | |
92 | |
93 $ curl http://localhost:8042/studies/ef2ce55f-9342856a-aee23907-2667e859-9f3b734d/modify -X POST -d '{"Replace":{"InstitutionName":"My own clinic"}}' | |
94 | |
95 .. highlight:: json | |
96 | |
97 :: | |
98 | |
99 { | |
100 "ID" : "1c3f7bf4-85b4aa20-236e6315-5d450dcc-3c1bcf28", | |
101 "Path" : "/studies/1c3f7bf4-85b4aa20-236e6315-5d450dcc-3c1bcf28" | |
102 } | |
103 | |
104 | |
105 Modification of Patients | |
106 ------------------------ | |
107 | |
108 .. highlight:: bash | |
109 | |
110 Starting with Orthanc 0.7.5, Orthanc can also modify all the instances | |
111 of a patient with a single REST call. Here is a sample:: | |
112 | |
113 $ curl http://localhost:8042/patients/6fb47ef5-072f4557-3215aa29-f99515c1-6fa22bf0/modify -X POST -d '{"Replace":{"PatientID":"Hello","PatientName":"Sample patient name"}}' | |
114 | |
115 .. highlight:: json | |
116 | |
117 :: | |
118 | |
119 { | |
120 "ID" : "f7ff9e8b-7bb2e09b-70935a5d-785e0cc5-d9d0abf0", | |
121 "Path" : "/patients/f7ff9e8b-7bb2e09b-70935a5d-785e0cc5-d9d0abf0", | |
122 "PatientID" : "f7ff9e8b-7bb2e09b-70935a5d-785e0cc5-d9d0abf0", | |
123 "Type" : "Patient" | |
124 } | |
125 | |
126 Please note that, in this case, you have to set the value of the | |
127 ``PatientID (0010,0020)`` tag for Orthanc to accept this modification: | |
128 This is a security to prevent the merging of patient data before and | |
129 after anonymization, if the user does not explicitly tell Orthanc to | |
130 do so. | |
131 | |
132 | |
133 Anonymization of Patients, Studies or Series | |
134 -------------------------------------------- | |
135 | |
136 .. highlight:: bash | |
137 | |
138 Study and series can be anonymized the same way as they are modified:: | |
139 | |
140 $ curl http://localhost:8042/patients/6fb47ef5-072f4557-3215aa29-f99515c1-6fa22bf0/anonymize -X POST -d '{}' | |
141 $ curl http://localhost:8042/studies/ef2ce55f-9342856a-aee23907-2667e859-9f3b734d/anonymize -X POST -d '{}' | |
142 $ curl http://localhost:8042/series/95a6e2bf-9296e2cc-bf614e2f-22b391ee-16e010e0/anonymize -X POST -d '{}' | |
143 | |
144 As written above, the anonymization process can be fine-tuned by using | |
145 a JSON body. |