Mercurial > hg > orthanc-book
comparison Sphinx/source/users/anonymization.rst @ 112:6d357adfd892
updates for the new 1.3.0 API
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 Jul 2017 16:26:11 +0200 |
parents | eaec5029ef01 |
children | 2e826633420e |
comparison
equal
deleted
inserted
replaced
111:eaec5029ef01 | 112:6d357adfd892 |
---|---|
23 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{}' > Anonymized.dcm | 23 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{}' > Anonymized.dcm |
24 | 24 |
25 It is possible to control how anonymization is achieved by specifying | 25 It is possible to control how anonymization is achieved by specifying |
26 a JSON body:: | 26 a JSON body:: |
27 | 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, "DicomVersion" : "2017c"}' > Anonymized.dcm | 28 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{"Replace":{"PatientName":"Hello","0010-1001":"World"},"Keep":["StudyDescription", "SeriesDescription"],"KeepPrivateTags": true, "DicomVersion" : "2017c"}' > Anonymized.dcm |
29 | 29 |
30 Explanations: | 30 Explanations: |
31 | 31 |
32 * New UUIDs are automatically generated for the study, the series and | 32 * New UUIDs are automatically generated for the study, the series and |
33 the instance. | 33 the instance. |
34 * The DICOM tags can be specified either by their name (``PatientName``) | 34 * The DICOM tags can be specified either by their name |
35 or by their hexadecimal identifier (``0010-0020`` corresponds to | 35 (``PatientName``) or by their hexadecimal identifier (in the example |
36 ``PatientID``). | 36 above, ``0010-1001`` corresponds to ``Other Patient Names``). |
37 * ``Replace`` is an associative array that associates a DICOM tag with its | 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 | 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 | 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. | 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 | 41 * ``Keep`` specifies a list of tags that should be preserved from full |
42 anonymization. | 42 anonymization. |
43 * If ``KeepPrivateTags`` is absent from the JSON request, private tags | 43 * If ``KeepPrivateTags`` is set to ``true`` in the JSON request, |
44 (i.e. manufacturer-specific tags) are also removed. This is the | 44 private tags (i.e. manufacturer-specific tags) are not removed by |
45 default behavior, as such tags can contain patient-specific | 45 the anonymization process. The default behavior consists in removing |
46 the private tags, as such tags can contain patient-specific | |
46 information. | 47 information. |
47 * ``DicomVersion`` specifies which version of the DICOM standard shall be used | 48 * ``DicomVersion`` specifies which version of the DICOM standard shall be used |
48 for anonymization. Allowed values are ``2008`` and ``2017c`` (default value | 49 for anonymization. Allowed values are ``2008`` and ``2017c`` (default value |
49 if the parameter is absent). This parameter has been introduced in Orthanc | 50 if the parameter is absent). This parameter has been introduced in Orthanc |
50 1.3.0. In earlier version, the ``2008`` standard was used. | 51 1.3.0. In earlier version, the ``2008`` standard was used. |
55 | 56 |
56 Orthanc allows to modify a set of specified tags in a single DICOM | 57 Orthanc allows to modify a set of specified tags in a single DICOM |
57 instance and to download the resulting anonymized DICOM | 58 instance and to download the resulting anonymized DICOM |
58 file. Example:: | 59 file. Example:: |
59 | 60 |
60 $ 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 | 61 $ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/modify -X POST -d '{"Replace":{"PatientName":"hello","PatientID":"world"},"Remove":["InstitutionName"],"RemovePrivateTags": true, "Force": true}' > Modified.dcm |
61 | 62 |
62 Remarks: | 63 Remarks: |
63 | 64 |
64 * The ``Remove`` array specifies the list of the tags to remove. | 65 * The ``Remove`` array specifies the list of the tags to remove. |
65 * The ``Replace`` associative array specifies the substitions to be applied (cf. anonymization). | 66 * The ``Replace`` associative array specifies the substitions to be applied (cf. anonymization). |
66 * If ``RemovePrivateTags`` is present, the private tags (i.e. manufacturer-specific tags) are removed. | 67 * If ``RemovePrivateTags`` is set to ``true``, the private tags |
68 (i.e. manufacturer-specific tags) are removed. | |
69 * The ``Force`` option must be set to ``true``, in order to allow the | |
70 modification of the ``PatientID``, as such a modification of the | |
71 :ref:`DICOM identifiers <dicom-identifiers>` might lead to breaking | |
72 the DICOM model of the real-world. | |
67 | 73 |
68 | 74 |
69 Modification of Studies or Series | 75 Modification of Studies or Series |
70 --------------------------------- | 76 --------------------------------- |
71 | 77 |
112 .. highlight:: bash | 118 .. highlight:: bash |
113 | 119 |
114 Starting with Orthanc 0.7.5, Orthanc can also modify all the instances | 120 Starting with Orthanc 0.7.5, Orthanc can also modify all the instances |
115 of a patient with a single REST call. Here is a sample:: | 121 of a patient with a single REST call. Here is a sample:: |
116 | 122 |
117 $ curl http://localhost:8042/patients/6fb47ef5-072f4557-3215aa29-f99515c1-6fa22bf0/modify -X POST -d '{"Replace":{"PatientID":"Hello","PatientName":"Sample patient name"}}' | 123 $ curl http://localhost:8042/patients/6fb47ef5-072f4557-3215aa29-f99515c1-6fa22bf0/modify -X POST -d '{"Replace":{"PatientID":"Hello","PatientName":"Sample patient name"},"Force":true}' |
118 | 124 |
119 .. highlight:: json | 125 .. highlight:: json |
120 | 126 |
121 :: | 127 :: |
122 | 128 |